Created a KX_SoftBodyDeformer for real-time soft bodies.
[blender.git] / source / gameengine / Physics / common / PHY_IVehicle.h
1 #ifndef PHY_IVEHICLE_H
2 #define PHY_IVEHICLE_H
3
4 //PHY_IVehicle provides a generic interface for (raycast based) vehicles. Mostly targetting 4 wheel cars and 2 wheel motorbikes.
5
6 class PHY_IMotionState;
7 #include "PHY_DynamicTypes.h"
8
9 class PHY_IVehicle
10 {
11 public:
12
13         virtual ~PHY_IVehicle();
14         
15         virtual void    AddWheel(
16                         PHY_IMotionState* motionState,
17                         PHY__Vector3    connectionPoint,
18                         PHY__Vector3    downDirection,
19                         PHY__Vector3    axleDirection,
20                         float   suspensionRestLength,
21                         float wheelRadius,
22                         bool hasSteering
23                 ) = 0;
24
25
26         virtual int             GetNumWheels() const = 0;
27         
28         virtual void    GetWheelPosition(int wheelIndex,float& posX,float& posY,float& posZ) const = 0;
29         virtual void    GetWheelOrientationQuaternion(int wheelIndex,float& quatX,float& quatY,float& quatZ,float& quatW) const = 0;
30         virtual float   GetWheelRotation(int wheelIndex) const = 0;
31
32         virtual int     GetUserConstraintId() const =0;
33         virtual int     GetUserConstraintType() const =0;
34
35         //some basic steering/braking/tuning/balancing (bikes)
36
37         virtual void    SetSteeringValue(float steering,int wheelIndex) = 0;
38
39         virtual void    ApplyEngineForce(float force,int wheelIndex) = 0;
40
41         virtual void    ApplyBraking(float braking,int wheelIndex) = 0;
42
43         virtual void    SetWheelFriction(float friction,int wheelIndex) = 0;
44         
45         virtual void    SetSuspensionStiffness(float suspensionStiffness,int wheelIndex) = 0;
46         
47         virtual void    SetSuspensionDamping(float suspensionStiffness,int wheelIndex) = 0;
48         
49         virtual void    SetSuspensionCompression(float suspensionStiffness,int wheelIndex) = 0;
50         
51         virtual void    SetRollInfluence(float rollInfluence,int wheelIndex) = 0;
52
53         virtual void    SetCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) =0;
54
55 };
56
57 #endif //PHY_IVEHICLE_H