Mesh.hh
Go to the documentation of this file.
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: SuppressWarning.hh:64
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: SuppressWarning.hh:67
void Scale(const ignition::math::Vector3d &_factor)
Scale all vertices by _factor.
void Translate(const ignition::math::Vector3d &_vec)
Move all vertices in all submeshes by _vec.
void Center(const ignition::math::Vector3d &_center=ignition::math::Vector3d::Zero)
Move the center of the mesh to the given coordinate in the mesh frame. This will move all the vertice...
int IndexOfMaterial(const Material *_mat) const
Get the index of material.
std::weak_ptr< SubMesh > AddSubMesh(const SubMesh &_child)
Add a submesh mesh. This can be an expensive since _child is copied into this mesh.
int AddMaterial(const MaterialPtr &_mat)
Add a material to the mesh.
void FillArrays(double **_vertArr, int **_indArr) const
Put all the data into flat arrays.
void RecalculateNormals()
Recalculate all the normals of each face defined by three indices.
double Volume() const
Compute the volume of this mesh. The primitive type must be TRIANGLES.
void SetPath(const std::string &_path)
Set the path which contains the mesh resource.
std::weak_ptr< SubMesh > SubMeshByIndex(const unsigned int _index) const
Get a child submesh by index.
unsigned int SubMeshCount() const
Get the number of child submeshes.
void AABB(ignition::math::Vector3d &_center, ignition::math::Vector3d &_minXYZ, ignition::math::Vector3d &_maxXYZ) const
Get axis-aligned bounding box in the mesh frame.
unsigned int TexCoordCount() const
Get the number of texture coordinates.
std::weak_ptr< SubMesh > SubMeshByName(const std::string &_name) const
Get a child submesh by name.
void SetScale(const ignition::math::Vector3d &_factor)
Set the scale all vertices.
void GenSphericalTexCoord(const ignition::math::Vector3d &_center)
Generate texture coordinates using spherical projection from center.
SkeletonPtr MeshSkeleton() const
Get the skeleton to which this mesh is attached.
std::weak_ptr< SubMesh > AddSubMesh(std::unique_ptr< SubMesh > _child)
Add a submesh mesh. This transfers ownership of _child to this mesh. The value of _child after this c...
MaterialPtr MaterialByIndex(const unsigned int _index) const
Get a material by index.
static const Vector3 Zero
Forward declarations for the common classes.