Castor3D
..
|
The scene node handler class. More...
Classes | |
class | BinaryParser |
Sampler loader. More... | |
class | TextLoader |
SceneNode loader. More... | |
Public Types | |
typedef SceneNodePtrStrMap::iterator | node_iterator |
typedef SceneNodePtrStrMap::const_iterator | node_const_iterator |
typedef MovableObjectPtrArray::iterator | object_iterator |
typedef MovableObjectPtrArray::const_iterator | object_const_iterator |
Public Member Functions | |
C3D_API | SceneNode (Castor::String const &p_name, Scene &p_scene) |
Constructor. More... | |
virtual C3D_API | ~SceneNode () |
Destructor. More... | |
C3D_API void | AttachObject (MovableObjectSPtr p_object) |
Attaches a MovableObject to the node. More... | |
C3D_API void | DetachObject (MovableObjectSPtr p_object) |
Detaches a MovableObject from the node. More... | |
C3D_API void | AttachTo (SceneNodeSPtr p_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 &p_name) |
C3D_API void | AddChild (SceneNodeSPtr p_child) |
Add the given node to my childs if it isn't already. More... | |
C3D_API void | DetachChild (SceneNodeSPtr p_child) |
Detaches a child from my child's list, if it is one of my childs. More... | |
C3D_API void | DetachChild (Castor::String const &p_childName) |
Detaches a child from my child's list, if it is one of my childs. More... | |
C3D_API void | DetachAllChilds () |
Detaches all my childs. More... | |
C3D_API void | Yaw (Castor::Angle const &p_angle) |
Rotates around Y axis. More... | |
C3D_API void | Pitch (Castor::Angle const &p_angle) |
Rotates around Z axis. More... | |
C3D_API void | Roll (Castor::Angle const &p_angle) |
Rotates around X axis. More... | |
C3D_API void | Rotate (Castor::Quaternion const &p_quat) |
Rotate the node with the given orientation. More... | |
C3D_API void | Translate (Castor::Point3r const &p_t) |
Translates the node. More... | |
C3D_API void | Scale (Castor::Point3r const &p_s) |
Scales the node. More... | |
C3D_API void | SetOrientation (Castor::Quaternion const &p_orientation) |
Sets the orientation. More... | |
C3D_API void | SetPosition (Castor::Point3r const &p_position) |
Sets the relative position from a Point3r. More... | |
C3D_API void | SetScale (Castor::Point3r const &p_scale) |
Sets the relative scale from a Point3r. More... | |
C3D_API GeometrySPtr | GetNearestGeometry (Ray *p_ray, real &p_distance, FaceSPtr *p_nearestFace, SubmeshSPtr *p_nearestSubmesh) |
Gets the nearest geometry held by this node or it's children nodes, which is hit by the ray. More... | |
C3D_API Castor::Point3r | GetDerivedPosition () |
Retrieves the absolute position. More... | |
C3D_API Castor::Quaternion | GetDerivedOrientation () |
Retrieves the absolute orientation. More... | |
C3D_API Castor::Point3r | GetDerivedScale () |
Retrieves the absolute scale. More... | |
C3D_API Castor::Matrix4x4r const & | GetTransformationMatrix () |
Retrieves the relative transformation matrix. More... | |
C3D_API Castor::Matrix4x4r const & | GetDerivedTransformationMatrix () |
Retrieves the absolute transformation matrix. More... | |
Castor::Point3r const & | GetPosition () const |
Retrieves the relative position. More... | |
Castor::Quaternion const & | GetOrientation () const |
Retrieves the relative orientation. More... | |
Castor::Point3r const & | GetScale () const |
Retrieves the relative scale. More... | |
void | GetAxisAngle (Castor::Point3r &p_axis, Castor::Angle &p_angle) |
Retrieves the orientation in axis and angle terms. More... | |
bool | IsVisible () const |
Retrieves the visibility status. More... | |
bool | IsDisplayable () const |
Retrieves the displayable status. More... | |
SceneNodeSPtr | GetParent () const |
Retrieves the parent node. More... | |
SceneNodePtrStrMap const & | GetChilds () const |
Retrieves the childs map. More... | |
node_iterator | ChildsBegin () |
Retrieves an iterator to the first child. More... | |
node_const_iterator | ChildsBegin () const |
Retrieves an iterator to the first child. More... | |
node_iterator | ChildsEnd () |
Retrieves an iterator to after the last child. More... | |
node_const_iterator | ChildsEnd () const |
Retrieves an iterator to after the last child. More... | |
MovableObjectPtrArray const & | GetObjects () const |
Retrieves the objects map. More... | |
object_iterator | ObjectsBegin () |
Retrieves an iterator to the first attached object. More... | |
object_const_iterator | ObjectsBegin () const |
Retrieves an iterator to the first attached object. More... | |
object_iterator | ObjectsEnd () |
Retrieves an iterator to after the last attached object. More... | |
object_const_iterator | ObjectsEnd () const |
Retrieves an iterator to after the last attached object. More... | |
SceneNodeSPtr | GetChild (Castor::String const &p_name) |
Retrieves the child with given name. More... | |
bool | IsModified () const |
Retrieves the transformations matrices modify status. More... | |
void | SetVisible (bool p_visible) |
Sets the node visibility status. More... | |
uint32_t | RegisterObject (NodeChangedNotifyFunction p_function) |
Registers an object to be notified on changes. More... | |
void | UnregisterObject (uint32_t p_index) |
Unregisters an object from the changes notification. More... | |
Static Public Attributes | |
static uint64_t | Count |
The total number of scene nodes. More... | |
Protected Types | |
using | SceneNodePtrStrMap = std::map< Castor::String, SceneNodeWPtr > |
using | MovableObjectPtrArray = std::list< MovableObjectWPtr > |
Protected Attributes | |
bool | m_displayable |
Tells if it is displayable. A node is displayable if his parent is either displayable or the root node. More... | |
bool | m_visible |
The visible status. If a node is hidden, all objects attached to it are hidden. More... | |
Castor::Quaternion | m_orientation |
The relative orientation of the node. More... | |
Castor::Point3r | m_position |
The relative position of the node. More... | |
Castor::Point3r | m_scale |
The relative scale transform value of the node. More... | |
Castor::Matrix4x4r | m_transform |
The reative transformation matrix. More... | |
bool | m_mtxChanged |
Tells the relative transformation matrix needs recomputation. More... | |
Castor::Matrix4x4r | m_derivedTransform |
The absolute transformation matrix. More... | |
bool | m_derivedMtxChanged |
Tells the absolute transformation matrix needs recomputation. More... | |
SceneNodeWPtr | m_parent |
This node's parent. More... | |
SceneNodePtrStrMap | m_childs |
This node's childs. More... | |
MovableObjectPtrArray | m_objects |
This node's attached objects. More... | |
Castor::Signal< NodeChangedNotifyFunction > | m_signalChanged |
Signal used to notify attached objects that the node has changed. More... | |
The scene node handler class.
|
protected |
typedef SceneNodePtrStrMap::const_iterator Castor3D::SceneNode::node_const_iterator |
typedef SceneNodePtrStrMap::iterator Castor3D::SceneNode::node_iterator |
typedef MovableObjectPtrArray::const_iterator Castor3D::SceneNode::object_const_iterator |
typedef MovableObjectPtrArray::iterator Castor3D::SceneNode::object_iterator |
|
protected |
C3D_API Castor3D::SceneNode::SceneNode | ( | Castor::String const & | p_name, |
Scene & | p_scene | ||
) |
Constructor.
[in] | p_name | The node's name. |
[in] | p_scene | The parent scene. |
|
virtual |
Destructor.
C3D_API void Castor3D::SceneNode::AddChild | ( | SceneNodeSPtr | p_child | ) |
Add the given node to my childs if it isn't already.
[in] | p_child | The node to add |
C3D_API void Castor3D::SceneNode::AttachObject | ( | MovableObjectSPtr | p_object | ) |
Attaches a MovableObject to the node.
[in] | p_object | The object to attach |
C3D_API void Castor3D::SceneNode::AttachTo | ( | SceneNodeSPtr | p_parent | ) |
Sets the parent node.
[in] | p_parent | The new parent |
|
inline |
|
inline |
|
inline |
|
inline |
C3D_API void Castor3D::SceneNode::Detach | ( | ) |
Detaches the node from it's parent.
C3D_API void Castor3D::SceneNode::DetachAllChilds | ( | ) |
Detaches all my childs.
C3D_API void Castor3D::SceneNode::DetachChild | ( | SceneNodeSPtr | p_child | ) |
Detaches a child from my child's list, if it is one of my childs.
[in] | p_child | The child to detach |
C3D_API void Castor3D::SceneNode::DetachChild | ( | Castor::String const & | p_childName | ) |
Detaches a child from my child's list, if it is one of my childs.
[in] | p_childName | The name of the child to detach |
C3D_API void Castor3D::SceneNode::DetachObject | ( | MovableObjectSPtr | p_object | ) |
Detaches a MovableObject from the node.
[in] | p_object | The object to detach |
|
inline |
Retrieves the orientation in axis and angle terms.
[out] | p_axis | Receives the axis |
[out] | p_angle | Receives the angle |
References m_orientation.
|
inline |
Retrieves the child with given name.
[in] | p_name | The child name |
References m_childs.
|
inline |
C3D_API Castor::Quaternion Castor3D::SceneNode::GetDerivedOrientation | ( | ) |
Retrieves the absolute orientation.
C3D_API Castor::Point3r Castor3D::SceneNode::GetDerivedPosition | ( | ) |
Retrieves the absolute position.
C3D_API Castor::Point3r Castor3D::SceneNode::GetDerivedScale | ( | ) |
Retrieves the absolute scale.
C3D_API Castor::Matrix4x4r const& Castor3D::SceneNode::GetDerivedTransformationMatrix | ( | ) |
Retrieves the absolute transformation matrix.
C3D_API GeometrySPtr Castor3D::SceneNode::GetNearestGeometry | ( | Ray * | p_ray, |
real & | p_distance, | ||
FaceSPtr * | p_nearestFace, | ||
SubmeshSPtr * | p_nearestSubmesh | ||
) |
Gets the nearest geometry held by this node or it's children nodes, which is hit by the ray.
[in] | p_ray | The ray |
[out] | p_distance | Receives the distance of the met geometry |
[out] | p_nearestFace | Receives the face of the met geometry |
[out] | p_nearestSubmesh | Receives the submesh of the met geometry |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
C3D_API Castor::Matrix4x4r const& Castor3D::SceneNode::GetTransformationMatrix | ( | ) |
Retrieves the relative transformation matrix.
C3D_API bool Castor3D::SceneNode::HasChild | ( | Castor::String const & | p_name | ) |
[in] | p_name | The name of the node |
true
if one of my child has the given name
|
inline |
|
inline |
Retrieves the transformations matrices modify status.
References m_derivedMtxChanged, and m_mtxChanged.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
C3D_API void Castor3D::SceneNode::Pitch | ( | Castor::Angle const & | p_angle | ) |
Rotates around Z axis.
[in] | p_angle | The rotation angle |
|
inline |
Registers an object to be notified on changes.
[in] | p_function | The object notification function. |
References m_signalChanged.
C3D_API void Castor3D::SceneNode::Roll | ( | Castor::Angle const & | p_angle | ) |
Rotates around X axis.
[in] | p_angle | The rotation angle |
C3D_API void Castor3D::SceneNode::Rotate | ( | Castor::Quaternion const & | p_quat | ) |
Rotate the node with the given orientation.
[in] | p_quat | The orientation to add to current one |
C3D_API void Castor3D::SceneNode::Scale | ( | Castor::Point3r const & | p_s | ) |
Scales the node.
[in] | p_s | The scale value |
C3D_API void Castor3D::SceneNode::SetOrientation | ( | Castor::Quaternion const & | p_orientation | ) |
Sets the orientation.
[in] | p_orientation | The new orientation |
C3D_API void Castor3D::SceneNode::SetPosition | ( | Castor::Point3r const & | p_position | ) |
Sets the relative position from a Point3r.
[in] | p_position | The new position |
C3D_API void Castor3D::SceneNode::SetScale | ( | Castor::Point3r const & | p_scale | ) |
Sets the relative scale from a Point3r.
[in] | p_scale | The new scale |
|
inline |
C3D_API void Castor3D::SceneNode::Translate | ( | Castor::Point3r const & | p_t | ) |
Translates the node.
[in] | p_t | The translation value |
|
inline |
Unregisters an object from the changes notification.
[in] | p_index | The connection index. |
References m_signalChanged.
C3D_API void Castor3D::SceneNode::Yaw | ( | Castor::Angle const & | p_angle | ) |
Rotates around Y axis.
[in] | p_angle | The rotation angle |
|
static |
The total number of scene nodes.
|
protected |
This node's childs.
Referenced by ChildsBegin(), ChildsEnd(), GetChild(), and GetChilds().
|
protected |
Tells the absolute transformation matrix needs recomputation.
Referenced by IsModified().
|
protected |
The absolute transformation matrix.
|
protected |
Tells if it is displayable. A node is displayable if his parent is either displayable or the root node.
Referenced by IsDisplayable().
|
protected |
Tells the relative transformation matrix needs recomputation.
Referenced by IsModified().
|
protected |
This node's attached objects.
Referenced by GetObjects(), ObjectsBegin(), and ObjectsEnd().
|
protected |
The relative orientation of the node.
Referenced by GetAxisAngle(), and GetOrientation().
|
protected |
This node's parent.
Referenced by GetParent().
|
protected |
The relative position of the node.
Referenced by GetPosition().
|
protected |
The relative scale transform value of the node.
Referenced by GetScale().
|
protected |
Signal used to notify attached objects that the node has changed.
Referenced by RegisterObject(), and UnregisterObject().
|
protected |
The reative transformation matrix.
|
protected |
The visible status. If a node is hidden, all objects attached to it are hidden.
Referenced by IsVisible(), and SetVisible().