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 const std::vector<TiXmlElement*> &rootNodeXmls,
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* LoadSingleSkeletonNode(TiXmlElement *_xml,
87 private:
SkeletonNode* LoadSkeletonNodes(TiXmlElement *_xml,
93 private:
void SetSkeletonNodeTransform(TiXmlElement *_elem,
100 private:
void LoadGeometry(TiXmlElement *_xml,
101 const ignition::math::Matrix4d &_transform,
Mesh *_mesh);
107 private: TiXmlElement *GetElementId(TiXmlElement *_parent,
108 const std::string &_name,
109 const std::string &_id);
114 private: TiXmlElement *GetElementId(
const std::string &_name,
115 const std::string &_id);
121 private:
void LoadNode(TiXmlElement *_elem,
Mesh *_mesh,
122 const ignition::math::Matrix4d &_transform);
127 private: ignition::math::Matrix4d LoadNodeTransform(TiXmlElement *_elem);
134 private:
void LoadVertices(
const std::string &_id,
135 const ignition::math::Matrix4d &_transform,
136 std::vector<ignition::math::Vector3d> &_verts,
137 std::vector<ignition::math::Vector3d> &_norms);
146 private:
void LoadVertices(
const std::string &_id,
147 const ignition::math::Matrix4d &_transform,
148 std::vector<ignition::math::Vector3d> &_verts,
149 std::vector<ignition::math::Vector3d> &_norms,
150 std::map<unsigned int, unsigned int> &_vertDup,
151 std::map<unsigned int, unsigned int> &_normDup);
158 private:
void LoadPositions(
const std::string &_id,
159 const ignition::math::Matrix4d &_transform,
160 std::vector<ignition::math::Vector3d> &_values,
161 std::map<unsigned int, unsigned int> &_duplicates);
168 private:
void LoadNormals(
const std::string &_id,
169 const ignition::math::Matrix4d &_transform,
170 std::vector<ignition::math::Vector3d> &_values,
171 std::map<unsigned int, unsigned int> &_duplicates);
177 private:
void LoadTexCoords(
const std::string &_id,
178 std::vector<ignition::math::Vector2d> &_values,
179 std::map<unsigned int, unsigned int> &_duplicates);
184 private:
Material *LoadMaterial(
const std::string &_name);
190 private:
void LoadColorOrTexture(TiXmlElement *_elem,
191 const std::string &_type,
198 private:
void LoadTriangles(TiXmlElement *_trianglesXml,
199 const ignition::math::Matrix4d &_transform,
206 private:
void LoadPolylist(TiXmlElement *_polylistXml,
207 const ignition::math::Matrix4d &_transform,
214 private:
void LoadLines(TiXmlElement *_xml,
215 const ignition::math::Matrix4d &_transform,
220 private:
void LoadScene(
Mesh *_mesh);
225 private:
float LoadFloat(TiXmlElement *_elem);
230 private:
void LoadTransparent(TiXmlElement *_elem,
Material *_mat);
241 private:
void MergeSkeleton(
Skeleton *_skeleton,
251 private:
void ApplyInvBindTransform(
Skeleton *_skeleton);
255 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
Forward declarations for the common classes.
Definition: Animation.hh:26
Class used to load Collada mesh files.
Definition: ColladaLoader.hh:46
A skeleton node.
Definition: Skeleton.hh:179
common
Definition: FuelModelDatabase.hh:37