CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

csMovable Class Reference

This class represents an entity that can move in the engine. More...

#include <movable.h>

Inheritance diagram for csMovable:

iBase List of all members.

Public Methods

 csMovable ()
 Create a default movable. More...

virtual ~csMovable ()
 Destructor. More...

void SetMeshWrapper (csMeshWrapper *obj)
 Set mesh on which this movable operates. More...

csMeshWrapperGetMeshWrapper ()
 Get the mesh wrapper on which we operate. More...

void SetParent (iMovable *par)
 Set the parent movable. More...

iMovableGetParent () const
 Get the parent movable. More...

void SetSector (iSector *sector)
 Initialize the list of sectors to one sector where this thing is. More...

void ClearSectors ()
 Clear the list of sectors. More...

iSectorListGetSectors ()
 Get list of sectors for this entity. More...

bool InSector () const
 Return true if we are placed in a sector. More...

void SetPosition (iSector *home, const csVector3 &v)
 Set the transformation vector and sector to move to some position. More...

void SetPosition (const csVector3 &v)
 Set the transformation vector for this object. More...

const csVector3GetPosition () const
 Get the current local position. More...

const csVector3 GetFullPosition () const
 Get the current position using the full transformation (using possible parent transformations). More...

void SetTransform (const csMatrix3 &matrix)
 Set the transformation matrix for this entity. More...

void SetTransform (const csReversibleTransform &t)
 Set the local world to object tranformation. More...

csReversibleTransformGetTransform ()
 Get the local world to object tranformation. More...

const csReversibleTransformGetTransform () const
 Get the local world to object tranformation. More...

csReversibleTransform GetFullTransform () const
 Construct the full world to object transformation given this transformation and possible parents transformations. More...

void MovePosition (const csVector3 &v)
 Relative move. More...

void Transform (const csMatrix3 &matrix)
 Relative transform. More...

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. More...

void AddListener (iMovableListener *listener)
 Add a listener to this movable. More...

void RemoveListener (iMovableListener *listener)
 Remove a listener from this movable. More...

long GetUpdateNumber () const
 A number which indicates if the movable has been updated. More...


Detailed Description

This class represents an entity that can move in the engine.

It has a list of sectors and a position (a list of sectors because an entity can overlap several sectors at the same time through portals). This class itself does not have geometry. It is only responsible for managing movement.

Definition at line 70 of file csengine/movable.h.


Constructor & Destructor Documentation

csMovable::csMovable  
 

Create a default movable.

virtual csMovable::~csMovable   [virtual]
 

Destructor.


Member Function Documentation

void csMovable::AddListener iMovableListener   listener
 

Add a listener to this movable.

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

void csMovable::ClearSectors  
 

Clear the list of sectors.

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

const csVector3 csMovable::GetFullPosition   const [inline]
 

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

@@ Currently not very efficient!

Definition at line 181 of file csengine/movable.h.

References GetFullTransform, and csTransform::GetOrigin.

csReversibleTransform csMovable::GetFullTransform   const
 

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

Referenced by GetFullPosition.

csMeshWrapper* csMovable::GetMeshWrapper   [inline]
 

Get the mesh wrapper on which we operate.

Definition at line 113 of file csengine/movable.h.

iMovable* csMovable::GetParent   const [inline]
 

Get the parent movable.

Definition at line 121 of file csengine/movable.h.

const csVector3& csMovable::GetPosition   const [inline]
 

Get the current local position.

Definition at line 174 of file csengine/movable.h.

References csTransform::GetOrigin.

iSectorList* csMovable::GetSectors   [inline]
 

Get list of sectors for this entity.

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

Definition at line 142 of file csengine/movable.h.

References iMovable::GetSectors, and csMovableSectorList::scfiSectorList.

const csReversibleTransform& csMovable::GetTransform   const [inline]
 

Get the local world to object tranformation.

Definition at line 204 of file csengine/movable.h.

csReversibleTransform& csMovable::GetTransform   [inline]
 

Get the local world to object tranformation.

Definition at line 199 of file csengine/movable.h.

long csMovable::GetUpdateNumber   const [inline]
 

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.

Definition at line 245 of file csengine/movable.h.

bool csMovable::InSector   const [inline]
 

Return true if we are placed in a sector.

Definition at line 151 of file csengine/movable.h.

References csRefArray< iSector >::Length.

void csMovable::MovePosition const csVector3   v
 

Relative move.

void csMovable::RemoveListener iMovableListener   listener
 

Remove a listener from this movable.

void csMovable::SetMeshWrapper csMeshWrapper   obj [inline]
 

Set mesh on which this movable operates.

Definition at line 109 of file csengine/movable.h.

void csMovable::SetParent iMovable   par [inline]
 

Set the parent movable.

Definition at line 117 of file csengine/movable.h.

void csMovable::SetPosition const csVector3   v [inline]
 

Set the transformation vector for this object.

Note that the sectors are unchanged.

Definition at line 166 of file csengine/movable.h.

References csTransform::SetOrigin.

void csMovable::SetPosition iSector   home,
const csVector3   v
 

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

void csMovable::SetSector iSector   sector
 

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

This is a conveniance funcion. This function does not do anything if the parent is not NULL.

void csMovable::SetTransform const csReversibleTransform   t [inline]
 

Set the local world to object tranformation.

Definition at line 194 of file csengine/movable.h.

void csMovable::SetTransform const csMatrix3   matrix
 

Set the transformation matrix for this entity.

void csMovable::Transform const csMatrix3   matrix
 

Relative transform.

void csMovable::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.

This is very important!


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14