Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

Movement Class Reference

#include <movement.h>

Inheritance diagram for Movement:

Vehicle List of all members.

Public Member Functions

virtual const bool Move ()=0
virtual void Start ()=0
void SetPath (vector< Destination > newPath)
const OPENCITY_GRAPHIC_CODE & GetGraphicCode () const
void SetAngle (const Destination &rcD)
void SetSlope (const Destination &rcA, const Destination &rcB)

Public Attributes

OC_FLOAT _fCurrentW
 current OC W, L, H coordinates
OC_FLOAT _fCurrentL
OC_FLOAT _fCurrentH
 W, L, H variations for next destination.
GLfloat _fRY
 The model's rotation angle.
GLfloat _fRX
GLfloat _fRZ
 The model's X and Z rotation slope.
GLfloat _fTX
GLfloat _fTY
GLfloat _fTZ
 The rotation compensation translation vector.

Protected Attributes

 Last vehicle direction. According to the graphic code convention, it's OC_DIR_S by default.
 Vehicle's graphic code.
uint uiCurrentTime
 current number of times that we've moved so far into the current direction
int iCurrentSpeed
uint uiNumberOfFrame
 Number of frames counted till now.
uint uiFramePerUnit
 Number of frames to count before going to next W/H coordinates.
vector< Destinationvdest
 this contains a path that this movement follows
uint uiCurrentIndex
 point to the current destination
Destination destCurrent
 current copy of vdest[ uiCurrentIndex ]

Detailed Description

This is a base class for everything that can move in OpenCity. It contains general informations about the current OC W, H coordinates of the moving (or not) object and a path which is a vector of "Destination" objects

Definition at line 36 of file movement.h.

Member Function Documentation

virtual const bool Movement::Move  )  [pure virtual]

Tell the object to move

True if the object has moved successfully, false otherwise

Implemented in Vehicle.

void Movement::SetAngle const Destination rcD  ) 

Set the rotation of the model according to the destination's direction. This method also sets the compensation translation vector in order to help the GraphicManager render method to make a "in place" rotation

rcD The destination object
See also:

Definition at line 60 of file movement.cpp.

References Destination::_eDir, _eDir, _fRY, and _fTZ.

void Movement::SetSlope const Destination rcA,
const Destination rcB

Set the slope of the model. It shoulds be called after a call to SetAngle()

See also:


Definition at line 99 of file movement.cpp.

References _eDir, _fRZ, Destination::_iHMax, and Destination::_iHMin.

virtual void Movement::Start  )  [pure virtual]

Initialize the movement. It should be called before any call to the Move() method

See also:

Implemented in Vehicle.

The documentation for this class was generated from the following files:
Generated on Sat Nov 11 10:21:11 2006 for OpenCity by  doxygen 1.4.2