![]() |
Castor3D 0.17.0
Multiplatform 3D engine
|
#include <SceneNode.hpp>
Public Types | |
using | SceneNodeMap = castor::StringMap< SceneNodeRPtr > |
using | MovableArray = castor::List< castor::ReferenceWrapper< MovableObject > > |
Public Member Functions | |
C3D_API | SceneNode (castor::String const &name, SceneNodeCreateInfo const &createInfo) |
Constructor. | |
C3D_API | SceneNode (castor::String const &name, Scene &scene, SceneNode *parent, castor::Point3f position, castor::Quaternion orientation, castor::Point3f scale, bool isStatic=true) |
Constructor. | |
C3D_API | SceneNode (castor::String const &name, Scene &scene) |
Constructor. | |
C3D_API | ~SceneNode () override |
Destructor. | |
C3D_API void | update () |
Updates the scene node matrices. | |
C3D_API void | cloneInto (SceneNode &output) const |
Clones this object into the given one. | |
Children management. | |
C3D_API void | attachTo (SceneNode &parent) |
Sets the parent node. | |
C3D_API void | detach (bool cleanup) noexcept |
Detaches the node from it's parent. | |
C3D_API bool | hasChild (castor::String const &name) const |
C3D_API void | addChild (SceneNode &child) |
add the given node to my childs if it isn't already | |
C3D_API void | detachChild (SceneNode const &child) noexcept |
Detaches a child from my child's list, if it is one of my childs. | |
C3D_API void | detachChild (castor::String const &childName) noexcept |
Detaches a child from my child's list, if it is one of my childs. | |
C3D_API void | detachChildren (bool cleanup) noexcept |
Detaches all my childs. | |
C3D_API void | markDirty () |
Marks this scene node as dirty. | |
Local transformations. | |
C3D_API void | yaw (castor::Angle const &angle) |
Rotates around Y axis. | |
C3D_API void | pitch (castor::Angle const &angle) |
Rotates around Z axis. | |
C3D_API void | roll (castor::Angle const &angle) |
Rotates around X axis. | |
C3D_API void | rotate (castor::Quaternion const &quat) |
Rotate the node with the given orientation. | |
C3D_API void | translate (castor::Point3f const &t) |
Translates the node. | |
C3D_API void | scale (castor::Point3f const &s) |
Scales the node. | |
C3D_API SceneNodeAnimation & | createAnimation (castor::String const &name) |
Creates an animation. | |
C3D_API void | removeAnimation (castor::String const &name) |
Removes an animation. | |
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 SceneNodeMap const & | getChildren () const |
C3D_API SceneNodeRPtr | getChild (castor::String const &name) const |
C3D_API MovableArray const & | getObjects () const |
C3D_API bool | isVisible () const noexcept |
bool | isDisplayable () const noexcept |
SceneNode * | getParent () const noexcept |
Scene * | getScene () const noexcept |
bool | isSerialisable () const noexcept |
bool | isStatic () const noexcept |
bool | isModified () const noexcept |
uint64_t | getId () const noexcept |
Setters. | |
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 | setTransformationMatrix (castor::Matrix4x4f const &transform) |
C3D_API void | setVisible (bool visible) |
void | setScene (Scene &scene) noexcept |
void | setSerialisable (bool value) noexcept |
![]() | |
virtual C3D_API | ~Animable () noexcept=default |
C3D_API void | cleanupAnimations () |
Empties the animations map. | |
virtual C3D_API bool | hasAnimation () const noexcept |
C3D_API bool | hasAnimation (castor::String const &name) const |
C3D_API Animation const & | getAnimation (castor::String const &name) const |
Retrieves an animation. | |
C3D_API Animation & | getAnimation (castor::String const &name) |
Retrieves an animation. | |
C3D_API void | addAnimation (AnimationPtr animation) |
Adds an animation. | |
AnimationsMap const & | getAnimations () const |
![]() | |
Engine * | getOwner () const noexcept |
void | setOwner (Engine &owner) noexcept |
![]() | |
NamedBaseT (T name) noexcept | |
Constructor. | |
T const & | getName () const noexcept |
Retrieves the name. | |
void | rename (T name) noexcept |
Public Attributes | |
OnSceneNodeReparent | onParentChanged |
Static Public Attributes | |
static uint64_t | Count |
Attached objects management. | |
C3D_API void | attachObject (MovableObject &object) |
Attaches a MovableObject to the node. | |
C3D_API void | detachObject (MovableObject const &object) |
Detaches a MovableObject from the node. | |
static C3D_API void | addParsers (castor::AttributeParsers &result) |
Additional Inherited Members | |
![]() | |
using | AnimationPtr = castor::UniquePtr< Animation > |
using | AnimationsMap = castor::StringMap< AnimationPtr > |
![]() | |
C3D_API void | doRemoveAnimation (castor::String const &name) |
Removes an animation. | |
template<typename AnimationType > | |
AnimationType & | doGetAnimation (castor::String const &name) |
Retrieves an animation. | |
template<typename AnimationType > | |
AnimationType const & | doGetAnimation (castor::String const &name) const |
Retrieves an animation. | |
C3D_API | Animable (Engine &owner) |
C3D_API | Animable (Animable &&rhs) noexcept=default |
C3D_API Animable & | operator= (Animable &&rhs) noexcept=delete |
C3D_API | Animable (Animable const &rhs)=delete |
C3D_API Animable & | operator= (Animable const &rhs)=delete |
![]() | |
OwnedBy (Engine &owner) noexcept | |
Constructor. | |
![]() | |
AnimationsMap | m_animations |
![]() | |
T | m_name |
using castor3d::SceneNode::SceneNodeMap = castor::StringMap< SceneNodeRPtr > |
C3D_API castor3d::SceneNode::SceneNode | ( | castor::String const & | name, |
SceneNodeCreateInfo const & | createInfo ) |
Constructor.
[in] | name | The node's name. |
[in] | createInfo | The creation data. |
C3D_API castor3d::SceneNode::SceneNode | ( | castor::String const & | name, |
Scene & | scene, | ||
SceneNode * | parent, | ||
castor::Point3f | position, | ||
castor::Quaternion | orientation, | ||
castor::Point3f | scale, | ||
bool | isStatic = true ) |
Constructor.
[in] | name | The node's name. |
[in] | scene | The parent scene. |
[in] | parent | The parent node. |
[in] | position | The initial position. |
[in] | orientation | The initial orientation. |
[in] | scale | The initial scale. |
[in] | isStatic | true for a static node. |
C3D_API castor3d::SceneNode::SceneNode | ( | castor::String const & | name, |
Scene & | scene ) |
Constructor.
[in] | name | The node's name. |
[in] | scene | The parent scene. |
|
override |
Destructor.
add the given node to my childs if it isn't already
[in] | child | The node to add |
|
static |
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 |
Clones this object into the given one.
[in,out] | output | Receives this object's data. |
C3D_API SceneNodeAnimation & castor3d::SceneNode::createAnimation | ( | castor::String const & | name | ) |
Creates an animation.
[in] | name | The animation name |
|
noexcept |
Detaches the node from it's parent.
|
noexcept |
Detaches a child from my child's list, if it is one of my childs.
[in] | childName | The name of the child to detach |
Detaches a child from my child's list, if it is one of my childs.
[in] | child | The child to detach |
|
noexcept |
Detaches all my childs.
C3D_API void castor3d::SceneNode::detachObject | ( | MovableObject const & | object | ) |
Detaches a MovableObject from the node.
[in] | object | The object to detach |
|
inline |
C3D_API SceneNodeRPtr 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 |
|
inlinenoexcept |
C3D_API MovableArray const & castor3d::SceneNode::getObjects | ( | ) | const |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
C3D_API castor::Matrix4x4f const & castor3d::SceneNode::getTransformationMatrix | ( | ) | const |
C3D_API bool castor3d::SceneNode::hasChild | ( | castor::String const & | name | ) | const |
[in] | name | The name of the node |
true
if one of my child has the given name
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
C3D_API void castor3d::SceneNode::markDirty | ( | ) |
Marks this scene node as dirty.
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 | ) |
|
inlinenoexcept |
|
inlinenoexcept |
C3D_API void castor3d::SceneNode::setTransformationMatrix | ( | castor::Matrix4x4f const & | transform | ) |
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.
OnSceneNodeReparent castor3d::SceneNode::onParentChanged |
Signal used to notify that the node has been attached to another one.