Google

Main Page   Class Hierarchy   Compound List   File List   Compound 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.

virtual ~csMovable ()
 Destructor.

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

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

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

iMovableGetParent () const
 Get the parent movable.

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.

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

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

const csVector3GetPosition () const
 Get the current local position.

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.

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

csReversibleTransformGetTransform ()
 Get the local world to object tranformation.

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

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

void MovePosition (const csVector3 &v)
 Relative move.

void Transform (const csMatrix3 &matrix)
 Relative transform.

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, void *userdata)
 Add a listener to this movable. More...

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

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


Public Attributes

 SCF_DECLARE_IBASE
csMovable::eiMovable  scfiMovable

Friends

class  eiMovable

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.


Member Function Documentation

void csMovable::AddListener ( iMovableListener * listener,
void * userdata )
 

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!

iSectorList * csMovable::GetSectors ( ) [inline]
 

Get list of sectors for this entity.

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

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.

void csMovable::SetPosition ( const csVector3 & v ) [inline]
 

Set the transformation vector for this object.

Note that the sectors are unchanged.

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::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.5 written by Dimitri van Heesch, ©1997-2000