![]() |
Castor3D 0.12.0
Multiplatform 3D engine
|
#include <SceneNode.hpp>


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 SceneNodeAnimation & | createAnimation (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 |
| SceneNode * | getParent () const |
| Scene * | getScene () 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... | |
| Animation & | getAnimation (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... | |
| AnimationType & | doGetAnimation (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 AnimableT & | operator= (AnimableT &&rhs)=delete |
| C3D_API AnimableT & | operator= (AnimableT const &rhs)=delete |
Protected Attributes inherited from castor3d::AnimableT< Engine > | |
| AnimationPtrStrMap | m_animations |
| using castor3d::SceneNode::MovableArray = std::list< std::reference_wrapper< MovableObject > > |
| using castor3d::SceneNode::SceneNodeMap = std::map< castor::String, SceneNodeWPtr > |
Constructor.
| [in] | name | The node's name. |
| [in] | scene | The parent scene. |
|
override |
Destructor.
| C3D_API void castor3d::SceneNode::addChild | ( | SceneNodeSPtr | child | ) |
add the given node to my childs if it isn't already
| [in] | child | The node to add |
| C3D_API void castor3d::SceneNode::attachObject | ( | MovableObject & | object | ) |
Attaches a MovableObject to the node.
| [in] | object | The object to attach |
Referenced by castor3d::MovableAttacherT< CacheT >::operator()().

Sets the parent node.
| [in] | parent | The new parent |
| C3D_API SceneNodeAnimation & castor3d::SceneNode::createAnimation | ( | castor::String const & | name | ) |
Creates an animation.
| [in] | name | The animation name |
| C3D_API void castor3d::SceneNode::detach | ( | ) |
Detaches the node from it's parent.
| 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.
| [in] | childName | The name of the child to detach |
| C3D_API void castor3d::SceneNode::detachChild | ( | SceneNodeSPtr | child | ) |
Detaches a child from my child's list, if it is one of my childs.
| [in] | child | The child to detach |
| C3D_API void castor3d::SceneNode::detachChildren | ( | ) |
Detaches all my childs.
| C3D_API void castor3d::SceneNode::detachObject | ( | MovableObject & | object | ) |
Detaches a MovableObject from the node.
| [in] | object | The object to detach |
|
inline |
| C3D_API SceneNodeSPtr castor3d::SceneNode::getChild | ( | castor::String const & | name | ) | const |
| C3D_API SceneNodeMap const & castor3d::SceneNode::getChildren | ( | ) | const |
| C3D_API castor::Quaternion castor3d::SceneNode::getDerivedOrientation | ( | ) | const |
| C3D_API castor::Point3f castor3d::SceneNode::getDerivedPosition | ( | ) | const |
| C3D_API castor::Point3f castor3d::SceneNode::getDerivedScale | ( | ) | const |
| C3D_API castor::Matrix4x4f const & castor3d::SceneNode::getDerivedTransformationMatrix | ( | ) | const |
|
inline |
| C3D_API MovableArray const & castor3d::SceneNode::getObjects | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| C3D_API castor::Matrix4x4f const & castor3d::SceneNode::getTransformationMatrix | ( | ) | const |
| C3D_API bool castor3d::SceneNode::hasChild | ( | castor::String const & | name | ) |
| [in] | name | The name of the node |
true if one of my child has the given name
|
inline |
|
inline |
| C3D_API bool castor3d::SceneNode::isVisible | ( | ) | const |
| C3D_API void castor3d::SceneNode::pitch | ( | castor::Angle const & | angle | ) |
Rotates around Z axis.
| [in] | angle | The rotation angle |
| C3D_API void castor3d::SceneNode::removeAnimation | ( | castor::String const & | name | ) |
Removes an animation.
| [in] | name | The animation name |
| C3D_API void castor3d::SceneNode::roll | ( | castor::Angle const & | angle | ) |
Rotates around X axis.
| [in] | angle | The rotation angle |
| C3D_API void castor3d::SceneNode::rotate | ( | castor::Quaternion const & | quat | ) |
Rotate the node with the given orientation.
| [in] | quat | The orientation to add to current one |
| C3D_API void castor3d::SceneNode::scale | ( | castor::Point3f const & | s | ) |
Scales the node.
| [in] | s | The scale value |
| C3D_API void castor3d::SceneNode::setOrientation | ( | castor::Quaternion const & | orientation | ) |
| C3D_API void castor3d::SceneNode::setPosition | ( | castor::Point3f const & | position | ) |
| C3D_API void castor3d::SceneNode::setScale | ( | castor::Point3f const & | scale | ) |
| C3D_API void castor3d::SceneNode::setVisible | ( | bool | visible | ) |
| C3D_API void castor3d::SceneNode::translate | ( | castor::Point3f const & | t | ) |
Translates the node.
| [in] | t | The translation value |
| C3D_API void castor3d::SceneNode::update | ( | ) |
Updates the scene node matrices.
| C3D_API void castor3d::SceneNode::yaw | ( | castor::Angle const & | angle | ) |
Rotates around Y axis.
| [in] | angle | The rotation angle |
|
static |
The total number of scene nodes.
| OnSceneNodeChanged castor3d::SceneNode::onChanged |
Signal used to notify that the node has changed.