Castor3D  ..
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Castor3D::Mesh Class Reference

The mesh representation. More...

+ Inheritance diagram for Castor3D::Mesh:
+ Collaboration diagram for Castor3D::Mesh:

Classes

class  BinaryParser
 MovableObject loader. More...
 
class  TextLoader
 Mesh loader. More...
 

Public Member Functions

C3D_API Mesh (Castor::String const &p_name, Engine &p_engine)
 Constructor. More...
 
C3D_API ~Mesh ()
 Destructor. More...
 
C3D_API void Cleanup ()
 Clears all submeshes. More...
 
C3D_API void ComputeContainers ()
 Computes the collision box and sphere. More...
 
C3D_API uint32_t GetFaceCount () const
 Returns the total faces count. More...
 
C3D_API uint32_t GetVertexCount () const
 Returns the total vertex count. More...
 
C3D_API SubmeshSPtr GetSubmesh (uint32_t p_index) const
 Tries to retrieve the submesh at the given index. More...
 
C3D_API SubmeshSPtr CreateSubmesh ()
 Creates a submesh. More...
 
C3D_API void DeleteSubmesh (SubmeshSPtr &p_pSubmesh)
 Deletes a given submesh if it is in the mesh's submeshes. More...
 
C3D_API MeshSPtr Clone (Castor::String const &p_name)
 Clones the mesh, with a new name. More...
 
C3D_API void ComputeNormals (bool p_reverted=false)
 Generates normals and tangents. More...
 
C3D_API void Ref (MaterialSPtr p_material)
 Increments submeshes' instance count. More...
 
C3D_API void UnRef (MaterialSPtr p_material)
 Decrements submeshes' instance count. More...
 
C3D_API void SetSkeleton (SkeletonSPtr p_skeleton)
 Sets the skeleton. More...
 
SubmeshPtrArrayIt begin ()
 Retrieves an iterator to the begin of the submeshes. More...
 
SubmeshPtrArrayConstIt begin () const
 Retrieves a constant iterator to the begin of the submeshes. More...
 
SubmeshPtrArrayIt end ()
 Retrieves an iterator to the end of the submeshes. More...
 
SubmeshPtrArrayConstIt end () const
 Retrieves a constant iterator to the end of the submeshes. More...
 
bool IsModified () const
 Retrieves the modify status. More...
 
uint32_t GetSubmeshCount () const
 Retrieves the submesh count. More...
 
Castor::CubeBox const & GetCollisionBox () const
 Retrieves the collision box. More...
 
Castor::SphereBox const & GetCollisionSphere () const
 Retrieves the collision sphere. More...
 
SkeletonSPtr GetSkeleton () const
 Retrieves the skeleton. More...
 
- Public Member Functions inherited from Castor3D::Animable
C3D_API AnimationSPtr CreateAnimation (Castor::String const &p_name)
 Creates an animation. More...
 
C3D_API void CleanupAnimations ()
 Empties the animations map. More...
 
C3D_API AnimationSPtr GetAnimation (Castor::String const &p_name)
 Retrieves an animation. More...
 
AnimationPtrStrMap const & GetAnimations () const
 

Protected Member Functions

 DECLARE_VECTOR (AnimationPtrStrMap, AnimationMap)
 
- Protected Member Functions inherited from Castor3D::Animable
 Animable ()
 Constructor. More...
 
 ~Animable ()
 Destructor. More...
 

Protected Attributes

bool m_modified
 Tells whether or not the mesh is modified. More...
 
Castor::CubeBox m_box
 The collision box. More...
 
Castor::SphereBox m_sphere
 The collision sphere. More...
 
SubmeshPtrArray m_submeshes
 The submeshes array. More...
 
SkeletonSPtr m_skeleton
 The skeleton. More...
 
- Protected Attributes inherited from Castor3D::Animable
AnimationPtrStrMap m_animations
 All animations. More...
 

Friends

class MeshGenerator
 

Detailed Description

The mesh representation.

Author
Sylvain DOREMUS
Date
14/02/2010
Remarks
A mesh is a collection of submeshes.

Constructor & Destructor Documentation

◆ Mesh()

C3D_API Castor3D::Mesh::Mesh ( Castor::String const &  p_name,
Engine p_engine 
)

Constructor.

Parameters
[in]p_nameThis mesh name
[in]p_engineThe parent engine

◆ ~Mesh()

C3D_API Castor3D::Mesh::~Mesh ( )

Destructor.

Member Function Documentation

◆ begin() [1/2]

SubmeshPtrArrayIt Castor3D::Mesh::begin ( )
inline

Retrieves an iterator to the begin of the submeshes.

References m_submeshes.

◆ begin() [2/2]

SubmeshPtrArrayConstIt Castor3D::Mesh::begin ( ) const
inline

Retrieves a constant iterator to the begin of the submeshes.

References m_submeshes.

◆ Cleanup()

C3D_API void Castor3D::Mesh::Cleanup ( )

Clears all submeshes.

◆ Clone()

C3D_API MeshSPtr Castor3D::Mesh::Clone ( Castor::String const &  p_name)

Clones the mesh, with a new name.

Parameters
[in]p_nameThe name of the cloned mesh
Returns
The cloned mesh

◆ ComputeContainers()

C3D_API void Castor3D::Mesh::ComputeContainers ( )

Computes the collision box and sphere.

◆ ComputeNormals()

C3D_API void Castor3D::Mesh::ComputeNormals ( bool  p_reverted = false)

Generates normals and tangents.

◆ CreateSubmesh()

C3D_API SubmeshSPtr Castor3D::Mesh::CreateSubmesh ( )

Creates a submesh.

Returns
The created submesh

◆ DECLARE_VECTOR()

Castor3D::Mesh::DECLARE_VECTOR ( AnimationPtrStrMap  ,
AnimationMap   
)
protected

◆ DeleteSubmesh()

C3D_API void Castor3D::Mesh::DeleteSubmesh ( SubmeshSPtr &  p_pSubmesh)

Deletes a given submesh if it is in the mesh's submeshes.

Parameters
[in]p_pSubmeshThe submesh to delete

◆ end() [1/2]

SubmeshPtrArrayIt Castor3D::Mesh::end ( )
inline

Retrieves an iterator to the end of the submeshes.

References m_submeshes.

◆ end() [2/2]

SubmeshPtrArrayConstIt Castor3D::Mesh::end ( ) const
inline

Retrieves a constant iterator to the end of the submeshes.

References m_submeshes.

◆ GetCollisionBox()

Castor::CubeBox const& Castor3D::Mesh::GetCollisionBox ( ) const
inline

Retrieves the collision box.

Returns
The value

References m_box.

◆ GetCollisionSphere()

Castor::SphereBox const& Castor3D::Mesh::GetCollisionSphere ( ) const
inline

Retrieves the collision sphere.

Returns
The value

References m_sphere.

◆ GetFaceCount()

C3D_API uint32_t Castor3D::Mesh::GetFaceCount ( ) const

Returns the total faces count.

Returns
The faces count

◆ GetSkeleton()

SkeletonSPtr Castor3D::Mesh::GetSkeleton ( ) const
inline

Retrieves the skeleton.

Returns
The value

References m_skeleton.

◆ GetSubmesh()

C3D_API SubmeshSPtr Castor3D::Mesh::GetSubmesh ( uint32_t  p_index) const

Tries to retrieve the submesh at the given index.

Parameters
[in]p_indexThe wanted submesh index
Returns
The found submesh, nullptr if not found

◆ GetSubmeshCount()

uint32_t Castor3D::Mesh::GetSubmeshCount ( ) const
inline

Retrieves the submesh count.

Returns
The value

References m_submeshes.

◆ GetVertexCount()

C3D_API uint32_t Castor3D::Mesh::GetVertexCount ( ) const

Returns the total vertex count.

Returns
The vertex count

◆ IsModified()

bool Castor3D::Mesh::IsModified ( ) const
inline

Retrieves the modify status.

Returns
The value

References m_modified.

◆ Ref()

C3D_API void Castor3D::Mesh::Ref ( MaterialSPtr  p_material)

Increments submeshes' instance count.

Parameters
[in]p_materialThe material for which the instance count is incremented

◆ SetSkeleton()

C3D_API void Castor3D::Mesh::SetSkeleton ( SkeletonSPtr  p_skeleton)

Sets the skeleton.

Parameters
[in]p_skeletonThe new value

◆ UnRef()

C3D_API void Castor3D::Mesh::UnRef ( MaterialSPtr  p_material)

Decrements submeshes' instance count.

Parameters
[in]p_materialThe material for which the instance count is decremented

Friends And Related Function Documentation

◆ MeshGenerator

friend class MeshGenerator
friend

Member Data Documentation

◆ m_box

Castor::CubeBox Castor3D::Mesh::m_box
protected

The collision box.

Referenced by GetCollisionBox().

◆ m_modified

bool Castor3D::Mesh::m_modified
protected

Tells whether or not the mesh is modified.

Referenced by IsModified().

◆ m_skeleton

SkeletonSPtr Castor3D::Mesh::m_skeleton
protected

The skeleton.

Referenced by GetSkeleton().

◆ m_sphere

Castor::SphereBox Castor3D::Mesh::m_sphere
protected

The collision sphere.

Referenced by GetCollisionSphere().

◆ m_submeshes

SubmeshPtrArray Castor3D::Mesh::m_submeshes
protected

The submeshes array.

Referenced by begin(), end(), and GetSubmeshCount().


The documentation for this class was generated from the following file: