Brought back the sumo physics controllers and undid game engine make file
[blender.git] / source / gameengine / Ketsji / KX_SumoPhysicsController.h
1 #ifndef __KX_SUMOPHYSICSCONTROLLER_H
2 #define __KX_SUMOPHYSICSCONTROLLER_H
3
4 #include "PHY_IPhysicsController.h"
5 #include "SM_Object.h" // for SM_Callback
6
7 /**
8         Physics Controller, a special kind of Scene Graph Transformation Controller.
9         It get's callbacks from Sumo in case a transformation change took place.
10         Each time the scene graph get's updated, the controller get's a chance
11         in the 'Update' method to reflect changed.
12 */
13
14 #include "SumoPhysicsController.h"
15 #include "KX_IPhysicsController.h"
16
17 class KX_SumoPhysicsController : public KX_IPhysicsController,  
18                                                                         public SumoPhysicsController
19
20 {
21
22
23 public:
24         KX_SumoPhysicsController(
25                 class SM_Scene* sumoScene,
26                 DT_SceneHandle solidscene,
27                 class SM_Object* sumoObj,       
28                 class PHY_IMotionState* motionstate
29                 ,bool dyna) 
30                 : SumoPhysicsController(sumoScene,solidscene,sumoObj,motionstate,dyna),
31         KX_IPhysicsController(dyna,NULL) 
32         {
33         };
34         virtual ~KX_SumoPhysicsController();
35
36         void    applyImpulse(const MT_Point3& attach, const MT_Vector3& impulse);
37         virtual void    SetObject (SG_IObject* object);
38
39         
40         void    RelativeTranslate(const MT_Vector3& dloc,bool local);
41         void    RelativeRotate(const MT_Matrix3x3& drot,bool local);
42         void    ApplyTorque(const MT_Vector3& torque,bool local);
43         void    ApplyForce(const MT_Vector3& force,bool local);
44         MT_Vector3 GetLinearVelocity();
45         MT_Vector3 GetVelocity(const MT_Point3& pos);
46         void    SetAngularVelocity(const MT_Vector3& ang_vel,bool local);
47         void    SetLinearVelocity(const MT_Vector3& lin_vel,bool local);
48
49         void    SuspendDynamics();
50         void    RestoreDynamics();
51         virtual void    getOrientation(MT_Quaternion& orn);
52         virtual void setOrientation(const MT_Quaternion& orn);
53         
54         virtual void setPosition(const MT_Point3& pos);
55         virtual void setScaling(const MT_Vector3& scaling);
56         virtual MT_Scalar       GetMass();
57         virtual MT_Vector3      getReactionForce();
58         virtual void    setRigidBody(bool rigid);
59         
60
61         virtual SG_Controller*  GetReplica(class SG_Node* destnode);
62
63         
64         void    SetSumoTransform(bool nondynaonly);
65         // todo: remove next line !
66         virtual void    SetSimulatedTime(double time);
67         
68         // call from scene graph to update
69         virtual bool Update(double time);
70
71                 void
72         SetOption(
73                 int option,
74                 int value
75         ){
76                 // intentionally empty
77         };
78
79
80 };
81
82 #endif //__KX_SUMOPHYSICSCONTROLLER_H
83