63 std::vector<ModelObject*>
Load(std::string_view path_name, std::string_view res_name)
67 return _load_obj(path_name);
68 else if (ext ==
"glb")
69 return _load_gltf(path_name, res_name,
true);
70 else if (ext ==
"gltf")
71 return _load_gltf(path_name, res_name,
false);
72 log_err(
"不支持的模型格式:{}", path_name);
76 std::vector<ModelObject*> _load_obj(std::string_view path_name);
77 std::vector<ModelObject*> _load_gltf(
78 std::string_view path_name, std::string_view res_name,
bool is_glb);
82 uint32_t* _indexBuffer;
85 size_t _vertexPos = 0;
88 void _gltf_load_material(
const tinygltf::Model& model, std::string_view res_name,
89 std::vector<ModelObjectMaterial>& mo_material);
91 void _gltf_load_scene(
const tinygltf::Model& model, ModelData* data);
94 void _gltf_get_node_prop(
const tinygltf::Model& model,
const tinygltf::Node& node,
95 size_t& vertex_count,
size_t& index_count);
98 void _gltf_load_node(
const tinygltf::Model& model,
int node,
99 ModelNode* model_node_parent, LoaderInfo& loader_info, ModelData* data);
101 void _gltf_load_skin(
const tinygltf::Model& model, ModelData* data);
103 void _gltf_load_animation(
const tinygltf::Model& model, ModelData* data);
105 ModelNode* findNode(ModelData* data, ModelNode* parent, uint32_t index);
107 ModelNode* nodeFromIndex(ModelData* data, uint32_t index);
109 Position3 _vec3_cast(
const std::vector<double>& vec3);
110 Position4 _vec4_cast(
const std::vector<double>& vec4);
115 Matrix4 _mat4_cast(
const std::vector<double>& matrix);