CrystalSpace

Public API Reference

CS::Engine::BaseMovable Class Reference

A base movable implementation. More...

#include <cstool/basemovable.h>

Inheritance diagram for CS::Engine::BaseMovable:

List of all members.

Public Member Functions

void AddListener (iMovableListener *listener)
 Add a listener to this movable.
 BaseMovable ()
 Create a default movable.
void ClearSectors ()
 Clear the list of sectors.
iCameraGetCamera () const
 Get the camera on which we operate.
const csVector3 GetFullPosition () const
 Get the current position using the full transformation (using possible parent transformations).
csReversibleTransform GetFullTransform () const
 Construct the full world to object transformation given this transformation and possible parents transformations.
iLightGetLight () const
 Get the light on which we operate.
iMeshWrapperGetMeshWrapper () const
 Get the meshobject on which we operate.
BaseMovableGetParent () const
 Get the parent movable.
const csVector3GetPosition () const
 Get the current local position.
virtual iSceneNodeGetSceneNode ()
 Get the scene node that this movable belongs too.
iSectorListGetSectors ()
 Get list of sectors for this entity.
const csReversibleTransformGetTransform () const
 Get the local world to object transformation.
csReversibleTransformGetTransform ()
 Get the local world to object tranformation.
long GetUpdateNumber () const
 A number which indicates if the movable has been updated.
bool InSector () const
 Return true if we are placed in a sector.
bool IsFullTransformIdentity () const
 Return true if the movable transformation is an identity transformation and the (optional) parent of this movable also is has identity transformation.
bool IsTransformIdentity () const
 This function returns true if the movable transformation is an identity transformation.
void MovePosition (const csVector3 &v)
 Relative move.
void RemoveListener (iMovableListener *listener)
 Remove a listener from this movable.
void SetCamera (iCamera *obj)
 Set camera on which this movable operates.
virtual void SetFullPosition (const csVector3 &v)
 Set the transformation vector.
virtual void SetFullTransform (const csReversibleTransform &t)
 Set the world to object transformation.
void SetLight (iLight *obj)
 Set light on which this movable operates.
void SetMeshWrapper (iMeshWrapper *obj)
 Set meshobject on which this movable operates.
void SetParent (BaseMovable *par)
 Set the parent movable.
void SetPosition (const csVector3 &v)
 Set the transformation vector for this object.
void SetPosition (iSector *home, const csVector3 &v)
 Set the transformation vector and sector to move to some position.
void SetSector (iSector *sector)
 Initialize the list of sectors to one sector where this thing is.
void SetTransform (const csReversibleTransform &t)
 Set the local world to object tranformation.
void SetTransform (const csMatrix3 &matrix)
 Set the transformation matrix for this entity.
void Transform (const csMatrix3 &matrix)
 Relative transform.
void TransformIdentity ()
 Set the transform of this movable to the identity transform (ie not moving at all).
void UpdateMove ()
 After all movement has been done you need to call UpdateMove() to make the final changes to the entity that is controlled by this movable.
virtual ~BaseMovable ()
 Destructor.

Detailed Description

A base movable implementation.

Definition at line 74 of file basemovable.h.


Constructor & Destructor Documentation

CS::Engine::BaseMovable::BaseMovable (  ) 

Create a default movable.

virtual CS::Engine::BaseMovable::~BaseMovable (  )  [virtual]

Destructor.


Member Function Documentation

void CS::Engine::BaseMovable::AddListener ( iMovableListener listener  )  [virtual]

Add a listener to this movable.

This listener will be called whenever the movable changes or right before the movable is destroyed.

Implements iMovable.

void CS::Engine::BaseMovable::ClearSectors (  )  [virtual]

Clear the list of sectors.

This function does not do anything if the parent is not 0.

Implements iMovable.

iCamera* CS::Engine::BaseMovable::GetCamera (  )  const [inline]

Get the camera on which we operate.

Definition at line 161 of file basemovable.h.

const csVector3 CS::Engine::BaseMovable::GetFullPosition (  )  const [inline, virtual]

Get the current position using the full transformation (using possible parent transformations).

@@ Currently not very efficient!

Implements iMovable.

Definition at line 238 of file basemovable.h.

csReversibleTransform CS::Engine::BaseMovable::GetFullTransform (  )  const [inline, virtual]

Construct the full world to object transformation given this transformation and possible parents transformations.

Implements iMovable.

Definition at line 267 of file basemovable.h.

iLight* CS::Engine::BaseMovable::GetLight (  )  const [inline]

Get the light on which we operate.

Definition at line 149 of file basemovable.h.

iMeshWrapper* CS::Engine::BaseMovable::GetMeshWrapper (  )  const [inline]

Get the meshobject on which we operate.

Definition at line 134 of file basemovable.h.

BaseMovable* CS::Engine::BaseMovable::GetParent (  )  const [inline]

Get the parent movable.

Definition at line 173 of file basemovable.h.

const csVector3& CS::Engine::BaseMovable::GetPosition (  )  const [inline, virtual]

Get the current local position.

Implements iMovable.

Definition at line 231 of file basemovable.h.

virtual iSceneNode* CS::Engine::BaseMovable::GetSceneNode (  )  [virtual]

Get the scene node that this movable belongs too.

Implements iMovable.

iSectorList* CS::Engine::BaseMovable::GetSectors (  )  [inline, virtual]

Get list of sectors for this entity.

This will return the sectors of the parent if there is a parent.

Implements iMovable.

Definition at line 198 of file basemovable.h.

const csReversibleTransform& CS::Engine::BaseMovable::GetTransform (  )  const [inline]

Get the local world to object transformation.

Definition at line 261 of file basemovable.h.

csReversibleTransform& CS::Engine::BaseMovable::GetTransform (  )  [inline, virtual]

Get the local world to object tranformation.

Implements iMovable.

Definition at line 256 of file basemovable.h.

long CS::Engine::BaseMovable::GetUpdateNumber (  )  const [inline, virtual]

A number which indicates if the movable has been updated.

One can use this number to see if the position of the object has changed since the last time it was checked.

Implements iMovable.

Definition at line 320 of file basemovable.h.

bool CS::Engine::BaseMovable::InSector (  )  const [inline, virtual]

Return true if we are placed in a sector.

Implements iMovable.

Definition at line 207 of file basemovable.h.

bool CS::Engine::BaseMovable::IsFullTransformIdentity (  )  const [inline, virtual]

Return true if the movable transformation is an identity transformation and the (optional) parent of this movable also is has identity transformation.

Only in this case can you know that the object has the same object space coordinates as world space coordinates. Basically this function will return true if GetFullTransform() would return the identity transform.

Implements iMovable.

Definition at line 326 of file basemovable.h.

bool CS::Engine::BaseMovable::IsTransformIdentity (  )  const [inline, virtual]

This function returns true if the movable transformation is an identity transformation.

As soon as the object is moved this function will return false. You can use 'TransformIdentity()' to go back to the identity transform which will again let this flag return true. Note that this flag is only relevant for the transform of this movable and doesn't look at the transforms of the parents. Use IsFullTransformIdentity() for that.

The engine and visibility cullers can use this information to optimize stuff a bit.

This function ignores the hierarchical transformation this movable may be part off. If part of a hierarchical transformation this function will only test the local transform for identity.

Implements iMovable.

Definition at line 322 of file basemovable.h.

void CS::Engine::BaseMovable::MovePosition ( const csVector3 v  )  [virtual]

Relative move.

Implements iMovable.

void CS::Engine::BaseMovable::RemoveListener ( iMovableListener listener  )  [virtual]

Remove a listener from this movable.

Implements iMovable.

void CS::Engine::BaseMovable::SetCamera ( iCamera obj  )  [inline]

Set camera on which this movable operates.

Definition at line 155 of file basemovable.h.

virtual void CS::Engine::BaseMovable::SetFullPosition ( const csVector3 v  )  [virtual]

Set the transformation vector.

Implements iMovable.

virtual void CS::Engine::BaseMovable::SetFullTransform ( const csReversibleTransform t  )  [virtual]

Set the world to object transformation.

Implements iMovable.

void CS::Engine::BaseMovable::SetLight ( iLight obj  )  [inline]

Set light on which this movable operates.

Definition at line 143 of file basemovable.h.

void CS::Engine::BaseMovable::SetMeshWrapper ( iMeshWrapper obj  )  [inline]

Set meshobject on which this movable operates.

Definition at line 128 of file basemovable.h.

void CS::Engine::BaseMovable::SetParent ( BaseMovable par  )  [inline]

Set the parent movable.

Definition at line 167 of file basemovable.h.

void CS::Engine::BaseMovable::SetPosition ( const csVector3 v  )  [inline, virtual]

Set the transformation vector for this object.

Note that the sectors are unchanged.

Implements iMovable.

Definition at line 223 of file basemovable.h.

void CS::Engine::BaseMovable::SetPosition ( iSector home,
const csVector3 v 
) [virtual]

Set the transformation vector and sector to move to some position.

Implements iMovable.

void CS::Engine::BaseMovable::SetSector ( iSector sector  )  [virtual]

Initialize the list of sectors to one sector where this thing is.

This is a convenience funcion. This function does not do anything if the parent is not 0.

Implements iMovable.

void CS::Engine::BaseMovable::SetTransform ( const csReversibleTransform t  )  [inline, virtual]

Set the local world to object tranformation.

Implements iMovable.

Definition at line 251 of file basemovable.h.

void CS::Engine::BaseMovable::SetTransform ( const csMatrix3 matrix  )  [virtual]

Set the transformation matrix for this entity.

Implements iMovable.

void CS::Engine::BaseMovable::Transform ( const csMatrix3 matrix  )  [virtual]

Relative transform.

Implements iMovable.

void CS::Engine::BaseMovable::TransformIdentity (  )  [inline, virtual]

Set the transform of this movable to the identity transform (ie not moving at all).

You have to call UpdateMove() after calling this.

This function ignores the hierarchical transformation this movable may be part off. If part of a hierarchical transformation this function will only set the local transform to identity.

Implements iMovable.

Definition at line 333 of file basemovable.h.

void CS::Engine::BaseMovable::UpdateMove (  )  [virtual]

After all movement has been done you need to call UpdateMove() to make the final changes to the entity that is controlled by this movable.

This is very important!

Implements iMovable.


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

Generated for Crystal Space 2.1 by doxygen 1.6.1