Castor3D 0.16.0
Multiplatform 3D engine
|
#include <Geometry.hpp>
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 SubmeshRenderNode * | getRenderNode (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 |
SceneNode * | getParent () 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 |
SceneNode * | m_sceneNode {} |
OnSceneNodeChangedConnection | m_notifyIndex |
Protected Attributes inherited from castor::NamedBaseT< T > | |
T | m_name |
using castor3d::Geometry::IdRenderNode = castor::Pair< uint32_t, SubmeshRenderNode * > |
using castor3d::Geometry::SubmeshIdRenderNodeMap = castor::UnorderedMap< uint32_t, IdRenderNode > |
C3D_API castor3d::Geometry::Geometry | ( | castor::String const & | name, |
Scene & | scene, | ||
SceneNode & | node, | ||
MeshResPtr | mesh = {} ) |
Constructor.
[in] | name | The geometry name. |
[in] | scene | The parent scene. |
[in] | node | The scene node to which the geometry is attached. |
[in] | mesh | The mesh. |
C3D_API castor3d::Geometry::Geometry | ( | castor::String const & | name, |
Scene & | scene, | ||
MeshResPtr | mesh = {} ) |
Constructor.
[in] | name | The geometry name. |
[in] | scene | The parent scene. |
[in] | mesh | The mesh. |
|
inline |
C3D_API castor::BoundingBox const & castor3d::Geometry::getBoundingBox | ( | Submesh const & | submesh | ) | const |
[in] | submesh | The submesh. |
|
inline |
C3D_API castor::BoundingSphere const & castor3d::Geometry::getBoundingSphere | ( | Submesh const & | submesh | ) | const |
[in] | submesh | The submesh. |
C3D_API castor::Matrix4x4f castor3d::Geometry::getGlobalTransform | ( | ) | const |
|
noexcept |
[in] | pass | The material pass. |
[in] | submesh | The submesh. |
Retrieves the object ID in models buffer.
[in] | pass | The material pass. |
[in] | submesh | The submesh. |
|
inline |
name Getters.
C3D_API MaterialObs castor3d::Geometry::getMaterial | ( | Submesh const & | submesh | ) | const |
Retrieves the submesh material.
[in] | submesh | The submesh. |
|
inline |
C3D_API SubmeshRenderNode * castor3d::Geometry::getRenderNode | ( | Pass const & | pass, |
Submesh const & | submesh ) const |
Retrieves the object render node.
[in] | pass | The material pass. |
[in] | submesh | The submesh. |
C3D_API void castor3d::Geometry::initContainers | ( | ) |
Initialises the bounding box from the base submeshes boxes.
C3D_API void castor3d::Geometry::prepare | ( | uint32_t & | nbFaces, |
uint32_t & | nbVertex ) |
brief Creates the mesh buffers
[out] | nbFaces | Used to retrieve the faces number |
[out] | nbVertex | Used to retrieve the vertexes number |
C3D_API void castor3d::Geometry::setBoundingBox | ( | Submesh const & | submesh, |
castor::BoundingBox const & | box ) |
Sets the bounding box for given submesh.
[in] | submesh | The submesh. |
[in] | box | The bounding box. |
|
noexcept |
Sets the object render node and ID in models buffer.
[in] | pass | The material pass. |
[in] | submesh | The submesh. |
[in] | renderNode | The render node. |
[in] | id | The ID. |
C3D_API void castor3d::Geometry::setMaterial | ( | Submesh & | submesh, |
MaterialObs | material ) |
Defines a submesh material.
[in] | submesh | The submesh. |
[in] | material | The material. |
C3D_API void castor3d::Geometry::setMesh | ( | MeshResPtr | mesh | ) |
Defines this geometry's mesh.
[in] | mesh | The mesh. |
C3D_API void castor3d::Geometry::updateContainers | ( | SubmeshBoundingBoxList const & | boxes | ) |
Computes the bounding box from the given submeshes boxes.