Castor3D 0.16.0
Multiplatform 3D engine
Public Types | Public Member Functions | List of all members
castor3d::Geometry Class Reference

#include <Geometry.hpp>

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

Public Types

using IdRenderNode = castor::Pair< uint32_t, SubmeshRenderNode * >
 
using SubmeshIdRenderNodeMap = castor::UnorderedMap< uint32_t, IdRenderNode >
 

Public Member Functions

C3D_API Geometry (castor::String const &name, Scene &scene, SceneNode &node, MeshResPtr mesh={})
 Constructor.
 
C3D_API Geometry (castor::String const &name, Scene &scene, MeshResPtr mesh={})
 Constructor.
 
C3D_API void prepare (uint32_t &nbFaces, uint32_t &nbVertex)
 
C3D_API void setMesh (MeshResPtr mesh)
 Defines this geometry's mesh.
 
C3D_API MaterialObs getMaterial (Submesh const &submesh) const
 Retrieves the submesh material.
 
C3D_API void setMaterial (Submesh &submesh, MaterialObs material)
 Defines a submesh material.
 
C3D_API void initContainers ()
 Initialises the bounding box from the base submeshes boxes.
 
C3D_API void updateContainers (SubmeshBoundingBoxList const &boxes)
 Computes the bounding box from the given submeshes boxes.
 
C3D_API castor::BoundingBox const & getBoundingBox (Submesh const &submesh) const
 
C3D_API castor::BoundingSphere const & getBoundingSphere (Submesh const &submesh) const
 
C3D_API void setBoundingBox (Submesh const &submesh, castor::BoundingBox const &box)
 Sets the bounding box for given submesh.
 
C3D_API uint32_t getId (Pass const &pass, Submesh const &submesh) const
 Retrieves the object ID in models buffer.
 
C3D_API SubmeshRenderNodegetRenderNode (Pass const &pass, Submesh const &submesh) const
 Retrieves the object render node.
 
C3D_API void setId (Pass const &pass, Submesh const &submesh, SubmeshRenderNode *renderNode, uint32_t id) noexcept
 Sets the object render node and ID in models buffer.
 
C3D_API size_t getHash (Pass const &pass, Submesh const &submesh) const noexcept
 
C3D_API castor::Matrix4x4f getGlobalTransform () const
 
castor::UnorderedMap< Pass const *, SubmeshIdRenderNodeMap > const & getIds () const
 
MeshResPtr getMesh () const
 
castor::BoundingBox const & getBoundingBox () const
 
castor::BoundingSphere const & getBoundingSphere () const
 
- Public Member Functions inherited from castor3d::MovableObject
C3D_API MovableObject (castor::String const &name, Scene &scene, MovableType type, SceneNode &node)
 Constructor.
 
C3D_API MovableObject (castor::String const &name, Scene &scene, MovableType type)
 Constructor.
 
virtual C3D_API ~MovableObject () noexcept
 Destructor.
 
C3D_API void detach ()
 Detaches the movable object from it's parent.
 
virtual C3D_API void attachTo (SceneNode &node)
 Attaches the movable object to a node.
 
C3D_API void markDirty ()
 Adds the object to dirty object list in the scene.
 
C3D_API EngineRPtr getEngine () const noexcept
 
SceneNodegetParent () const noexcept
 
MovableType getMovableType () const noexcept
 
- Public Member Functions inherited from castor::OwnedBy< Scene >
Scene * getOwner () const
 
- 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::RenderedObject
C3D_API void fillEntry (uint32_t nodeId, Pass const &pass, SceneNode const &sceneNode, uint32_t meshletCount, ModelBufferConfiguration &modelData)
 
C3D_API void fillEntryOffsets (uint32_t nodeId, VkDeviceSize vertexOffset, VkDeviceSize indexOffset, VkDeviceSize meshletOffset)
 
void setVisible (bool value) noexcept
 
void setShadowCaster (bool value) noexcept
 
void setShadowReceiver (bool value) noexcept
 
void setCullable (bool value) noexcept
 
bool isVisible () const noexcept
 
bool isShadowCaster () const noexcept
 
bool isShadowReceiver () const noexcept
 
bool isCullable () const noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from castor::OwnedBy< Scene >
 OwnedBy (Scene &owner)
 Constructor.
 
- Protected Attributes inherited from castor3d::MovableObject
MovableType m_type
 
SceneNodem_sceneNode {}
 
OnSceneNodeChangedConnection m_notifyIndex
 
- Protected Attributes inherited from castor::NamedBaseT< T >
m_name
 

Member Typedef Documentation

◆ IdRenderNode

◆ SubmeshIdRenderNodeMap

Constructor & Destructor Documentation

◆ Geometry() [1/2]

C3D_API castor3d::Geometry::Geometry ( castor::String const & name,
Scene & scene,
SceneNode & node,
MeshResPtr mesh = {} )

Constructor.

Parameters
[in]nameThe geometry name.
[in]sceneThe parent scene.
[in]nodeThe scene node to which the geometry is attached.
[in]meshThe mesh.

◆ Geometry() [2/2]

C3D_API castor3d::Geometry::Geometry ( castor::String const & name,
Scene & scene,
MeshResPtr mesh = {} )

Constructor.

Parameters
[in]nameThe geometry name.
[in]sceneThe parent scene.
[in]meshThe mesh.

Member Function Documentation

◆ getBoundingBox() [1/2]

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

◆ getBoundingBox() [2/2]

C3D_API castor::BoundingBox const & castor3d::Geometry::getBoundingBox ( Submesh const & submesh) const
Parameters
[in]submeshThe submesh.
Returns
The collision box for given submesh.

◆ getBoundingSphere() [1/2]

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

◆ getBoundingSphere() [2/2]

C3D_API castor::BoundingSphere const & castor3d::Geometry::getBoundingSphere ( Submesh const & submesh) const
Parameters
[in]submeshThe submesh.
Returns
The collision sphere for given submesh.

◆ getGlobalTransform()

C3D_API castor::Matrix4x4f castor3d::Geometry::getGlobalTransform ( ) const
Returns
The global object transformation, from scene node and skeleton.

◆ getHash()

C3D_API size_t castor3d::Geometry::getHash ( Pass const & pass,
Submesh const & submesh ) const
noexcept
Parameters
[in]passThe material pass.
[in]submeshThe submesh.
Returns
The object hash.

◆ getId()

C3D_API uint32_t castor3d::Geometry::getId ( Pass const & pass,
Submesh const & submesh ) const

Retrieves the object ID in models buffer.

Parameters
[in]passThe material pass.
[in]submeshThe submesh.

◆ getIds()

castor::UnorderedMap< Pass const *, SubmeshIdRenderNodeMap > const & castor3d::Geometry::getIds ( ) const
inline

name Getters.

◆ getMaterial()

C3D_API MaterialObs castor3d::Geometry::getMaterial ( Submesh const & submesh) const

Retrieves the submesh material.

Parameters
[in]submeshThe submesh.
Returns
The material.

◆ getMesh()

MeshResPtr castor3d::Geometry::getMesh ( ) const
inline

◆ getRenderNode()

C3D_API SubmeshRenderNode * castor3d::Geometry::getRenderNode ( Pass const & pass,
Submesh const & submesh ) const

Retrieves the object render node.

Parameters
[in]passThe material pass.
[in]submeshThe submesh.

◆ initContainers()

C3D_API void castor3d::Geometry::initContainers ( )

Initialises the bounding box from the base submeshes boxes.

◆ prepare()

C3D_API void castor3d::Geometry::prepare ( uint32_t & nbFaces,
uint32_t & nbVertex )

brief Creates the mesh buffers

Parameters
[out]nbFacesUsed to retrieve the faces number
[out]nbVertexUsed to retrieve the vertexes number

◆ setBoundingBox()

C3D_API void castor3d::Geometry::setBoundingBox ( Submesh const & submesh,
castor::BoundingBox const & box )

Sets the bounding box for given submesh.

Parameters
[in]submeshThe submesh.
[in]boxThe bounding box.

◆ setId()

C3D_API void castor3d::Geometry::setId ( Pass const & pass,
Submesh const & submesh,
SubmeshRenderNode * renderNode,
uint32_t id )
noexcept

Sets the object render node and ID in models buffer.

Parameters
[in]passThe material pass.
[in]submeshThe submesh.
[in]renderNodeThe render node.
[in]idThe ID.

◆ setMaterial()

C3D_API void castor3d::Geometry::setMaterial ( Submesh & submesh,
MaterialObs material )

Defines a submesh material.

Parameters
[in]submeshThe submesh.
[in]materialThe material.

◆ setMesh()

C3D_API void castor3d::Geometry::setMesh ( MeshResPtr mesh)

Defines this geometry's mesh.

Parameters
[in]meshThe mesh.

◆ updateContainers()

C3D_API void castor3d::Geometry::updateContainers ( SubmeshBoundingBoxList const & boxes)

Computes the bounding box from the given submeshes boxes.


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