omegalib
13.1
|
Class representing a general-purpose node in an articulated scene graph. More...
#include <Node.h>
Public Types | |
enum | TransformSpace { TransformLocal, TransformParent, TransformWorld } |
Enumeration denoting the spaces which a transform can be relative to. More... | |
typedef Dictionary< String, Ref< Node > > | ChildNodeMap |
Public Member Functions | |
Node () | |
Constructor, should only be called by parent, not directly. More... | |
Node (const String &name) | |
Constructor, should only be called by parent, not directly. More... | |
virtual | ~Node () |
const String & | getName (void) const |
Returns the name of the node. More... | |
virtual Node * | getParent (void) const |
Gets this node's parent (NULL if this is the root). More... | |
virtual const Quaternion & | getOrientation () const |
Returns a quaternion representing the nodes orientation. More... | |
virtual void | setOrientation (const Quaternion &q) |
Sets the orientation of this node via a quaternion. More... | |
virtual void | setOrientation (float w, float x, float y, float z) |
Sets the orientation of this node via quaternion parameters. More... | |
virtual void | resetOrientation (void) |
Resets the nodes orientation (local axes as world axes, no rotation). More... | |
virtual void | setPosition (const Vector3f &pos) |
Sets the position of the node relative to it's parent. More... | |
virtual void | setPosition (float x, float y, float z) |
Sets the position of the node relative to it's parent. More... | |
virtual const Vector3f & | getPosition (void) const |
Gets the position of the node relative to it's parent. More... | |
virtual void | setScale (const Vector3f &scale) |
Sets the scaling factor applied to this node. More... | |
virtual void | setScale (float x, float y, float z) |
Sets the scaling factor applied to this node. More... | |
virtual const Vector3f & | getScale (void) const |
Gets the scaling factor of this node. More... | |
virtual void | setInheritOrientation (bool inherit) |
Tells the node whether it should inherit orientation from it's parent node. More... | |
virtual bool | getInheritOrientation (void) const |
Returns true if this node is affected by orientation applied to the parent node. More... | |
virtual void | setInheritScale (bool inherit) |
Tells the node whether it should inherit scaling factors from it's parent node. More... | |
virtual bool | getInheritScale (void) const |
Returns true if this node is affected by scaling factors applied to the parent node. More... | |
virtual void | scale (const Vector3f &scale) |
Scales the node, combining it's current scale with the passed in scaling factor. More... | |
virtual void | scale (float x, float y, float z) |
Scales the node, combining it's current scale with the passed in scaling factor. More... | |
virtual void | translate (const Vector3f &d, TransformSpace relativeTo=TransformParent) |
Moves the node along the Cartesian axes. More... | |
virtual void | translate (float x, float y, float z, TransformSpace relativeTo=TransformParent) |
Moves the node along the Cartesian axes. More... | |
virtual void | translate (const Matrix3f &axes, const Vector3f &move, TransformSpace relativeTo=TransformParent) |
Moves the node along arbitrary axes. More... | |
virtual void | translate (const Matrix3f &axes, float x, float y, float z, TransformSpace relativeTo=TransformParent) |
Moves the node along arbitrary axes. More... | |
virtual void | roll (const float &angle, TransformSpace relativeTo=TransformLocal) |
Rotate the node around the Z-axis. More... | |
void | rollDeg (const float &angle, TransformSpace relativeTo=TransformLocal) |
Rotate the node around the Z-axis, The angle is specified in degrees. More... | |
virtual void | pitch (const float &angle, TransformSpace relativeTo=TransformLocal) |
Rotate the node around the X-axis. More... | |
virtual void | pitchDeg (const float &angle, TransformSpace relativeTo=TransformLocal) |
Rotate the node around the X-axis, The angle is specified in degrees. More... | |
virtual void | yaw (const float &angle, TransformSpace relativeTo=TransformLocal) |
Rotate the node around the Y-axis. More... | |
virtual void | yawDeg (const float &angle, TransformSpace relativeTo=TransformLocal) |
Rotate the node around the Y-axis, The angle is specified in degrees. More... | |
virtual void | rotate (const Vector3f &axis, const float &angle, TransformSpace relativeTo=TransformLocal) |
Rotate the node around an arbitrary axis. More... | |
virtual void | rotate (const Quaternion &q, TransformSpace relativeTo=TransformLocal) |
Rotate the node around an aritrary axis using a Quarternion. More... | |
virtual void | lookAt (const Vector3f &position, const Vector3f &upVector) |
Rotate the node to make its positive Z axis point toward the specified position. More... | |
virtual Matrix3f | getLocalAxes (void) const |
Gets a matrix whose columns are the local axes based on the nodes orientation relative to it's parent. More... | |
virtual void | addChild (Node *child) |
Adds a (precreated) child scene node to this node. More... | |
virtual unsigned short | numChildren (void) const |
Reports the number of child nodes under this one. More... | |
virtual Node * | getChild (unsigned short index) const |
Gets a pointer to a child node. More... | |
virtual Node * | getChild (const String &name) const |
Gets a pointer to a named child node. More... | |
virtual void | removeChild (unsigned short index) |
Drops the specified child from this node. More... | |
virtual void | removeChild (Node *child) |
Drops the specified child from this node. More... | |
virtual void | removeChild (const String &name) |
Drops the named child from this node. More... | |
virtual void | removeAllChildren (void) |
Removes all child Nodes attached to this node. More... | |
const List< Node * > & | getChildren () const |
#PYPI Returns the list of children of this node More... | |
virtual void | _setDerivedPosition (const Vector3f &pos) |
Sets the final world position of the node directly. More... | |
virtual void | _setDerivedOrientation (const Quaternion &q) |
Sets the final world orientation of the node directly. More... | |
virtual const Quaternion & | getDerivedOrientation (void) const |
Gets the orientation of the node as derived from all parents. More... | |
virtual const Vector3f & | getDerivedPosition (void) const |
Gets the position of the node as derived from all parents. More... | |
virtual const Vector3f & | getDerivedScale (void) const |
Gets the scaling factor of the node as derived from all parents. More... | |
virtual const AffineTransform3 & | getFullTransform (void) const |
Gets the full transformation matrix for this node. More... | |
virtual void | update (bool updateChildren, bool parentHasChanged) |
Internal method to update the Node. More... | |
virtual Vector3f | convertWorldToLocalPosition (const Vector3f &worldPos) |
Gets the local position, relative to this node, of the given world-space position. More... | |
virtual Vector3f | convertLocalToWorldPosition (const Vector3f &localPos) |
Gets the world position of a point in the node local space useful for simple transforms that don't require a child node. More... | |
virtual Quaternion | convertWorldToLocalOrientation (const Quaternion &worldOrientation) |
Gets the local orientation, relative to this node, of the given world-space orientation. More... | |
virtual Quaternion | convertLocalToWorldOrientation (const Quaternion &localOrientation) |
Gets the world orientation of an orientation in the node local space useful for simple transforms that don't require a child node. More... | |
virtual void | needUpdate (bool forceParentUpdate=true) |
To be called in the event of transform changes to this node that require it's recalculation. More... | |
virtual void | requestUpdate (Node *child, bool forceParentUpdate=false) |
Called by children to notify their parent that they need an update. More... | |
virtual void | cancelUpdate (Node *child) |
Called by children to notify their parent that they no longer need an update. More... | |
void * | getUserData () |
void | setUserData (void *data) |
void | setName (const String &name) |
bool | isUpdateNeeded () |
virtual void | update (const UpdateContext &context) |
Children begin iterator. More... | |
Public Member Functions inherited from omicron::ReferenceType | |
ReferenceType () | |
virtual | ~ReferenceType () |
void | ref () |
void | unref () |
long | refCount () |
Protected Types | |
typedef std::set< Node * > | ChildUpdateSet |
Protected Member Functions | |
virtual void | updateTraversal (const UpdateContext &context) |
virtual void | setParent (Node *parent) |
Only available internally - notification of parent. More... | |
virtual void | updateFromParent (void) const |
Class-specific implementation of updateFromParent. More... | |
Protected Attributes | |
Node * | mParent |
Pointer to parent node. More... | |
ChildNodeMap | mChildren |
Collection of pointers to direct children; hashmap for efficiency. More... | |
List< Node * > | mChildrenList |
ChildUpdateSet | mChildrenToUpdate |
List of children which need updating, used if self is not out of date but children are. More... | |
bool | mNeedParentUpdate |
Flag to indicate own transform from parent is out of date. More... | |
bool | mNeedChildUpdate |
Flag indicating that all children need to be updated. More... | |
bool | mParentNotified |
Flag indicating that parent has been notified about update request. More... | |
bool | mQueuedForUpdate |
Flag indicating that the node has been queued for update. More... | |
String | mName |
Friendly name of this node, can be automatically generated if you don't care. More... | |
Quaternion | mOrientation |
Stores the orientation of the node relative to it's parent. More... | |
Vector3f | mPosition |
Stores the position/translation of the node relative to its parent. More... | |
Vector3f | mScale |
Stores the scaling factor applied to this node. More... | |
bool | mInheritOrientation |
Stores whether this node inherits orientation from it's parent. More... | |
bool | mInheritScale |
Stores whether this node inherits scale from it's parent. More... | |
void * | myUserData |
Quaternion | mDerivedOrientation |
Cached combined orientation. More... | |
Vector3f | mDerivedPosition |
Cached combined position. More... | |
Vector3f | mDerivedScale |
Cached combined scale. More... | |
AffineTransform3 | mCachedTransform |
Cached derived transform as a 4x4 matrix. More... | |
bool | mCachedTransformOutOfDate |
Static Protected Attributes | |
static NameGenerator | msNameGenerator |
Incremented count for next name extension. More... | |
Static Protected Attributes inherited from omicron::ReferenceType | |
static List< ReferenceType * > | mysObjList |
Additional Inherited Members | |
Static Public Member Functions inherited from omicron::ReferenceType | |
static void | printObjCounts () |
Class representing a general-purpose node in an articulated scene graph.
typedef Dictionary<String, Ref<Node> > omega::Node::ChildNodeMap |
|
protected |
omega::Node::Node | ( | ) |
Constructor, should only be called by parent, not directly.
omega::Node::Node | ( | const String & | name | ) |
Constructor, should only be called by parent, not directly.
|
virtual |
|
virtual |
Sets the final world orientation of the node directly.
|
virtual |
Sets the final world position of the node directly.
|
virtual |
Adds a (precreated) child scene node to this node.
If it is attached to another node, it must be detached first.
child | The Node which is to become a child node of this one |
|
virtual |
Called by children to notify their parent that they no longer need an update.
|
virtual |
Gets the world orientation of an orientation in the node local space useful for simple transforms that don't require a child node.
Gets the world position of a point in the node local space useful for simple transforms that don't require a child node.
|
virtual |
Gets the local orientation, relative to this node, of the given world-space orientation.
Gets the local position, relative to this node, of the given world-space position.
|
virtual |
Gets a pointer to a child node.
Gets a pointer to a named child node.
#PYPI Returns the list of children of this node
|
virtual |
Gets the orientation of the node as derived from all parents.
|
virtual |
Gets the position of the node as derived from all parents.
|
virtual |
Gets the scaling factor of the node as derived from all parents.
|
virtual |
Gets the full transformation matrix for this node.
|
virtual |
Returns true if this node is affected by orientation applied to the parent node.
|
virtual |
Returns true if this node is affected by scaling factors applied to the parent node.
|
virtual |
Gets a matrix whose columns are the local axes based on the nodes orientation relative to it's parent.
const String& omega::Node::getName | ( | void | ) | const |
Returns the name of the node.
|
virtual |
Returns a quaternion representing the nodes orientation.
|
virtual |
Gets this node's parent (NULL if this is the root).
|
virtual |
Gets the position of the node relative to it's parent.
|
virtual |
Gets the scaling factor of this node.
|
inline |
|
inline |
Rotate the node to make its positive Z axis point toward the specified position.
Reimplemented in omega::Camera.
|
virtual |
To be called in the event of transform changes to this node that require it's recalculation.
forceParentUpdate | Even if the node thinks it has already told it's parent, tell it anyway |
Reimplemented in omega::SceneNode.
|
virtual |
Reports the number of child nodes under this one.
|
virtual |
Rotate the node around the X-axis.
|
inlinevirtual |
Rotate the node around the X-axis, The angle is specified in degrees.
|
virtual |
Removes all child Nodes attached to this node.
Does not delete the nodes, just detaches them from this parent, potentially to be reattached elsewhere.
|
virtual |
Drops the specified child from this node.
|
virtual |
Drops the specified child from this node.
|
virtual |
Drops the named child from this node.
|
virtual |
Called by children to notify their parent that they need an update.
forceParentUpdate | Even if the node thinks it has already told it's parent, tell it anyway |
|
virtual |
Resets the nodes orientation (local axes as world axes, no rotation).
|
virtual |
Rotate the node around the Z-axis.
|
inline |
Rotate the node around the Z-axis, The angle is specified in degrees.
|
virtual |
Rotate the node around an arbitrary axis.
|
virtual |
Rotate the node around an aritrary axis using a Quarternion.
|
virtual |
Scales the node, combining it's current scale with the passed in scaling factor.
|
virtual |
Scales the node, combining it's current scale with the passed in scaling factor.
|
virtual |
Tells the node whether it should inherit orientation from it's parent node.
inherit | If true, this node's orientation will be affected by its parent's orientation. If false, it will not be affected. |
|
virtual |
Tells the node whether it should inherit scaling factors from it's parent node.
inherit | If true, this node's scale will be affected by its parent's scale. If false, it will not be affected. |
void omega::Node::setName | ( | const String & | name | ) |
|
virtual |
Sets the orientation of this node via a quaternion.
|
virtual |
Sets the orientation of this node via quaternion parameters.
|
protectedvirtual |
Only available internally - notification of parent.
Reimplemented in omega::SceneNode.
|
virtual |
Sets the position of the node relative to it's parent.
|
virtual |
Sets the position of the node relative to it's parent.
|
virtual |
Sets the scaling factor applied to this node.
|
virtual |
Sets the scaling factor applied to this node.
|
inline |
|
virtual |
Moves the node along the Cartesian axes.
d | Vector with x,y,z values representing the translation. |
relativeTo | The space which this transform is relative to. |
|
virtual |
Moves the node along the Cartesian axes.
x | |
y | |
z | float x, y and z values representing the translation. |
relativeTo | The space which this transform is relative to. |
|
virtual |
Moves the node along arbitrary axes.
axes | A 3x3 Matrix containg 3 column vectors each representing the axes X, Y and Z respectively. In this format the standard cartesian axes would be expressed as: 1 0 0 0 1 0 0 0 1i.e. the identity matrix. |
move | Vector relative to the axes above. |
relativeTo | The space which this transform is relative to. |
|
virtual |
Moves the node along arbitrary axes.
axes | A 3x3 Matrix containg 3 column vectors each representing the axes X, Y and Z respectively. In this format the standard cartesian axes would be expressed as 1 0 0 0 1 0 0 0 1i.e. the identity matrix. |
x,y,z | Translation components relative to the axes above. |
relativeTo | The space which this transform is relative to. |
|
virtual |
Internal method to update the Node.
updateChildren | If true, the update cascades down to all children. Specify false if you wish to update children separately, e.g. because of a more selective SceneManager implementation. |
parentHasChanged | This flag indicates that the parent xform has changed, so the child should retrieve the parent's xform and combine it with its own even if it hasn't changed itself. |
Reimplemented in omega::SceneNode.
|
virtual |
|
protectedvirtual |
Class-specific implementation of updateFromParent.
Reimplemented in omega::Camera.
|
protectedvirtual |
Reimplemented in omega::Camera, and omega::SceneNode.
|
virtual |
Rotate the node around the Y-axis.
|
inlinevirtual |
Rotate the node around the Y-axis, The angle is specified in degrees.
|
mutableprotected |
Cached derived transform as a 4x4 matrix.
|
mutableprotected |
|
protected |
Collection of pointers to direct children; hashmap for efficiency.
|
mutableprotected |
List of children which need updating, used if self is not out of date but children are.
|
mutableprotected |
Cached combined orientation.
|
mutableprotected |
Cached combined position.
|
mutableprotected |
Cached combined scale.
|
protected |
Stores whether this node inherits orientation from it's parent.
|
protected |
Stores whether this node inherits scale from it's parent.
|
protected |
Friendly name of this node, can be automatically generated if you don't care.
|
mutableprotected |
Flag indicating that all children need to be updated.
|
mutableprotected |
Flag to indicate own transform from parent is out of date.
|
protected |
Stores the orientation of the node relative to it's parent.
|
mutableprotected |
Flag indicating that parent has been notified about update request.
|
protected |
Stores the position/translation of the node relative to its parent.
|
mutableprotected |
Flag indicating that the node has been queued for update.
|
protected |
Stores the scaling factor applied to this node.
|
staticprotected |
Incremented count for next name extension.
|
protected |