| Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | 
#include <Node.h>
  
 Public Member Functions | |
| void | addChild (Node *child) | 
| Adds a child node to this node.   | |
| Node * | createChild (const core::vector3d &pos=core::vector3d::ORIGIN_3D, const core::quaternion &rot=core::quaternion::IDENTITY, const core::vector3d &scale=core::vector3d::UNIT_SCALE) | 
| Creates a new node as a child of this node.   | |
| const core::vector3d | getAbsoluteDirection () | 
| Gets the nodes's direction vector,i.e. its absolute z-axis.   | |
| const core::quaternion & | getAbsoluteOrientation () | 
| Gets the orientation of the node as derived from all parents.   | |
| const core::vector3d & | getAbsolutePosition () | 
| Gets the position of the node as derived from all parents.   | |
| const core::vector3d | getAbsoluteRight () | 
| Retrieves the nodes's 'right' vector, i.e. its absolute x-axis.   | |
| const core::vector3d & | getAbsoluteScale () | 
| Gets the scaling factor of the node as derived from all parents.   | |
| const core::vector3d | getAbsoluteUp () | 
| Retrieves the nodes's 'up' vector, i.e. its absolute y-axis.   | |
| Node * | getChild (const u32 &id) const | 
| Gets a pointer to a child node.   | |
| const std::map< u32, Node * > & | getChildren () | 
| const core::vector3d | getDirection () | 
| Gets the node's direction vector,i.e. its local z-axis.   | |
| bool | getInheritOrientation () | 
| Returns true if this node is affected by orientation applied to the parent node.   | |
| bool | getInheritScale () | 
| Returns true if this node is affected by scaling factors applied to the parent node.   | |
| const NodeType & | getNodeType () const | 
| Gets node type.   | |
| u16 | getNumberOfChildren () | 
| Gets the number of child nodes under this one.   | |
| const core::quaternion & | getOrientation () | 
| Gets the orientation of this node.   | |
| Node * | getParent () | 
| Gets this node's parent.   | |
| const core::vector3d & | getPosition () | 
| Gets the position of the node relative to it's parent.   | |
| const core::vector3d | getRight () | 
| Retrieves the nodes's 'right' vector, i.e. its local x-axis.   | |
| const core::vector3d & | getScale () | 
| Gets the scaling factor of this node.   | |
| const core::vector3d | getUp () | 
| Retrieves the node's 'up' vector, i.e. its local y-axis.   | |
| Node () | |
| Node (const std::string &name) | |
| void | removeAllChildren () | 
| Removes all child Nodes attached to this node. Does not delete the node, just detaches it from.   | |
| void | removeChild (Node *child) | 
| Node * | removeChild (const u32 &id) | 
| virtual void | rotate (const core::quaternion &q, TransformSpace relativeTo=TS_LOCAL) | 
| virtual void | rotate (const f32 °rees, const core::vector3d &axis, TransformSpace relativeTo=TS_LOCAL) | 
| virtual void | rotateX (f32 degrees, TransformSpace relativeTo=TS_LOCAL) | 
| virtual void | rotateY (f32 degrees, TransformSpace relativeTo=TS_LOCAL) | 
| virtual void | rotateZ (f32 degrees, TransformSpace relativeTo=TS_LOCAL) | 
| virtual void | scale (const core::vector3d &scale) | 
| void | setInheritOrientation (bool inherit) | 
| Tells the node whether it should inherit orientation from it's parent node.   | |
| void | setInheritScale (bool inherit) | 
| Tells the node whether it should inherit scaling factors from it's parent node.   | |
| virtual void | setOrientation (const core::quaternion &q) | 
| Sets the orientation applied to this node.   | |
| void | setParent (Node *parent) | 
| Sets this node's parent.   | |
| virtual void | setPosition (f32 x, f32 y, f32 z) | 
| Sets the position of the node relative to it's parent.   | |
| virtual void | setPosition (const core::vector3d &pos) | 
| void | setScale (f32 x, f32 y, f32 z) | 
| Sets the scaling factor applied to this node.   | |
| void | setScale (const core::vector3d &scale) | 
| virtual void | translate (const core::vector3d &d, TransformSpace relativeTo=TS_LOCAL) | 
| virtual | ~Node () | 
Protected Member Functions | |
| void | initProperties () | 
| virtual void | updateImpl (f32 elapsedTime) | 
| virtual void | updateTransformImpl () | 
Protected Attributes | |
| core::quaternion | mAbsoluteOrientation | 
| core::vector3d | mAbsolutePosition | 
| Cached combined position.   | |
| core::vector3d | mAbsoluteScale | 
| Cached combined scale.   | |
| std::map< u32, Node * > | mChildren | 
| Central list of children.   | |
| bool | mInheritOrientation | 
| Stores whether this node inherits orientation from it's parent.   | |
| bool | mInheritScale | 
| Stores whether this node inherits scale from it's parent.   | |
| bool | mModifiedAbsoluteTransform | 
| Flag indicating derived transform was modified.   | |
| NodeType | mNodeType | 
| core::quaternion | mOrientation | 
| Stores the orientation of the node relative to it's parent.   | |
| Node * | mParent | 
| core::vector3d | mPosition | 
| Stores the position/translation of the node relative to its parent.   | |
| core::vector3d | mScale | 
| Stores the scaling factor applied to this node.   | |
Static Protected Attributes | |
| static u32 | msNextGeneratedNodeIndex = 0 | 
| Incremented count for next index.   | |
Class representing a node in the scene graph. A node in the scene graph is a node in a large tree containing all objects in the scene. A node contains information about the transformation which will apply to it and all of it's children.
| scene::Node::Node | ( | ) | 
References initProperties(), mNodeType, engine::Object::mObjectType, scene::NT_UNDEFINED, and engine::OT_NODE.
Referenced by createChild().
| scene::Node::Node | ( | const std::string & | name | ) | 
References initProperties(), mNodeType, engine::Object::mObjectType, scene::NT_UNDEFINED, and engine::OT_NODE.
| scene::Node::~Node | ( | ) |  [virtual] | 
        
References mParent, removeAllChildren(), and removeChild().
| void scene::Node::addChild | ( | Node * | child | ) | 
Adds a child node to this node.
References engine::Object::getID(), mChildren, mParent, removeChild(), and updateTransformImpl().
Referenced by scene::SceneManager::addNode(), scene::GroupNode::addNode(), and scene::SceneManager::createNode().
| Node * scene::Node::createChild | ( | const core::vector3d & | pos = core::vector3d::ORIGIN_3D,  | 
        
| const core::quaternion & | rot = core::quaternion::IDENTITY,  | 
        ||
| const core::vector3d & | scale = core::vector3d::UNIT_SCALE  | 
        ||
| ) | 
Creates a new node as a child of this node.
References engine::Object::getID(), mChildren, mParent, Node(), rotate(), scale(), translate(), and updateTransformImpl().
| const core::vector3d scene::Node::getAbsoluteDirection | ( | ) | 
Gets the nodes's direction vector,i.e. its absolute z-axis.
References mAbsoluteOrientation, and core::vector3d::NEGATIVE_UNIT_Z.
Referenced by render::ShaderParamData::getCurrentLightDirection().
| const core::quaternion & scene::Node::getAbsoluteOrientation | ( | ) | 
Gets the orientation of the node as derived from all parents.
References mAbsoluteOrientation.
Referenced by render::RenderManager::renderSingleRenderable(), rotate(), render::Camera::rotate(), translate(), and updateTransformImpl().
| const core::vector3d & scene::Node::getAbsolutePosition | ( | ) | 
Gets the position of the node as derived from all parents.
References mAbsolutePosition.
Referenced by render::RenderManager::findLightsAffectingRenderables(), render::RenderManager::findVisibleRenderables(), render::ShaderParamData::getCameraPosition(), render::ShaderParamData::getCameraPositionObjectSpace(), render::ShaderParamData::getCurrentLightPosition(), render::RenderManager::renderSingleRenderable(), and updateTransformImpl().
| const core::vector3d scene::Node::getAbsoluteRight | ( | ) | 
Retrieves the nodes's 'right' vector, i.e. its absolute x-axis.
References mAbsoluteOrientation, and core::vector3d::UNIT_X.
| const core::vector3d & scene::Node::getAbsoluteScale | ( | ) | 
Gets the scaling factor of the node as derived from all parents.
References mAbsoluteScale.
Referenced by translate(), and updateTransformImpl().
| const core::vector3d scene::Node::getAbsoluteUp | ( | ) | 
Retrieves the nodes's 'up' vector, i.e. its absolute y-axis.
References mAbsoluteOrientation, and core::vector3d::UNIT_Y.
| const core::vector3d scene::Node::getDirection | ( | ) | 
Gets the node's direction vector,i.e. its local z-axis.
References mOrientation, and core::vector3d::NEGATIVE_UNIT_Z.
| bool scene::Node::getInheritOrientation | ( | ) | 
Returns true if this node is affected by orientation applied to the parent node.
References mInheritOrientation.
| bool scene::Node::getInheritScale | ( | ) | 
Returns true if this node is affected by scaling factors applied to the parent node.
References mInheritScale.
| const NodeType & scene::Node::getNodeType | ( | ) | const | 
| u16 scene::Node::getNumberOfChildren | ( | ) | 
Gets the number of child nodes under this one.
References mChildren.
Referenced by scene::GroupNode::getNumberOfNodes().
| const core::quaternion & scene::Node::getOrientation | ( | ) | 
Gets the orientation of this node.
References mOrientation.
| const core::vector3d & scene::Node::getPosition | ( | ) | 
Gets the position of the node relative to it's parent.
References mPosition.
| const core::vector3d scene::Node::getRight | ( | ) | 
Retrieves the nodes's 'right' vector, i.e. its local x-axis.
References mOrientation, and core::vector3d::UNIT_X.
| const core::vector3d & scene::Node::getScale | ( | ) | 
Gets the scaling factor of this node.
References mScale.
| const core::vector3d scene::Node::getUp | ( | ) | 
Retrieves the node's 'up' vector, i.e. its local y-axis.
References mOrientation, and core::vector3d::UNIT_Y.
| void scene::Node::initProperties | ( | ) |  [protected] | 
        
Reimplemented in physics::Body, render::Camera, render::DebugRenderable, render::Light, render::Model, render::Overlay, render::Renderable, render::TextOverlay, sound::Listener, and sound::Sound.
References core::quaternion::IDENTITY, mAbsoluteOrientation, mAbsolutePosition, mAbsoluteScale, mInheritOrientation, mInheritScale, mModifiedAbsoluteTransform, mOrientation, mParent, mPosition, mScale, core::vector3d::ORIGIN_3D, and core::vector3d::UNIT_SCALE.
Referenced by Node().
| void scene::Node::removeAllChildren | ( | ) | 
Removes all child Nodes attached to this node. Does not delete the node, just detaches it from.
References mChildren.
Referenced by scene::GroupNode::removeAllNodes(), and ~Node().
| void scene::Node::removeChild | ( | Node * | child | ) | 
References engine::Object::getID(), and mChildren.
Referenced by addChild(), scene::GroupNode::removeNode(), setParent(), and ~Node().
| void scene::Node::rotate | ( | const core::quaternion & | q, | 
| TransformSpace | relativeTo = TS_LOCAL  | 
        ||
| ) |  [virtual] | 
        
Reimplemented in render::Camera.
References getAbsoluteOrientation(), core::quaternion::getInverse(), mModifiedAbsoluteTransform, mOrientation, scene::TS_LOCAL, scene::TS_PARENT, and scene::TS_WORLD.
Referenced by createChild(), rotate(), rotateX(), rotateY(), and rotateZ().
| void scene::Node::rotate | ( | const f32 & | degrees, | 
| const core::vector3d & | axis, | ||
| TransformSpace | relativeTo = TS_LOCAL  | 
        ||
| ) |  [virtual] | 
        
Reimplemented in render::Camera.
References core::quaternion::fromDegreeAxis(), and rotate().
| void scene::Node::rotateX | ( | f32 | degrees, | 
| TransformSpace | relativeTo = TS_LOCAL  | 
        ||
| ) |  [virtual] | 
        
Reimplemented in render::Camera.
References rotate(), and core::vector3d::UNIT_X.
| void scene::Node::rotateY | ( | f32 | degrees, | 
| TransformSpace | relativeTo = TS_LOCAL  | 
        ||
| ) |  [virtual] | 
        
Reimplemented in render::Camera.
References rotate(), and core::vector3d::UNIT_Y.
| void scene::Node::rotateZ | ( | f32 | degrees, | 
| TransformSpace | relativeTo = TS_LOCAL  | 
        ||
| ) |  [virtual] | 
        
Reimplemented in render::Camera.
References rotate(), and core::vector3d::UNIT_Z.
| void scene::Node::scale | ( | const core::vector3d & | scale | ) |  [virtual] | 
        
References mModifiedAbsoluteTransform, and mScale.
Referenced by createChild(), setScale(), render::Model::updateImpl(), render::Overlay::updateWorldTransform(), and render::Model::updateWorldTransform().
| void scene::Node::setInheritOrientation | ( | bool | inherit | ) | 
Tells the node whether it should inherit orientation from it's parent node.
References mInheritOrientation.
| void scene::Node::setInheritScale | ( | bool | inherit | ) | 
Tells the node whether it should inherit scaling factors from it's parent node.
References mInheritScale.
| void scene::Node::setOrientation | ( | const core::quaternion & | q | ) |  [virtual] | 
        
Sets the orientation applied to this node.
References mModifiedAbsoluteTransform, and mOrientation.
| void scene::Node::setParent | ( | Node * | parent | ) | 
Sets this node's parent.
References mChildren, engine::Object::mID, mParent, removeChild(), and updateTransformImpl().
Referenced by render::DebugRenderable::DebugRenderable().
Sets the position of the node relative to it's parent.
References mModifiedAbsoluteTransform, mPosition, core::vector3d::X, core::vector3d::Y, and core::vector3d::Z.
| void scene::Node::setPosition | ( | const core::vector3d & | pos | ) |  [virtual] | 
        
References mModifiedAbsoluteTransform, and mPosition.
Sets the scaling factor applied to this node.
References mModifiedAbsoluteTransform, mScale, core::vector3d::X, core::vector3d::Y, and core::vector3d::Z.
| void scene::Node::setScale | ( | const core::vector3d & | scale | ) | 
References mModifiedAbsoluteTransform, mScale, and scale().
| void scene::Node::translate | ( | const core::vector3d & | d, | 
| TransformSpace | relativeTo = TS_LOCAL  | 
        ||
| ) |  [virtual] | 
        
References getAbsoluteOrientation(), getAbsoluteScale(), core::quaternion::getInverse(), mModifiedAbsoluteTransform, mOrientation, mParent, mPosition, scene::TS_LOCAL, scene::TS_PARENT, and scene::TS_WORLD.
Referenced by createChild().
| void scene::Node::updateImpl | ( | f32 | elapsedTime | ) |  [protected, virtual] | 
        
Reimplemented from engine::Object.
Reimplemented in render::Camera, render::Model, and render::Overlay.
References updateTransformImpl().
| void scene::Node::updateTransformImpl | ( | ) |  [protected, virtual] | 
        
Reimplemented in physics::Body, and render::TextOverlay.
References getAbsoluteOrientation(), getAbsolutePosition(), getAbsoluteScale(), mAbsoluteOrientation, mAbsolutePosition, mAbsoluteScale, mChildren, mInheritOrientation, mInheritScale, mModifiedAbsoluteTransform, mOrientation, mParent, mPosition, and mScale.
Referenced by addChild(), createChild(), setParent(), updateImpl(), render::Camera::updateView(), render::Overlay::updateWorldTransform(), and render::Model::updateWorldTransform().
core::quaternion scene::Node::mAbsoluteOrientation [protected] | 
        
Cached combined orientation. This member is the orientation derived by combining the local transformations and those of it's parents.
Referenced by getAbsoluteDirection(), getAbsoluteOrientation(), getAbsoluteRight(), getAbsoluteUp(), initProperties(), render::Model::updateImpl(), updateTransformImpl(), render::Camera::updateView(), render::Overlay::updateWorldTransform(), and render::Model::updateWorldTransform().
core::vector3d scene::Node::mAbsolutePosition [protected] | 
        
Cached combined position.
Referenced by getAbsolutePosition(), initProperties(), render::Model::updateImpl(), updateTransformImpl(), render::Camera::updateView(), render::Overlay::updateWorldTransform(), and render::Model::updateWorldTransform().
core::vector3d scene::Node::mAbsoluteScale [protected] | 
        
Cached combined scale.
Referenced by getAbsoluteScale(), initProperties(), render::Model::updateImpl(), updateTransformImpl(), render::Overlay::updateWorldTransform(), and render::Model::updateWorldTransform().
std::map<u32, Node*> scene::Node::mChildren [protected] | 
        
Central list of children.
Referenced by addChild(), createChild(), getChild(), getChildren(), getNumberOfChildren(), removeAllChildren(), removeChild(), setParent(), and updateTransformImpl().
bool scene::Node::mInheritOrientation [protected] | 
        
Stores whether this node inherits orientation from it's parent.
Referenced by getInheritOrientation(), initProperties(), setInheritOrientation(), and updateTransformImpl().
bool scene::Node::mInheritScale [protected] | 
        
Stores whether this node inherits scale from it's parent.
Referenced by getInheritScale(), initProperties(), setInheritScale(), and updateTransformImpl().
bool scene::Node::mModifiedAbsoluteTransform [protected] | 
        
Flag indicating derived transform was modified.
Referenced by initProperties(), render::Light::operator=(), rotate(), render::Camera::rotate(), scale(), render::Light::setAmbientColor(), render::Camera::setDirection(), render::Light::setLightType(), setOrientation(), setPosition(), render::Overlay::setPosition(), setScale(), sound::Sound::setVelocity(), sound::Listener::setVelocity(), translate(), render::Overlay::updateImpl(), render::Model::updateImpl(), render::Camera::updateImpl(), and updateTransformImpl().
NodeType scene::Node::mNodeType [protected] | 
        
core::quaternion scene::Node::mOrientation [protected] | 
        
Stores the orientation of the node relative to it's parent.
Referenced by physics::Body::applyAngularImpulse(), physics::Body::applyForce(), physics::Body::applyLinearImpulse(), physics::Body::applyTorque(), getDirection(), getOrientation(), getRight(), getUp(), initProperties(), render::Light::operator=(), rotate(), render::Camera::rotate(), render::Camera::rotateX(), render::Camera::rotateY(), render::Camera::rotateZ(), render::Camera::setDirection(), setOrientation(), translate(), and updateTransformImpl().
Node* scene::Node::mParent [protected] | 
        
Referenced by addChild(), createChild(), getParent(), initProperties(), removeChild(), setParent(), translate(), updateTransformImpl(), and ~Node().
core::vector3d scene::Node::mPosition [protected] | 
        
Stores the position/translation of the node relative to its parent.
Referenced by getPosition(), initProperties(), render::Camera::lookAt(), render::Light::operator=(), setPosition(), render::Overlay::setPosition(), translate(), and updateTransformImpl().
core::vector3d scene::Node::mScale [protected] | 
        
Stores the scaling factor applied to this node.
Referenced by getScale(), initProperties(), render::Light::operator=(), scale(), setScale(), and updateTransformImpl().
u32 scene::Node::msNextGeneratedNodeIndex = 0 [static, protected] | 
        
Incremented count for next index.
|  
	 
	
		
		
		The KG Game Engine 
		Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:10 by 
		Doxygen 
        (1.7.4)
		
		
	
	 
	 |