syBR::Game::SceneNode Class Reference

Scene node class. More...

#include <SceneNode.hpp>

List of all members.

Public Member Functions

void setPosition (const Ogre::Vector3 &position)
 Set the position.
const Ogre::Vector3 & getPosition () const
 Get the position.
void move (const Ogre::Vector3 &offset)
 Move.
void setOrientation (const Ogre::Quaternion &orientation)
 Set the orientation.
const Ogre::Quaternion & getOrientation () const
 Get the orientation.
void roll (const float angle)
 Rotate around the Z-axis.
void pitch (const float angle)
 Rotate around the X-axis.
void yaw (const float angle)
 Rotate around the Y-axis.
bool attachActor (const std::string &name)
 Attach an actor.
bool detachActor (const std::string &name)
 Detach an actor.
bool attachCamera (const std::string &name)
 Attach a camera.
bool detachCamera (const std::string &name)
 Detach a camera.
bool createSceneNode (const std::string &name)
 Create a scene node.
bool removeSceneNode (const std::string &name)
 Remove a scene node.
SceneNodegetSceneNode (const std::string &name)
 Get a scene node.

Private Member Functions

 SceneNode (SceneManager *pManager, const std::string &name, Scene *pParentScene, Ogre::SceneNode *pOgreSceneNode)
 Constructor.
virtual ~SceneNode ()
 Destructor.

Private Attributes

SceneManagerm_pManager
 Scene manager.
std::string m_name
 Name of the node.
Ogre::SceneNode * m_pOgreSceneNode
 Corresponding Ogre scene node.
Scenem_pParentScene
 Parent scene.
std::vector< Actor * > m_vpAttachedActors
 Attached actors.
std::vector< Camera * > m_vpAttachedCameras
 Attached cameras.
std::map
< std::string,
SceneNode * > 
m_mapSceneNodes
 Created scene nodes.

Friends

class Scene


Detailed Description

Scene node class.

It is a node in the scene graph.


Constructor & Destructor Documentation

syBR::Game::SceneNode::SceneNode ( SceneManager pManager,
const std::string &  name,
Scene pParentScene,
Ogre::SceneNode *  pOgreSceneNode 
) [private]

Constructor.

Parameters:
pManager Scene manager responsible of the parent scene of this node
name Name of the node
pParentScene Parent scene of this node
pOgreSceneNode Corresponding Ogre scene node

syBR::Game::SceneNode::~SceneNode (  )  [private, virtual]

Destructor.

Release used resources.


Member Function Documentation

void syBR::Game::SceneNode::setPosition ( const Ogre::Vector3 &  position  ) 

Set the position.

Parameters:
position Position to set

const Ogre::Vector3 & syBR::Game::SceneNode::getPosition (  )  const

Get the position.

Returns:
Position of the actor

void syBR::Game::SceneNode::move ( const Ogre::Vector3 &  offset  ) 

Move.

Parameters:
offset Movement offset

void syBR::Game::SceneNode::setOrientation ( const Ogre::Quaternion &  orientation  ) 

Set the orientation.

Parameters:
orientation Quaternion representing the orientation of the actor

const Ogre::Quaternion & syBR::Game::SceneNode::getOrientation (  )  const

Get the orientation.

Returns:
Quaternion representing the orientation of the actor

void syBR::Game::SceneNode::roll ( const float  angle  ) 

Rotate around the Z-axis.

Parameters:
angle Rotation angle in degrees

void syBR::Game::SceneNode::pitch ( const float  angle  ) 

Rotate around the X-axis.

Parameters:
angle Rotation angle in degrees

void syBR::Game::SceneNode::yaw ( const float  angle  ) 

Rotate around the Y-axis.

Parameters:
angle Rotation angle in degrees

bool syBR::Game::SceneNode::attachActor ( const std::string &  name  ) 

Attach an actor.

Parameters:
name Name of the actor to attach
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::SceneNode::detachActor ( const std::string &  name  ) 

Detach an actor.

Parameters:
name Name of the actor to detach
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::SceneNode::attachCamera ( const std::string &  name  ) 

Attach a camera.

Parameters:
name Name of the camera to attach
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::SceneNode::detachCamera ( const std::string &  name  ) 

Detach a camera.

Parameters:
name Name of the camera to detach
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::SceneNode::createSceneNode ( const std::string &  name  ) 

Create a scene node.

Parameters:
name Name of the scene node to create, it must be unique within the scene node (two nodes of the same scene node cannot have the same name)
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::SceneNode::removeSceneNode ( const std::string &  name  ) 

Remove a scene node.

Parameters:
name Name of the scene node to remove
Returns:
One of these:
  • true in case of success
  • false otherwise

SceneNode * syBR::Game::SceneNode::getSceneNode ( const std::string &  name  ) 

Get a scene node.

Parameters:
name Name of the scene node to retrieve
Returns:
One of these:
  • Pointer to the requested scene node if it exists
  • NULL otherwise


Friends And Related Function Documentation

friend class Scene [friend]


Member Data Documentation

SceneManager* syBR::Game::SceneNode::m_pManager [private]

Scene manager.

std::string syBR::Game::SceneNode::m_name [private]

Name of the node.

Ogre::SceneNode* syBR::Game::SceneNode::m_pOgreSceneNode [private]

Corresponding Ogre scene node.

Scene* syBR::Game::SceneNode::m_pParentScene [private]

Parent scene.

std::vector<Actor *> syBR::Game::SceneNode::m_vpAttachedActors [private]

Attached actors.

std::vector<Camera *> syBR::Game::SceneNode::m_vpAttachedCameras [private]

Attached cameras.

std::map<std::string, SceneNode *> syBR::Game::SceneNode::m_mapSceneNodes [private]

Created scene nodes.


The documentation for this class was generated from the following files:

Copyright © 2008 by Sebastien Frippiat
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:34 2008