2011-02-22 12:42:55 +00:00
|
|
|
|
|
|
|
/** \file PHY_IVehicle.h
|
|
|
|
* \ingroup phys
|
|
|
|
*/
|
|
|
|
|
2012-02-23 10:41:31 +00:00
|
|
|
#ifndef __PHY_IVEHICLE_H__
|
|
|
|
#define __PHY_IVEHICLE_H__
|
2006-01-30 20:49:41 +00:00
|
|
|
|
|
|
|
//PHY_IVehicle provides a generic interface for (raycast based) vehicles. Mostly targetting 4 wheel cars and 2 wheel motorbikes.
|
|
|
|
|
|
|
|
class PHY_IMotionState;
|
|
|
|
#include "PHY_DynamicTypes.h"
|
|
|
|
|
2009-08-18 15:37:31 +00:00
|
|
|
#ifdef WITH_CXX_GUARDEDALLOC
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
#endif
|
|
|
|
|
2006-01-30 20:49:41 +00:00
|
|
|
class PHY_IVehicle
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~PHY_IVehicle();
|
|
|
|
|
|
|
|
virtual void AddWheel(
|
2006-02-13 06:28:35 +00:00
|
|
|
PHY_IMotionState* motionState,
|
|
|
|
PHY__Vector3 connectionPoint,
|
|
|
|
PHY__Vector3 downDirection,
|
|
|
|
PHY__Vector3 axleDirection,
|
2006-01-30 20:49:41 +00:00
|
|
|
float suspensionRestLength,
|
|
|
|
float wheelRadius,
|
|
|
|
bool hasSteering
|
|
|
|
) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
virtual int GetNumWheels() const = 0;
|
|
|
|
|
2006-02-13 06:28:35 +00:00
|
|
|
virtual void GetWheelPosition(int wheelIndex,float& posX,float& posY,float& posZ) const = 0;
|
|
|
|
virtual void GetWheelOrientationQuaternion(int wheelIndex,float& quatX,float& quatY,float& quatZ,float& quatW) const = 0;
|
|
|
|
virtual float GetWheelRotation(int wheelIndex) const = 0;
|
2006-01-30 20:49:41 +00:00
|
|
|
|
|
|
|
virtual int GetUserConstraintId() const =0;
|
|
|
|
virtual int GetUserConstraintType() const =0;
|
|
|
|
|
|
|
|
//some basic steering/braking/tuning/balancing (bikes)
|
|
|
|
|
2006-02-13 06:28:35 +00:00
|
|
|
virtual void SetSteeringValue(float steering,int wheelIndex) = 0;
|
|
|
|
|
|
|
|
virtual void ApplyEngineForce(float force,int wheelIndex) = 0;
|
|
|
|
|
|
|
|
virtual void ApplyBraking(float braking,int wheelIndex) = 0;
|
2006-01-30 20:49:41 +00:00
|
|
|
|
2006-02-21 07:08:23 +00:00
|
|
|
virtual void SetWheelFriction(float friction,int wheelIndex) = 0;
|
|
|
|
|
|
|
|
virtual void SetSuspensionStiffness(float suspensionStiffness,int wheelIndex) = 0;
|
|
|
|
|
|
|
|
virtual void SetSuspensionDamping(float suspensionStiffness,int wheelIndex) = 0;
|
|
|
|
|
|
|
|
virtual void SetSuspensionCompression(float suspensionStiffness,int wheelIndex) = 0;
|
|
|
|
|
|
|
|
virtual void SetRollInfluence(float rollInfluence,int wheelIndex) = 0;
|
|
|
|
|
2006-11-21 00:53:40 +00:00
|
|
|
virtual void SetCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) =0;
|
2006-02-21 07:08:23 +00:00
|
|
|
|
2009-08-18 15:37:31 +00:00
|
|
|
|
|
|
|
#ifdef WITH_CXX_GUARDEDALLOC
|
|
|
|
public:
|
2010-06-06 01:15:44 +00:00
|
|
|
void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IVehicle"); }
|
2009-08-18 15:37:31 +00:00
|
|
|
void operator delete( void *mem ) { MEM_freeN(mem); }
|
|
|
|
#endif
|
2006-01-30 20:49:41 +00:00
|
|
|
};
|
|
|
|
|
2012-02-23 10:41:31 +00:00
|
|
|
#endif //__PHY_IVEHICLE_H__
|