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:
|
2013-02-24 07:09:39 +00:00
|
|
|
virtual ~PHY_IVehicle(){};
|
2006-01-30 20:49:41 +00:00
|
|
|
|
|
|
|
virtual void AddWheel(
|
2006-02-13 06:28:35 +00:00
|
|
|
PHY_IMotionState* motionState,
|
2013-02-21 18:30:11 +00:00
|
|
|
MT_Vector3 connectionPoint,
|
|
|
|
MT_Vector3 downDirection,
|
|
|
|
MT_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
|
2012-06-25 09:14:37 +00:00
|
|
|
MEM_CXX_CLASS_ALLOC_FUNCS("GE:PHY_IVehicle")
|
2009-08-18 15:37:31 +00:00
|
|
|
#endif
|
2006-01-30 20:49:41 +00:00
|
|
|
};
|
|
|
|
|
2012-10-09 13:36:42 +00:00
|
|
|
#endif /* __PHY_IVEHICLE_H__ */
|