17 #ifndef _GAZEBO_MESH_HH_
18 #define _GAZEBO_MESH_HH_
46 public:
virtual ~
Mesh();
50 public:
void SetPath(
const std::string &_path);
54 public: std::string GetPath()
const;
58 public:
void SetName(
const std::string &_n);
62 public: std::string GetName()
const;
74 public:
unsigned int GetVertexCount()
const;
78 public:
unsigned int GetNormalCount()
const;
82 public:
unsigned int GetIndexCount()
const;
86 public:
unsigned int GetTexCoordCount()
const;
91 public:
void AddSubMesh(
SubMesh *_child);
95 public:
unsigned int GetSubMeshCount()
const;
100 public:
int AddMaterial(
Material *_mat);
104 public:
unsigned int GetMaterialCount()
const;
109 public:
const Material *GetMaterial(
int _index)
const;
114 public:
int GetMaterialIndex(
const Material *_mat)
const;
120 public:
const SubMesh *GetSubMesh(
unsigned int _i)
const;
125 public:
const SubMesh *GetSubMesh(
const std::string &_name)
const;
130 public:
void FillArrays(
float **_vertArr,
int **_indArr)
const;
134 public:
void RecalculateNormals();
146 public:
void GenSphericalTexCoord(
const math::Vector3 &_center);
150 public:
Skeleton* GetSkeleton()
const;
153 public:
void SetSkeleton(
Skeleton *_skel);
156 public:
bool HasSkeleton()
const;
160 public:
void Scale(
double _factor);
176 private: std::string name;
179 private: std::string path;
182 private: std::vector<SubMesh *> submeshes;
185 private: std::vector<Material *> materials;
226 public:
void SetName(
const std::string &_n);
230 public: std::string GetName()
const;
234 public:
void SetPrimitiveType(PrimitiveType _type);
238 public: PrimitiveType GetPrimitiveType()
const;
242 public:
void CopyVertices(
const std::vector<math::Vector3> &_verts);
246 public:
void CopyNormals(
const std::vector<math::Vector3> &_norms);
250 public:
void SetVertexCount(
unsigned int _count);
254 public:
void SetIndexCount(
unsigned int _count);
258 public:
void SetNormalCount(
unsigned int _count);
262 public:
void SetTexCoordCount(
unsigned int _count);
266 public:
void AddIndex(
unsigned int _i);
276 public:
void AddVertex(
double _x,
double _y,
double _z);
286 public:
void AddNormal(
double _x,
double _y,
double _z);
291 public:
void AddTexCoord(
double _u,
double _v);
297 public:
void AddNodeAssignment(
unsigned int _vertex,
unsigned int _node,
308 public:
void SetVertex(
unsigned int _i,
const math::Vector3 &_v);
318 public:
void SetNormal(
unsigned int _i,
const math::Vector3 &_n);
332 public:
void SetTexCoord(
unsigned int _i,
const math::Vector2d &_t);
336 public:
unsigned int GetIndex(
unsigned int _i)
const;
347 public:
unsigned int GetVertexCount()
const;
350 public:
unsigned int GetNormalCount()
const;
353 public:
unsigned int GetIndexCount()
const;
356 public:
unsigned int GetTexCoordCount()
const;
359 public:
unsigned int GetNodeAssignmentsCount()
const;
362 public:
unsigned int GetMaxIndex()
const;
367 public:
void SetMaterialIndex(
unsigned int _index);
370 public:
unsigned int GetMaterialIndex()
const;
378 public:
unsigned int GetVertexIndex(
const math::Vector3 &_v)
const;
383 public:
void FillArrays(
float **_vertArr,
int **_indArr)
const;
386 public:
void RecalculateNormals();
395 public:
void GenSphericalTexCoord(
const math::Vector3 &_center);
399 public:
void Scale(
double _factor);
415 private: std::vector< math::Vector3 > vertices;
418 private: std::vector< math::Vector3 > normals;
421 private: std::vector< math::Vector2d > texCoords;
424 private: std::vector<unsigned int> indices;
427 private: std::vector<NodeAssignment> nodeAssignments;
430 private: PrimitiveType primitiveType;
434 private:
int materialIndex;
437 private: std::string name;
A 3D mesh.
Definition: Mesh.hh:40
A skeleton.
Definition: Skeleton.hh:50
Encapsulates description of a material.
Definition: common/Material.hh:34
Generic double x, y vector.
Definition: Vector2d.hh:39
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
A child mesh.
Definition: Mesh.hh:209
unsigned int nodeIndex
node (or bone) index
Definition: Mesh.hh:202
unsigned int vertexIndex
index of the vertex
Definition: Mesh.hh:199
PrimitiveType
An enumeration of the geometric mesh primitives.
Definition: Mesh.hh:212
Vertex to node weighted assignement for skeleton animation visualization.
Definition: Mesh.hh:193
static const Vector3 Zero
math::Vector3(0, 0, 0)
Definition: Vector3.hh:46
float weight
the weight (between 0 and 1)
Definition: Mesh.hh:205
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48