Castor3D 0.12.0
Multiplatform 3D engine
Public Member Functions | Public Attributes | 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 Member Functions

C3D_API Geometry (castor::String const &name, Scene &scene, SceneNode &node, MeshResPtr mesh={})
 Constructor. More...
 
C3D_API Geometry (castor::String const &name, Scene &scene, MeshResPtr mesh={})
 Constructor. More...
 
C3D_API void prepare (uint32_t &nbFaces, uint32_t &nbVertex)
 
C3D_API void setMesh (MeshResPtr mesh)
 Defines this geometry's mesh. More...
 
C3D_API MaterialRPtr getMaterial (Submesh const &submesh) const
 Retrieves the submesh material. More...
 
C3D_API void setMaterial (Submesh &submesh, MaterialRPtr material, bool updateSubmesh=true)
 Defines a submesh material. More...
 
C3D_API void updateContainers (SubmeshBoundingBoxList const &boxes)
 Computes the bounding box from the given submeshes boxes. More...
 
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. More...
 
C3D_API uint32_t getId (Pass const &pass, Submesh const &submesh) const
 
C3D_API void setId (Pass const &pass, Submesh const &submesh, uint32_t id)
 
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. More...
 
C3D_API MovableObject (castor::String const &name, Scene &scene, MovableType type)
 Constructor. More...
 
virtual C3D_API ~MovableObject ()
 Destructor. More...
 
C3D_API void detach ()
 Detaches the movable object from it's parent. More...
 
virtual C3D_API void attachTo (SceneNode &node)
 Attaches the movable object to a node. More...
 
C3D_API EngineRPtr getEngine () const
 
SceneNodegetParent () const
 
MovableType getType () const
 
- Public Member Functions inherited from castor3d::RenderedObject
void setVisible (bool value)
 
void setShadowCaster (bool value)
 
void setShadowReceiver (bool value)
 
void setCulled (bool value)
 
bool isVisible () const
 
bool isShadowCaster () const
 
bool isShadowReceiver () const
 
bool isCulled () const
 

Public Attributes

OnSubmeshMaterialChanged onMaterialChanged
 

Additional Inherited Members

- Protected Attributes inherited from castor3d::MovableObject
MovableType m_type
 
castor::String m_strNodeName
 
SceneNodem_sceneNode
 
OnSceneNodeChangedConnection m_notifyIndex
 

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.

◆ getId()

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

◆ getMaterial()

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

◆ 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,
uint32_t  id 
)

◆ setMaterial()

C3D_API void castor3d::Geometry::setMaterial ( Submesh submesh,
MaterialRPtr  material,
bool  updateSubmesh = true 
)

Defines a submesh material.

Parameters
[in]submeshThe submesh.
[in]materialThe material.
[in]updateSubmeshTells if the submesh's buffers need to be updated.

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

Member Data Documentation

◆ onMaterialChanged

OnSubmeshMaterialChanged castor3d::Geometry::onMaterialChanged

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