more preparations for bullet physics, and some eol issues with SCA_Joystick*
[blender.git] / source / gameengine / Ketsji / KX_BulletPhysicsController.cpp
1 //under visual studio the #define in KX_ConvertPhysicsObject.h is quicker for recompilation
2 #include "KX_ConvertPhysicsObject.h"
3
4 #ifdef USE_BULLET
5
6 #include "KX_BulletPhysicsController.h"
7
8 #include "Dynamics/RigidBody.h"
9
10 KX_BulletPhysicsController::KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna)
11 : KX_IPhysicsController(dyna,(PHY_IPhysicsController*)this),
12 CcdPhysicsController(ci)
13 {
14
15 }
16         
17 KX_BulletPhysicsController::~KX_BulletPhysicsController ()
18 {
19
20 }
21
22 void    KX_BulletPhysicsController::resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ)
23 {
24         CcdPhysicsController::resolveCombinedVelocities(linvelX,linvelY,linvelZ,angVelX,angVelY,angVelZ);
25
26 }
27
28
29         ///////////////////////////////////
30         //      KX_IPhysicsController interface
31         ////////////////////////////////////
32
33 void    KX_BulletPhysicsController::applyImpulse(const MT_Point3& attach, const MT_Vector3& impulse)
34 {
35 }
36
37 void    KX_BulletPhysicsController::SetObject (SG_IObject* object)
38 {
39 }
40
41 void    KX_BulletPhysicsController::RelativeTranslate(const MT_Vector3& dloc,bool local)
42 {
43         CcdPhysicsController::RelativeTranslate(dloc[0],dloc[1],dloc[2],local);
44
45 }
46 void    KX_BulletPhysicsController::RelativeRotate(const MT_Matrix3x3& drot,bool local)
47 {
48 }
49 void    KX_BulletPhysicsController::ApplyTorque(const MT_Vector3& torque,bool local)
50 {
51 }
52 void    KX_BulletPhysicsController::ApplyForce(const MT_Vector3& force,bool local)
53 {
54 }
55 MT_Vector3 KX_BulletPhysicsController::GetLinearVelocity()
56 {
57         assert(0);
58         return MT_Vector3(0.f,0.f,0.f);
59
60 }
61 MT_Vector3 KX_BulletPhysicsController::GetVelocity(const MT_Point3& pos)
62 {
63                 assert(0);
64         return MT_Vector3(0.f,0.f,0.f);
65
66 }
67 void    KX_BulletPhysicsController::SetAngularVelocity(const MT_Vector3& ang_vel,bool local)
68 {
69         CcdPhysicsController::SetAngularVelocity(ang_vel.x(),ang_vel.y(),ang_vel.z(),local);
70
71 }
72 void    KX_BulletPhysicsController::SetLinearVelocity(const MT_Vector3& lin_vel,bool local)
73 {
74         CcdPhysicsController::SetLinearVelocity(lin_vel.x(),lin_vel.y(),lin_vel.z(),local);
75 }
76 void    KX_BulletPhysicsController::getOrientation(MT_Quaternion& orn)
77 {
78 }
79 void KX_BulletPhysicsController::setOrientation(const MT_Quaternion& orn)
80 {
81 }
82 void KX_BulletPhysicsController::setPosition(const MT_Point3& pos)
83 {
84
85 }
86 void KX_BulletPhysicsController::setScaling(const MT_Vector3& scaling)
87 {
88 }
89 MT_Scalar       KX_BulletPhysicsController::GetMass()
90 {
91
92         MT_Scalar invmass = GetRigidBody()->getInvMass();
93         if (invmass)
94                 return 1.f/invmass;
95         return 0.f;
96
97 }
98 MT_Vector3      KX_BulletPhysicsController::getReactionForce()
99 {
100         assert(0);
101         return MT_Vector3(0.f,0.f,0.f);
102 }
103 void    KX_BulletPhysicsController::setRigidBody(bool rigid)
104 {
105 }
106
107 void    KX_BulletPhysicsController::SuspendDynamics()
108 {
109 }
110 void    KX_BulletPhysicsController::RestoreDynamics()
111 {
112 }
113
114 SG_Controller*  KX_BulletPhysicsController::GetReplica(class SG_Node* destnode)
115 {
116         assert(0);
117         return 0;
118 }
119
120
121
122 void    KX_BulletPhysicsController::SetSumoTransform(bool nondynaonly)
123 {
124 }
125
126 // todo: remove next line !
127 void    KX_BulletPhysicsController::SetSimulatedTime(double time)
128 {
129 }
130         
131 // call from scene graph to update
132 bool KX_BulletPhysicsController::Update(double time)
133 {
134         return false;
135
136         // todo: check this code
137         //if (GetMass())
138         //{
139         //      return false;//true;
140 //      }
141 //      return false;
142 }
143
144 #endif //#ifdef USE_BULLET