62 std::vector<ModelObject*>
Load(std::string_view path_name, std::string_view res_name)
66 return _load_obj(path_name);
67 else if (ext ==
"glb")
68 return _load_gltf(path_name, res_name,
true);
69 else if (ext ==
"gltf")
70 return _load_gltf(path_name, res_name,
false);
71 log_err(
"不支持的模型格式:{}", path_name);
75 std::vector<ModelObject*> _load_obj(std::string_view path_name);
76 std::vector<ModelObject*> _load_gltf(
77 std::string_view path_name, std::string_view res_name,
bool is_glb);
81 uint32_t* _indexBuffer;
84 size_t _vertexPos = 0;
87 void _gltf_load_material(
const tinygltf::Model& model, std::string_view res_name,
88 std::vector<ModelObjectMaterial>& mo_material);
90 void _gltf_load_scene(
const tinygltf::Model& model, ModelData* data);
93 void _gltf_get_node_prop(
const tinygltf::Model& model,
const tinygltf::Node& node,
94 size_t& vertex_count,
size_t& index_count);
97 void _gltf_load_node(
const tinygltf::Model& model,
int node,
98 ModelNode* model_node_parent, LoaderInfo& loader_info, ModelData* data);
100 void _gltf_load_skin(
const tinygltf::Model& model, ModelData* data);
102 void _gltf_load_animation(
const tinygltf::Model& model, ModelData* data);
104 ModelNode* findNode(ModelData* data, ModelNode* parent, uint32_t index);
106 ModelNode* nodeFromIndex(ModelData* data, uint32_t index);
108 Position3 _vec3_cast(
const std::vector<double>& vec3);
109 Position4 _vec4_cast(
const std::vector<double>& vec4);
114 Matrix4 _mat4_cast(
const std::vector<double>& matrix);