Public Member Functions | Protected Member Functions | Protected Attributes | Friends

sp::scene::SceneNode Class Reference

#include <spSceneNode.hpp>

Inheritance diagram for sp::scene::SceneNode:
sp::Node sp::BaseObject sp::scene::Camera sp::scene::Light sp::scene::RenderNode sp::scene::FirstPersonCamera sp::scene::MaterialNode sp::scene::SceneGraph sp::scene::Billboard sp::scene::Mesh sp::scene::Terrain sp::scene::SceneGraphFamilyTree sp::scene::SceneGraphPortalBased sp::scene::SceneGraphSimple sp::scene::SceneGraphSimpleStream

List of all members.

Public Member Functions

 SceneNode (const ENodeTypes Type=NODE_BASICNODE)
virtual ~SceneNode ()
SceneNodecopy () const
void setPositionMatrix (const dim::matrix4f &Position, bool isGlobal)
dim::matrix4f getPositionMatrix (bool isGlobal) const
void setRotationMatrix (const dim::matrix4f &Rotation, bool isGlobal)
dim::matrix4f getRotationMatrix (bool isGlobal) const
void setScaleMatrix (const dim::matrix4f &Scale, bool isGlobal)
dim::matrix4f getScaleMatrix (bool isGlobal) const
void setPosition (const dim::vector3df &Position, bool isGlobal=false)
dim::vector3df getPosition (bool isGlobal=false) const
void setRotation (const dim::vector3df &Rotation, bool isGlobal=false)
dim::vector3df getRotation (bool isGlobal=false) const
void setScale (const dim::vector3df &Scale, bool isGlobal=false)
dim::vector3df getScale (bool isGlobal=false) const
virtual void lookAt (const dim::vector3df &Position, bool isGlobal=false)
virtual void addAnimation (Animation *Anim)
virtual void removeAnimation (Animation *Anim)
 Removes the specified animation.
virtual void clearAnimations ()
 Clears the animation list.
virtual AnimationgetFirstAnimation () const
 Returns a pointer to the first animation if there is one. Otherise a null pointer.
virtual AnimationgetAnimation (u32 Index=0) const
 Returns a pointer to the specified animation object or null if that animation does not exist.
virtual AnimationfindAnimation (const io::stringc &Name) const
 Returns a pointer to the animation with the specified name or null if there is no animation with that name.
virtual bool getVisible (bool isGlobal=false) const
void setParent (SceneNode *Parent, bool isGlobal)
virtual void addChild (SceneNode *Child)
 Adds the specified child.
virtual void addChildren (const std::list< SceneNode * > &Children)
 Adds the specified children.
virtual bool removeChild (SceneNode *Child)
 Removes the specified child and returns true if the child could be removed.
virtual bool removeChild ()
 Removes the first child and returns true if a child could be removed.
virtual u32 removeChildren (const std::list< SceneNode * > &Children)
 Removes the specified children and returns the count of removed children.
virtual void removeChildren ()
 Removes all children.
virtual void updateTransformation ()
 Updates the objects transformation.
virtual void updateTransformationBase (const dim::matrix4f &BaseMatrix)
Transformation getTransformation (bool isGlobal) const
virtual void loadTransformation ()
 Loads the transformation into the render system which has been updated previously.
ENodeTypes getType () const
 Returns the scene node type. Use this to cast the object to a mesh (NODE_MESH), camerar (NODE_CAMERA) etc.
void setBoundingVolume (const BoundingVolume &BoundVolume)
BoundingVolumegetBoundingVolume ()
const BoundingVolumegetBoundingVolume () const
void setPositionMatrix (const dim::matrix4f &Position)
dim::matrix4f getPositionMatrix () const
void setRotationMatrix (const dim::matrix4f &Rotation)
dim::matrix4f getRotationMatrix () const
void setScaleMatrix (const dim::matrix4f &Scale)
dim::matrix4f getScaleMatrix () const
void setupTransformation (bool isGlobal)
 Sets the final world matrix used in the render system.
void setupWorldMatrix (const dim::matrix4f &WorldMatrix)
 Sets the final world matrix. Use this immediately before the object will be renderd.
const TransformationgetTransformation () const
TransformationgetTransformation ()
dim::matrix4f getTransformMatrix (bool isGlobal=false) const
void setTransformation (const Transformation &Transform)
const std::vector< SceneNode * > & getSceneChildren () const
 Returns the children list.
std::vector< SceneNode * > & getSceneChildren ()
void setParent (SceneNode *Parent)
 Sets the parent object only in object space (this is a little bit faster).
SceneNodegetParent () const
 Returns the parent node.
const std::vector< Animation * > & getAnimationList () const
 Returns the whole animation list.
u32 getAnimationCount () const
 Returns the count of animations which are linked to this scene node.
void move (const dim::vector3df &Direction)
 Moves the object in the specified direction. This is dependent on the current rotation transformation.
void turn (const dim::vector3df &Rotation)
 Turns the object with the specified rotation.
void translate (const dim::vector3df &Direction)
 Moves the object in the specified direction. This is independent on the current rotation transformation.
void transform (const dim::vector3df &Size)
 Transforms the object with the specified size.

Protected Member Functions

void copyRoot (SceneNode *NewNode) const

Protected Attributes

BoundingVolume BoundVolume_
Transformation Transform_
dim::matrix4f FinalWorldMatrix_
SceneNodeSceneParent_
std::vector< SceneNode * > SceneChildren_
std::vector< Animation * > AnimationList_

Friends

class Animation

Detailed Description

Nodes are the root of each object. This is the parent class of Entity, Camera, Light, Sprite and Terrain objects. Here you can find all the functions for locating the object in position, rotation and scaling. Some basic information about visibility, user data (void*) etc. are implemented in this class, too.


Constructor & Destructor Documentation

sp::scene::SceneNode::SceneNode ( const ENodeTypes  Type = NODE_BASICNODE  ) 
sp::scene::SceneNode::~SceneNode (  )  [virtual]

Member Function Documentation

void sp::scene::SceneNode::addAnimation ( Animation Anim  )  [virtual]

Adds the specified animation to this scene node or rather connects the animation with this scene node. Normally "Animation::addSceneNode" is used but this function has the same effect.

void sp::scene::SceneNode::addChild ( SceneNode Child  )  [virtual]

Adds the specified child.

void sp::scene::SceneNode::addChildren ( const std::list< SceneNode * > &  Children  )  [virtual]

Adds the specified children.

void sp::scene::SceneNode::clearAnimations (  )  [virtual]

Clears the animation list.

SceneNode * sp::scene::SceneNode::copy (  )  const
void sp::scene::SceneNode::copyRoot ( SceneNode NewNode  )  const [protected]
Animation * sp::scene::SceneNode::findAnimation ( const io::stringc Name  )  const [virtual]

Returns a pointer to the animation with the specified name or null if there is no animation with that name.

Animation * sp::scene::SceneNode::getAnimation ( u32  Index = 0  )  const [virtual]

Returns a pointer to the specified animation object or null if that animation does not exist.

u32 sp::scene::SceneNode::getAnimationCount (  )  const [inline]

Returns the count of animations which are linked to this scene node.

const std::vector<Animation*>& sp::scene::SceneNode::getAnimationList (  )  const [inline]

Returns the whole animation list.

BoundingVolume& sp::scene::SceneNode::getBoundingVolume (  )  [inline]
const BoundingVolume& sp::scene::SceneNode::getBoundingVolume (  )  const [inline]
Animation * sp::scene::SceneNode::getFirstAnimation (  )  const [virtual]

Returns a pointer to the first animation if there is one. Otherise a null pointer.

SceneNode* sp::scene::SceneNode::getParent (  )  const [inline]

Returns the parent node.

Reimplemented from sp::Node.

dim::vector3df sp::scene::SceneNode::getPosition ( bool  isGlobal = false  )  const
dim::matrix4f sp::scene::SceneNode::getPositionMatrix (  )  const [inline]
dim::matrix4f sp::scene::SceneNode::getPositionMatrix ( bool  isGlobal  )  const
dim::vector3df sp::scene::SceneNode::getRotation ( bool  isGlobal = false  )  const
dim::matrix4f sp::scene::SceneNode::getRotationMatrix ( bool  isGlobal  )  const
dim::matrix4f sp::scene::SceneNode::getRotationMatrix (  )  const [inline]
dim::vector3df sp::scene::SceneNode::getScale ( bool  isGlobal = false  )  const
dim::matrix4f sp::scene::SceneNode::getScaleMatrix (  )  const [inline]
dim::matrix4f sp::scene::SceneNode::getScaleMatrix ( bool  isGlobal  )  const
const std::vector<SceneNode*>& sp::scene::SceneNode::getSceneChildren (  )  const [inline]

Returns the children list.

std::vector<SceneNode*>& sp::scene::SceneNode::getSceneChildren (  )  [inline]
const Transformation& sp::scene::SceneNode::getTransformation (  )  const [inline]
Transformation& sp::scene::SceneNode::getTransformation (  )  [inline]
Transformation sp::scene::SceneNode::getTransformation ( bool  isGlobal  )  const
dim::matrix4f sp::scene::SceneNode::getTransformMatrix ( bool  isGlobal = false  )  const [inline]
ENodeTypes sp::scene::SceneNode::getType (  )  const [inline]

Returns the scene node type. Use this to cast the object to a mesh (NODE_MESH), camerar (NODE_CAMERA) etc.

bool sp::scene::SceneNode::getVisible ( bool  isGlobal = false  )  const [virtual]
Parameters:
[in] isGlobal If true the visibility uses the parent hierarchy.
Returns:
true if this scene node and all scene nodes in its parent hierarchy are visible. Otherwise false.
void sp::scene::SceneNode::loadTransformation (  )  [virtual]

Loads the transformation into the render system which has been updated previously.

void sp::scene::SceneNode::lookAt ( const dim::vector3df Position,
bool  isGlobal = false 
) [virtual]
void sp::scene::SceneNode::move ( const dim::vector3df Direction  )  [inline]

Moves the object in the specified direction. This is dependent on the current rotation transformation.

void sp::scene::SceneNode::removeAnimation ( Animation Anim  )  [virtual]

Removes the specified animation.

bool sp::scene::SceneNode::removeChild ( SceneNode Child  )  [virtual]

Removes the specified child and returns true if the child could be removed.

bool sp::scene::SceneNode::removeChild (  )  [virtual]

Removes the first child and returns true if a child could be removed.

Reimplemented from sp::Node.

u32 sp::scene::SceneNode::removeChildren ( const std::list< SceneNode * > &  Children  )  [virtual]

Removes the specified children and returns the count of removed children.

void sp::scene::SceneNode::removeChildren (  )  [virtual]

Removes all children.

Reimplemented from sp::Node.

void sp::scene::SceneNode::setBoundingVolume ( const BoundingVolume BoundVolume  )  [inline]
void sp::scene::SceneNode::setParent ( SceneNode Parent,
bool  isGlobal 
)

Sets the parent object. With parents object transformations become much more easier. If the parent object will be moved, rotated or scaled this child object will be transformed in dependency of its parent. e.g. a car has four children even their tires. When the car moves around the scene you don't need to handle the tire transformation. But don't forget to disable parents when the parent object has been deleted but the children further exist!

Parameters:
ParentNode,: Pointer to the new parent Node object. If you want to disable the parent set it to 0.
isGlobal,: If true the current object transformation looks the same. The transformation will be performed in global space. Otherwise in object space.
void sp::scene::SceneNode::setParent ( SceneNode Parent  )  [inline]

Sets the parent object only in object space (this is a little bit faster).

void sp::scene::SceneNode::setPosition ( const dim::vector3df Position,
bool  isGlobal = false 
)
void sp::scene::SceneNode::setPositionMatrix ( const dim::matrix4f Position,
bool  isGlobal 
)

Sets the object's position matrix.

Parameters:
Position,: Matrix which is to be used for the position transformation.
isGlobal,: Only useful when the object is a child of an other. If so and "isGlobal" is true the transformation will be processed global.
void sp::scene::SceneNode::setPositionMatrix ( const dim::matrix4f Position  )  [inline]
void sp::scene::SceneNode::setRotation ( const dim::vector3df Rotation,
bool  isGlobal = false 
)

Sets the object's rotation. A typically rotation in the engine is performed by the follwoing combination: Y, X, Z. This is the order in which the rotation axles are processed. If you want to perform an individual rotation use "setRotationMatrix" with your own matrix transformation.

void sp::scene::SceneNode::setRotationMatrix ( const dim::matrix4f Rotation  )  [inline]
void sp::scene::SceneNode::setRotationMatrix ( const dim::matrix4f Rotation,
bool  isGlobal 
)
void sp::scene::SceneNode::setScale ( const dim::vector3df Scale,
bool  isGlobal = false 
)
void sp::scene::SceneNode::setScaleMatrix ( const dim::matrix4f Scale  )  [inline]
void sp::scene::SceneNode::setScaleMatrix ( const dim::matrix4f Scale,
bool  isGlobal 
)
void sp::scene::SceneNode::setTransformation ( const Transformation Transform  )  [inline]
void sp::scene::SceneNode::setupTransformation ( bool  isGlobal  )  [inline]

Sets the final world matrix used in the render system.

void sp::scene::SceneNode::setupWorldMatrix ( const dim::matrix4f WorldMatrix  )  [inline]

Sets the final world matrix. Use this immediately before the object will be renderd.

void sp::scene::SceneNode::transform ( const dim::vector3df Size  )  [inline]

Transforms the object with the specified size.

void sp::scene::SceneNode::translate ( const dim::vector3df Direction  )  [inline]

Moves the object in the specified direction. This is independent on the current rotation transformation.

void sp::scene::SceneNode::turn ( const dim::vector3df Rotation  )  [inline]

Turns the object with the specified rotation.

void sp::scene::SceneNode::updateTransformation (  )  [virtual]

Updates the objects transformation.

Reimplemented in sp::scene::RenderNode, sp::scene::Billboard, and sp::scene::Camera.

void sp::scene::SceneNode::updateTransformationBase ( const dim::matrix4f BaseMatrix  )  [virtual]

Friends And Related Function Documentation

friend class Animation [friend]

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines