Castor3D 0.12.0
Multiplatform 3D engine
Public Member Functions | Friends | List of all members
castor3d::Mesh Class Reference

#include <Mesh.hpp>

Inheritance diagram for castor3d::Mesh:
Inheritance graph
[legend]
Collaboration diagram for castor3d::Mesh:
Collaboration graph
[legend]

Public Member Functions

C3D_API Mesh (castor::String const &name, Scene &scene)
 Constructor. More...
 
C3D_API ~Mesh () override
 Destructor. More...
 
C3D_API Mesh (Mesh &&rhs)=default
 Move constructor. More...
 
C3D_API Meshoperator= (Mesh &&rhs)=delete
 Move assignment operator. More...
 
C3D_API Mesh (Mesh const &rhs)=delete
 Copy constructor. More...
 
C3D_API Meshoperator= (Mesh const &rhs)=delete
 Copy assignment operator. More...
 
C3D_API void initialise ()
 
C3D_API void cleanup ()
 
C3D_API void updateContainers ()
 Computes the bounding box and sphere from the submeshes. More...
 
C3D_API void computeContainers ()
 Computes the bounding 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 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 &submesh)
 Deletes a given submesh if it is in the mesh's submeshes. More...
 
C3D_API void computeNormals (bool reverted=false)
 Generates normals and tangents. More...
 
C3D_API void setSkeleton (SkeletonSPtr skeleton)
 Sets the skeleton. More...
 
C3D_API MeshAnimationcreateAnimation (castor::String const &name)
 Creates an animation. More...
 
C3D_API void removeAnimation (castor::String const &name)
 Removes an animation. 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::BoundingBox const & getBoundingBox () const
 Retrieves the collision box. More...
 
castor::BoundingSphere const & getBoundingSphere () const
 Retrieves the collision sphere. More...
 
SkeletonSPtr getSkeleton () const
 Retrieves the skeleton. More...
 
bool isSerialisable () const
 
void setSerialisable (bool value)
 Sets the serialisable status. More...
 
SceneRPtr getScene () const
 
- Public Member Functions inherited from castor3d::AnimableT< Engine >
virtual C3D_API ~AnimableT ()=default
 
void cleanupAnimations ()
 Empties the animations map. More...
 
bool hasAnimation () const
 
bool hasAnimation (castor::String const &name) const
 
Animation const & getAnimation (castor::String const &name) const
 Retrieves an animation. More...
 
AnimationgetAnimation (castor::String const &name)
 Retrieves an animation. More...
 
void addAnimation (AnimationPtr animation)
 Adds an animation. More...
 
AnimationPtrStrMap const & getAnimations () const
 

Friends

class MeshGenerator
 
class BinaryWriter< Mesh >
 
class BinaryParser< Mesh >
 

Additional Inherited Members

- Protected Types inherited from castor3d::AnimableT< Engine >
using Animation = AnimationT< Engine >
 
using AnimationPtr = std::unique_ptr< Animation >
 
using AnimationPtrStrMap = std::map< castor::String, AnimationPtr >
 
- Protected Member Functions inherited from castor3d::AnimableT< Engine >
void doRemoveAnimation (castor::String const &name)
 Removes an animation. More...
 
AnimationTypedoGetAnimation (castor::String const &name)
 Retrieves an animation. More...
 
AnimationType const & doGetAnimation (castor::String const &name) const
 Retrieves an animation. More...
 
 AnimableT (Engine &owner)
 
C3D_API AnimableT (AnimableT &&rhs)=default
 
C3D_API AnimableT (AnimableT const &rhs)=delete
 
C3D_API AnimableToperator= (AnimableT &&rhs)=delete
 
C3D_API AnimableToperator= (AnimableT const &rhs)=delete
 
- Protected Attributes inherited from castor3d::AnimableT< Engine >
AnimationPtrStrMap m_animations
 

Constructor & Destructor Documentation

◆ Mesh() [1/3]

C3D_API castor3d::Mesh::Mesh ( castor::String const &  name,
Scene scene 
)

Constructor.

Parameters
[in]nameThis mesh name.
[in]sceneThe parent scene.

◆ ~Mesh()

C3D_API castor3d::Mesh::~Mesh ( )
override

Destructor.

◆ Mesh() [2/3]

C3D_API castor3d::Mesh::Mesh ( Mesh &&  rhs)
default

Move constructor.

◆ Mesh() [3/3]

C3D_API castor3d::Mesh::Mesh ( Mesh const &  rhs)
delete

Copy constructor.

Member Function Documentation

◆ begin() [1/2]

SubmeshPtrArrayIt castor3d::Mesh::begin ( )
inline

Retrieves an iterator to the begin of the submeshes.

◆ begin() [2/2]

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

Retrieves a constant iterator to the begin of the submeshes.

◆ cleanup()

C3D_API void castor3d::Mesh::cleanup ( )

◆ computeContainers()

C3D_API void castor3d::Mesh::computeContainers ( )

Computes the bounding box and sphere.

◆ computeNormals()

C3D_API void castor3d::Mesh::computeNormals ( bool  reverted = false)

Generates normals and tangents.

◆ createAnimation()

C3D_API MeshAnimation & castor3d::Mesh::createAnimation ( castor::String const &  name)

Creates an animation.

Parameters
[in]nameThe animation name
Returns
The animation

◆ createSubmesh()

C3D_API SubmeshSPtr castor3d::Mesh::createSubmesh ( )

Creates a submesh.

Returns
The created submesh

◆ deleteSubmesh()

C3D_API void castor3d::Mesh::deleteSubmesh ( SubmeshSPtr &  submesh)

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

Parameters
[in]submeshThe submesh to delete

◆ end() [1/2]

SubmeshPtrArrayIt castor3d::Mesh::end ( )
inline

Retrieves an iterator to the end of the submeshes.

◆ end() [2/2]

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

Retrieves a constant iterator to the end of the submeshes.

◆ getBoundingBox()

castor::BoundingBox const & castor3d::Mesh::getBoundingBox ( ) const
inline

Retrieves the collision box.

Returns
The value

◆ getBoundingSphere()

castor::BoundingSphere const & castor3d::Mesh::getBoundingSphere ( ) const
inline

Retrieves the collision sphere.

Returns
The value

◆ getFaceCount()

C3D_API uint32_t castor3d::Mesh::getFaceCount ( ) const

Returns the total faces count.

Returns
The faces count

◆ getScene()

SceneRPtr castor3d::Mesh::getScene ( ) const
inline

◆ getSkeleton()

SkeletonSPtr castor3d::Mesh::getSkeleton ( ) const
inline

Retrieves the skeleton.

Returns
The value

◆ getSubmesh()

C3D_API SubmeshSPtr castor3d::Mesh::getSubmesh ( uint32_t  index) const

Tries to retrieve the submesh at the given index.

Parameters
[in]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

◆ getVertexCount()

C3D_API uint32_t castor3d::Mesh::getVertexCount ( ) const

Returns the total vertex count.

Returns
The vertex count

◆ initialise()

C3D_API void castor3d::Mesh::initialise ( )

◆ isModified()

bool castor3d::Mesh::isModified ( ) const
inline

Retrieves the modify status.

Returns
The value

◆ isSerialisable()

bool castor3d::Mesh::isSerialisable ( ) const
inline
Returns
The serialisable status.

◆ operator=() [1/2]

C3D_API Mesh & castor3d::Mesh::operator= ( Mesh &&  rhs)
delete

Move assignment operator.

◆ operator=() [2/2]

C3D_API Mesh & castor3d::Mesh::operator= ( Mesh const &  rhs)
delete

Copy assignment operator.

◆ removeAnimation()

C3D_API void castor3d::Mesh::removeAnimation ( castor::String const &  name)

Removes an animation.

Parameters
[in]nameThe animation name

◆ setSerialisable()

void castor3d::Mesh::setSerialisable ( bool  value)
inline

Sets the serialisable status.

Parameters
[in]valueThe new value.

◆ setSkeleton()

C3D_API void castor3d::Mesh::setSkeleton ( SkeletonSPtr  skeleton)

Sets the skeleton.

Parameters
[in]skeletonThe new value

◆ updateContainers()

C3D_API void castor3d::Mesh::updateContainers ( )

Computes the bounding box and sphere from the submeshes.

Friends And Related Function Documentation

◆ BinaryParser< Mesh >

friend class BinaryParser< Mesh >
friend

◆ BinaryWriter< Mesh >

friend class BinaryWriter< Mesh >
friend

◆ MeshGenerator

friend class MeshGenerator
friend

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