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);
84 uint32_t* _indexBuffer;
88 size_t _vertexPos = 0;
91 void _gltf_load_material(
const tinygltf::Model& model, std::string_view res_name,
92 std::vector<ModelMaterial>& vec_material);
94 void _gltf_load_scene(
const tinygltf::Model& model, ModelData& data);
97 void _gltf_get_node_prop(
const tinygltf::Model& model,
const tinygltf::Node& node,
98 size_t& vertex_count,
size_t& index_count);
101 void _gltf_load_node(
const tinygltf::Model& model,
int node,
102 ModelNode* model_node_parent, ModelData& data);
104 void _gltf_load_skin(
const tinygltf::Model& model, ModelData& data);
106 void _gltf_load_animation(
const tinygltf::Model& model, ModelData& data);
108 ModelNode* _find_node(ModelData& data, uint32_t index);
109 Matrix4 _get_node_mat_world(
const ModelNode* node);
111 Position3 _vec3_cast(
const std::vector<double>& vec3);
112 Position4 _vec4_cast(
const std::vector<double>& vec4);
113 Position4 _quat_cast(
const std::vector<double>& vec4);
118 Matrix4 _mat4_cast(
const std::vector<double>& matrix);