Castor3D 0.16.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.
 
C3D_API ~Mesh () noexcept override
 Destructor.
 
C3D_API Mesh (Mesh &&rhs)=default
 Move constructor.
 
C3D_API Meshoperator= (Mesh &&rhs)=delete
 Move assignment operator.
 
C3D_API Mesh (Mesh const &rhs)=delete
 Copy constructor.
 
C3D_API Meshoperator= (Mesh const &rhs)=delete
 Copy assignment operator.
 
C3D_API void initialise ()
 Initialises the mesh.
 
C3D_API void cleanup ()
 Cleans the submesh.
 
C3D_API crg::FramePassArray record (crg::ResourcesCache &resources, crg::FramePassGroup &graph, crg::FramePassArray previousPasses)
 Records the submeshes' dependent render passes.
 
C3D_API void registerDependencies (crg::FramePass &pass) const
 Records the submeshes's dependencies.
 
C3D_API void update (CpuUpdater &updater)
 Updates the submeshes' render components.
 
C3D_API void updateContainers ()
 Computes the bounding box and sphere from the submeshes.
 
C3D_API void computeContainers ()
 Computes the bounding box and sphere.
 
C3D_API uint32_t getFaceCount () const
 Returns the total faces count.
 
C3D_API uint32_t getVertexCount () const
 Returns the total vertex count.
 
C3D_API SubmeshRPtr getSubmesh (uint32_t index) const
 Tries to retrieve the submesh at the given index.
 
C3D_API SubmeshRPtr createSubmesh ()
 Creates a submesh.
 
C3D_API SubmeshRPtr createDefaultSubmesh ()
 Creates a submesh with positions, normals, tangents, and texcoords0 components.
 
C3D_API void deleteSubmesh (Submesh const *submesh)
 Deletes a given submesh if it is in the mesh's submeshes.
 
C3D_API void computeNormals (bool reverted=false)
 Generates normals and tangents.
 
C3D_API void setSkeleton (SkeletonRPtr skeleton)
 Sets the skeleton.
 
C3D_API MeshAnimationcreateAnimation (castor::String const &name)
 Creates an animation.
 
C3D_API void removeAnimation (castor::String const &name)
 Removes an animation.
 
SubmeshPtrArrayIt begin ()
 Retrieves an iterator to the begin of the submeshes.
 
SubmeshPtrArrayConstIt begin () const
 Retrieves a constant iterator to the begin of the submeshes.
 
SubmeshPtrArrayIt end ()
 Retrieves an iterator to the end of the submeshes.
 
SubmeshPtrArrayConstIt end () const
 Retrieves a constant iterator to the end of the submeshes.
 
Getters.
bool isModified () const
 
uint32_t getSubmeshCount () const
 
castor::BoundingBox const & getBoundingBox () const
 
castor::BoundingSphere const & getBoundingSphere () const
 
SkeletonRPtr getSkeleton () const
 
bool isSerialisable () const
 
SceneRPtr getScene () const
 
Setters.
void setSerialisable (bool value)
 
- Public Member Functions inherited from castor::NamedBaseT< T >
 NamedBaseT (T name) noexcept
 Constructor.
 
T const & getName () const noexcept
 Retrieves the name.
 
void rename (T name) noexcept
 
- Public Member Functions inherited from castor3d::AnimableT< Engine >
virtual C3D_API ~AnimableT () noexcept=default
 
void cleanupAnimations ()
 Empties the animations map.
 
bool hasAnimation () const
 
bool hasAnimation (castor::String const &name) const
 
Animation const & getAnimation (castor::String const &name) const
 Retrieves an animation.
 
AnimationgetAnimation (castor::String const &name)
 Retrieves an animation.
 
void addAnimation (AnimationPtr animation)
 Adds an animation.
 
AnimationsMap const & getAnimations () const
 
- Public Member Functions inherited from castor::OwnedBy< Owner >
Owner * getOwner () const
 

Friends

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

Additional Inherited Members

- Protected Types inherited from castor3d::AnimableT< Engine >
using Animation
 
using AnimationPtr
 
using AnimationsMap
 
- Protected Member Functions inherited from castor3d::AnimableT< Engine >
void doRemoveAnimation (castor::String const &name)
 Removes an animation.
 
AnimationTypedoGetAnimation (castor::String const &name)
 Retrieves an animation.
 
AnimationType const & doGetAnimation (castor::String const &name) const
 Retrieves an animation.
 
 AnimableT (Engine &owner)
 
C3D_API AnimableT (AnimableT &&rhs) noexcept=default
 
C3D_API AnimableT (AnimableT const &rhs)=delete
 
C3D_API AnimableToperator= (AnimableT &&rhs) noexcept=delete
 
C3D_API AnimableToperator= (AnimableT const &rhs)=delete
 
- Protected Member Functions inherited from castor::OwnedBy< Owner >
 OwnedBy (Owner &owner)
 Constructor.
 
- Protected Attributes inherited from castor::NamedBaseT< T >
m_name
 
- Protected Attributes inherited from castor3d::AnimableT< Engine >
AnimationsMap 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 ( )
overridenoexcept

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 ( )

Cleans the submesh.

◆ 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

◆ createDefaultSubmesh()

C3D_API SubmeshRPtr castor3d::Mesh::createDefaultSubmesh ( )

Creates a submesh with positions, normals, tangents, and texcoords0 components.

Returns
The created submesh

◆ createSubmesh()

C3D_API SubmeshRPtr castor3d::Mesh::createSubmesh ( )

Creates a submesh.

Returns
The created submesh

◆ deleteSubmesh()

C3D_API void castor3d::Mesh::deleteSubmesh ( Submesh const * 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

◆ getBoundingSphere()

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

◆ 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()

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

◆ getSubmesh()

C3D_API SubmeshRPtr 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

◆ 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 ( )

Initialises the mesh.

◆ isModified()

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

◆ isSerialisable()

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

◆ 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.

◆ record()

C3D_API crg::FramePassArray castor3d::Mesh::record ( crg::ResourcesCache & resources,
crg::FramePassGroup & graph,
crg::FramePassArray previousPasses )

Records the submeshes' dependent render passes.

◆ registerDependencies()

C3D_API void castor3d::Mesh::registerDependencies ( crg::FramePass & pass) const

Records the submeshes's dependencies.

◆ 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

◆ setSkeleton()

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

Sets the skeleton.

Parameters
[in]skeletonThe new value

◆ update()

C3D_API void castor3d::Mesh::update ( CpuUpdater & updater)

Updates the submeshes' render components.

◆ updateContainers()

C3D_API void castor3d::Mesh::updateContainers ( )

Computes the bounding box and sphere from the submeshes.

Friends And Related Symbol 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: