Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CarEngine Class Reference
Inheritance diagram for CarEngine:
vtEngine vtEnabledBase

Public Member Functions

 CarEngine (Vehicle *vehicle, vtHeightField3d *hf)
 
bool Valid ()
 
void Eval ()
 
void IgnoreElapsedTime ()
 
FPoint3 GetCurPos ()
 
void SetEarthPos (const DPoint2 &pos)
 
DPoint2 GetEarthPos ()
 
void SetSpeed (float fMeterPerSec)
 
void SetRotation (float fRot)
 
float GetRotation ()
 
void SetSteeringAngle (float fRadians)
 
void SetFriction (float factor)
 
void SetCameraFollow (bool bOn)
 
void SetCameraDistance (float fMeters)
 
- Public Member Functions inherited from vtEngine
osg::Referenced * GetTarget (uint which=0)
 
void AddTarget (osg::Referenced *ptr)
 
void SetTarget (osg::Referenced *ptr)
 
void RemoveTarget (osg::Referenced *ptr)
 
uint NumTargets ()
 Return the number of targets for this engine.
 
void setName (const char *str)
 
const char * getName ()
 
virtual void OnMouse (vtMouseEvent &event)
 Virtual handler, to catch mouse events, can be overridden by your engine class.
 
virtual void OnKey (int key, int flags)
 Virtual handler, to catch keyboard events, can be overridden by your engine class.
 
virtual void OnWindowSize (int width, int height)
 Virtual handler, to catch resize events, can be overridden by your engine class.
 
void SetWindow (vtWindow *pWin)
 
vtWindowGetWindow ()
 
void AddChild (vtEngine *pEngine)
 
void RemoveChild (vtEngine *pEngine)
 
vtEngineGetChild (uint i)
 
uint NumChildren ()
 
void AddChildrenToList (vtArray< vtEngine * > &list, bool bEnabledOnly)
 
- Public Member Functions inherited from vtEnabledBase
virtual void SetEnabled (bool bOn)
 
bool GetEnabled ()
 

Protected Member Functions

void ApplyCurrentLocation (bool bAlignOnGround)
 
float SetPitch ()
 
void MoveCarTo (const FPoint3 &pos)
 
void SpinWheels (float radians)
 
vtTransformFrontLeft ()
 
vtTransformFrontRight ()
 
vtTransformRearLeft ()
 
vtTransformRearRight ()
 

Protected Attributes

vtHeightField3dm_pHeightField
 
CarEngineMode m_eMode
 
FPoint3 m_vCurPos
 
float m_fCurRotation
 
float m_fCurPitch
 
FPoint3 m_vAxis
 
float m_fSpeed
 
float m_fTargetSpeed
 
float m_fPrevTime
 
float m_fSteeringAngle
 
float m_fFriction
 
bool m_bFirstTime
 
bool m_bCameraFollow
 
float m_bCameraDistance
 
Vehiclem_pVehicle
 
- Protected Attributes inherited from vtEngine
vtArray< osg::Referenced * > m_Targets
 
std::vector< vtEnginePtr > m_Children
 
vtString m_strName
 
vtWindowm_pWindow
 
- Protected Attributes inherited from vtEnabledBase
bool m_bEnabled
 

Constructor & Destructor Documentation

CarEngine::CarEngine ( Vehicle vehicle,
vtHeightField3d hf 
)

Setup engine to drive freely.

Parameters
vehicleThe vehicle this engine will control.
hfThe surface to drive on.

Member Function Documentation

void CarEngine::Eval ( )
virtual

Virtual handler, will be called every frame to do the work of the engine. You must override this if you want your engine to be useful.

Reimplemented from vtEngine.

void CarEngine::MoveCarTo ( const FPoint3 next_pos)
protected

Rotate (yaw) body to head toward next location, pitch it based on tire locations, and determine overall height of vehicle. Steering of wheels is done in here too.


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