Castor3D 0.12.0
Multiplatform 3D engine
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
castor3d::SceneNode Class Reference

#include <SceneNode.hpp>

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

Public Types

using SceneNodeMap = std::map< castor::String, SceneNodeWPtr >
 
using MovableArray = std::list< std::reference_wrapper< MovableObject > >
 

Public Member Functions

C3D_API SceneNode (castor::String const &name, Scene &scene)
 Constructor. More...
 
C3D_API ~SceneNode () override
 Destructor. More...
 
C3D_API void update ()
 Updates the scene node matrices. More...
 
Attached objects management.
C3D_API void attachObject (MovableObject &object)
 Attaches a MovableObject to the node. More...
 
C3D_API void detachObject (MovableObject &object)
 Detaches a MovableObject from the node. More...
 
Children management.
C3D_API void attachTo (SceneNode &parent)
 Sets the parent node. More...
 
C3D_API void detach ()
 Detaches the node from it's parent. More...
 
C3D_API bool hasChild (castor::String const &name)
 
C3D_API void addChild (SceneNodeSPtr child)
 add the given node to my childs if it isn't already More...
 
C3D_API void detachChild (SceneNodeSPtr child)
 Detaches a child from my child's list, if it is one of my childs. More...
 
C3D_API void detachChild (castor::String const &childName)
 Detaches a child from my child's list, if it is one of my childs. More...
 
C3D_API void detachChildren ()
 Detaches all my childs. More...
 
Local transformations.
C3D_API void yaw (castor::Angle const &angle)
 Rotates around Y axis. More...
 
C3D_API void pitch (castor::Angle const &angle)
 Rotates around Z axis. More...
 
C3D_API void roll (castor::Angle const &angle)
 Rotates around X axis. More...
 
C3D_API void rotate (castor::Quaternion const &quat)
 Rotate the node with the given orientation. More...
 
C3D_API void translate (castor::Point3f const &t)
 Translates the node. More...
 
C3D_API void scale (castor::Point3f const &s)
 Scales the node. More...
 
C3D_API SceneNodeAnimationcreateAnimation (castor::String const &name)
 Creates an animation. More...
 
C3D_API void removeAnimation (castor::String const &name)
 Removes an animation. More...
 
Absolute value getters.
C3D_API castor::Point3f getDerivedPosition () const
 
C3D_API castor::Quaternion getDerivedOrientation () const
 
C3D_API castor::Point3f getDerivedScale () const
 
C3D_API castor::Matrix4x4f const & getTransformationMatrix () const
 
C3D_API castor::Matrix4x4f const & getDerivedTransformationMatrix () const
 
Local value getters.
castor::Point3f const & getPosition () const
 
castor::Quaternion const & getOrientation () const
 
castor::Point3f const & getScale () const
 
void getAxisAngle (castor::Point3f &axis, castor::Angle &angle) const
 
Other getters.
C3D_API bool isVisible () const
 
bool isDisplayable () const
 
SceneNodegetParent () const
 
ScenegetScene () const
 
C3D_API void setOrientation (castor::Quaternion const &orientation)
 
C3D_API void setPosition (castor::Point3f const &position)
 
C3D_API void setScale (castor::Point3f const &scale)
 
C3D_API void setVisible (bool visible)
 
C3D_API SceneNodeMap const & getChildren () const
 
C3D_API SceneNodeSPtr getChild (castor::String const &name) const
 
C3D_API MovableArray const & getObjects () const
 
bool isModified () const
 
uint64_t getId () 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
 

Public Attributes

OnSceneNodeChanged onChanged
 

Static Public Attributes

static uint64_t Count
 

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
 

Member Typedef Documentation

◆ MovableArray

using castor3d::SceneNode::MovableArray = std::list< std::reference_wrapper< MovableObject > >

◆ SceneNodeMap

using castor3d::SceneNode::SceneNodeMap = std::map< castor::String, SceneNodeWPtr >

Constructor & Destructor Documentation

◆ SceneNode()

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

Constructor.

Parameters
[in]nameThe node's name.
[in]sceneThe parent scene.

◆ ~SceneNode()

C3D_API castor3d::SceneNode::~SceneNode ( )
override

Destructor.

Member Function Documentation

◆ addChild()

C3D_API void castor3d::SceneNode::addChild ( SceneNodeSPtr  child)

add the given node to my childs if it isn't already

Parameters
[in]childThe node to add

◆ attachObject()

C3D_API void castor3d::SceneNode::attachObject ( MovableObject object)

Attaches a MovableObject to the node.

Parameters
[in]objectThe object to attach

Referenced by castor3d::MovableAttacherT< CacheT >::operator()().

Here is the caller graph for this function:

◆ attachTo()

C3D_API void castor3d::SceneNode::attachTo ( SceneNode parent)

Sets the parent node.

Parameters
[in]parentThe new parent

◆ createAnimation()

C3D_API SceneNodeAnimation & castor3d::SceneNode::createAnimation ( castor::String const &  name)

Creates an animation.

Parameters
[in]nameThe animation name
Returns
The animation

◆ detach()

C3D_API void castor3d::SceneNode::detach ( )

Detaches the node from it's parent.

◆ detachChild() [1/2]

C3D_API void castor3d::SceneNode::detachChild ( castor::String const &  childName)

Detaches a child from my child's list, if it is one of my childs.

Parameters
[in]childNameThe name of the child to detach

◆ detachChild() [2/2]

C3D_API void castor3d::SceneNode::detachChild ( SceneNodeSPtr  child)

Detaches a child from my child's list, if it is one of my childs.

Parameters
[in]childThe child to detach

◆ detachChildren()

C3D_API void castor3d::SceneNode::detachChildren ( )

Detaches all my childs.

◆ detachObject()

C3D_API void castor3d::SceneNode::detachObject ( MovableObject object)

Detaches a MovableObject from the node.

Parameters
[in]objectThe object to detach

◆ getAxisAngle()

void castor3d::SceneNode::getAxisAngle ( castor::Point3f &  axis,
castor::Angle &  angle 
) const
inline

◆ getChild()

C3D_API SceneNodeSPtr castor3d::SceneNode::getChild ( castor::String const &  name) const

◆ getChildren()

C3D_API SceneNodeMap const & castor3d::SceneNode::getChildren ( ) const

◆ getDerivedOrientation()

C3D_API castor::Quaternion castor3d::SceneNode::getDerivedOrientation ( ) const

◆ getDerivedPosition()

C3D_API castor::Point3f castor3d::SceneNode::getDerivedPosition ( ) const

◆ getDerivedScale()

C3D_API castor::Point3f castor3d::SceneNode::getDerivedScale ( ) const

◆ getDerivedTransformationMatrix()

C3D_API castor::Matrix4x4f const & castor3d::SceneNode::getDerivedTransformationMatrix ( ) const

◆ getId()

uint64_t castor3d::SceneNode::getId ( ) const
inline

◆ getObjects()

C3D_API MovableArray const & castor3d::SceneNode::getObjects ( ) const

◆ getOrientation()

castor::Quaternion const & castor3d::SceneNode::getOrientation ( ) const
inline

◆ getParent()

SceneNode * castor3d::SceneNode::getParent ( ) const
inline

◆ getPosition()

castor::Point3f const & castor3d::SceneNode::getPosition ( ) const
inline

◆ getScale()

castor::Point3f const & castor3d::SceneNode::getScale ( ) const
inline

◆ getScene()

Scene * castor3d::SceneNode::getScene ( ) const
inline

◆ getTransformationMatrix()

C3D_API castor::Matrix4x4f const & castor3d::SceneNode::getTransformationMatrix ( ) const

◆ hasChild()

C3D_API bool castor3d::SceneNode::hasChild ( castor::String const &  name)
Parameters
[in]nameThe name of the node
Returns
true if one of my child has the given name

◆ isDisplayable()

bool castor3d::SceneNode::isDisplayable ( ) const
inline

◆ isModified()

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

◆ isVisible()

C3D_API bool castor3d::SceneNode::isVisible ( ) const

◆ pitch()

C3D_API void castor3d::SceneNode::pitch ( castor::Angle const &  angle)

Rotates around Z axis.

Parameters
[in]angleThe rotation angle

◆ removeAnimation()

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

Removes an animation.

Parameters
[in]nameThe animation name

◆ roll()

C3D_API void castor3d::SceneNode::roll ( castor::Angle const &  angle)

Rotates around X axis.

Parameters
[in]angleThe rotation angle

◆ rotate()

C3D_API void castor3d::SceneNode::rotate ( castor::Quaternion const &  quat)

Rotate the node with the given orientation.

Parameters
[in]quatThe orientation to add to current one

◆ scale()

C3D_API void castor3d::SceneNode::scale ( castor::Point3f const &  s)

Scales the node.

Parameters
[in]sThe scale value

◆ setOrientation()

C3D_API void castor3d::SceneNode::setOrientation ( castor::Quaternion const &  orientation)

◆ setPosition()

C3D_API void castor3d::SceneNode::setPosition ( castor::Point3f const &  position)

◆ setScale()

C3D_API void castor3d::SceneNode::setScale ( castor::Point3f const &  scale)

◆ setVisible()

C3D_API void castor3d::SceneNode::setVisible ( bool  visible)

◆ translate()

C3D_API void castor3d::SceneNode::translate ( castor::Point3f const &  t)

Translates the node.

Parameters
[in]tThe translation value

◆ update()

C3D_API void castor3d::SceneNode::update ( )

Updates the scene node matrices.

◆ yaw()

C3D_API void castor3d::SceneNode::yaw ( castor::Angle const &  angle)

Rotates around Y axis.

Parameters
[in]angleThe rotation angle

Member Data Documentation

◆ Count

uint64_t castor3d::SceneNode::Count
static

The total number of scene nodes.

◆ onChanged

OnSceneNodeChanged castor3d::SceneNode::onChanged

Signal used to notify that the node has changed.


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