18 #ifndef _GAZEBO_COLLADALOADER_HH_
19 #define _GAZEBO_COLLADALOADER_HH_
25 #include <ignition/math/Matrix4.hh>
26 #include <ignition/math/Vector3.hh>
27 #include <ignition/math/Vector2.hh>
39 class ColladaLoaderPrivate;
57 public:
virtual Mesh *Load(
const std::string &_filename);
64 private:
void LoadController(TiXmlElement *_contrXml,
65 TiXmlElement *_skelXml,
66 const ignition::math::Matrix4d &_transform,
Mesh *_mesh);
71 private:
void LoadAnimations(TiXmlElement *_xml,
Skeleton *_skel);
76 private:
void LoadAnimationSet(TiXmlElement *_xml,
Skeleton *_skel);
81 private:
SkeletonNode* LoadSkeletonNodes(TiXmlElement *_xml,
87 private:
void SetSkeletonNodeTransform(TiXmlElement *_elem,
94 private:
void LoadGeometry(TiXmlElement *_xml,
95 const ignition::math::Matrix4d &_transform,
Mesh *_mesh);
101 private: TiXmlElement *GetElementId(TiXmlElement *_parent,
102 const std::string &_name,
103 const std::string &_id);
108 private: TiXmlElement *GetElementId(
const std::string &_name,
109 const std::string &_id);
115 private:
void LoadNode(TiXmlElement *_elem,
Mesh *_mesh,
116 const ignition::math::Matrix4d &_transform);
121 private: ignition::math::Matrix4d LoadNodeTransform(TiXmlElement *_elem);
128 private:
void LoadVertices(
const std::string &_id,
129 const ignition::math::Matrix4d &_transform,
130 std::vector<ignition::math::Vector3d> &_verts,
131 std::vector<ignition::math::Vector3d> &_norms);
140 private:
void LoadVertices(
const std::string &_id,
141 const ignition::math::Matrix4d &_transform,
142 std::vector<ignition::math::Vector3d> &_verts,
143 std::vector<ignition::math::Vector3d> &_norms,
144 std::map<unsigned int, unsigned int> &_vertDup,
145 std::map<unsigned int, unsigned int> &_normDup);
152 private:
void LoadPositions(
const std::string &_id,
153 const ignition::math::Matrix4d &_transform,
154 std::vector<ignition::math::Vector3d> &_values,
155 std::map<unsigned int, unsigned int> &_duplicates);
162 private:
void LoadNormals(
const std::string &_id,
163 const ignition::math::Matrix4d &_transform,
164 std::vector<ignition::math::Vector3d> &_values,
165 std::map<unsigned int, unsigned int> &_duplicates);
171 private:
void LoadTexCoords(
const std::string &_id,
172 std::vector<ignition::math::Vector2d> &_values,
173 std::map<unsigned int, unsigned int> &_duplicates);
178 private:
Material *LoadMaterial(
const std::string &_name);
184 private:
void LoadColorOrTexture(TiXmlElement *_elem,
185 const std::string &_type,
192 private:
void LoadTriangles(TiXmlElement *_trianglesXml,
193 const ignition::math::Matrix4d &_transform,
200 private:
void LoadPolylist(TiXmlElement *_polylistXml,
201 const ignition::math::Matrix4d &_transform,
208 private:
void LoadLines(TiXmlElement *_xml,
209 const ignition::math::Matrix4d &_transform,
214 private:
void LoadScene(
Mesh *_mesh);
219 private:
float LoadFloat(TiXmlElement *_elem);
224 private:
void LoadTransparent(TiXmlElement *_elem,
Material *_mat);
228 private: ColladaLoaderPrivate *dataPtr;
A 3D mesh.
Definition: Mesh.hh:42
Base class for loading meshes.
Definition: MeshLoader.hh:36
A skeleton.
Definition: Skeleton.hh:52
Encapsulates description of a material.
Definition: common/Material.hh:34
Class used to load Collada mesh files.
Definition: ColladaLoader.hh:46
A skeleton node.
Definition: Skeleton.hh:173