fixed the mouse-over sensor,
[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                 CcdPhysicsController::applyImpulse(attach[0],attach[1],attach[2],impulse[0],impulse[1],impulse[2]);
36
37 }
38
39 void    KX_BulletPhysicsController::SetObject (SG_IObject* object)
40 {
41 }
42
43 void    KX_BulletPhysicsController::RelativeTranslate(const MT_Vector3& dloc,bool local)
44 {
45         CcdPhysicsController::RelativeTranslate(dloc[0],dloc[1],dloc[2],local);
46
47 }
48 void    KX_BulletPhysicsController::RelativeRotate(const MT_Matrix3x3& drot,bool local)
49 {
50 }
51 void    KX_BulletPhysicsController::ApplyTorque(const MT_Vector3& torque,bool local)
52 {
53 }
54 void    KX_BulletPhysicsController::ApplyForce(const MT_Vector3& force,bool local)
55 {
56 }
57 MT_Vector3 KX_BulletPhysicsController::GetLinearVelocity()
58 {
59         assert(0);
60         return MT_Vector3(0.f,0.f,0.f);
61
62 }
63 MT_Vector3 KX_BulletPhysicsController::GetVelocity(const MT_Point3& pos)
64 {
65                 assert(0);
66         return MT_Vector3(0.f,0.f,0.f);
67
68 }
69 void    KX_BulletPhysicsController::SetAngularVelocity(const MT_Vector3& ang_vel,bool local)
70 {
71         CcdPhysicsController::SetAngularVelocity(ang_vel.x(),ang_vel.y(),ang_vel.z(),local);
72
73 }
74 void    KX_BulletPhysicsController::SetLinearVelocity(const MT_Vector3& lin_vel,bool local)
75 {
76         CcdPhysicsController::SetLinearVelocity(lin_vel.x(),lin_vel.y(),lin_vel.z(),local);
77 }
78 void    KX_BulletPhysicsController::getOrientation(MT_Quaternion& orn)
79 {
80 }
81 void KX_BulletPhysicsController::setOrientation(const MT_Quaternion& orn)
82 {
83 }
84 void KX_BulletPhysicsController::setPosition(const MT_Point3& pos)
85 {
86
87 }
88 void KX_BulletPhysicsController::setScaling(const MT_Vector3& scaling)
89 {
90 }
91 MT_Scalar       KX_BulletPhysicsController::GetMass()
92 {
93
94         MT_Scalar invmass = GetRigidBody()->getInvMass();
95         if (invmass)
96                 return 1.f/invmass;
97         return 0.f;
98
99 }
100 MT_Vector3      KX_BulletPhysicsController::getReactionForce()
101 {
102         assert(0);
103         return MT_Vector3(0.f,0.f,0.f);
104 }
105 void    KX_BulletPhysicsController::setRigidBody(bool rigid)
106 {
107 }
108
109 void    KX_BulletPhysicsController::SuspendDynamics()
110 {
111 }
112 void    KX_BulletPhysicsController::RestoreDynamics()
113 {
114 }
115
116 SG_Controller*  KX_BulletPhysicsController::GetReplica(class SG_Node* destnode)
117 {
118         assert(0);
119         return 0;
120 }
121
122
123
124 void    KX_BulletPhysicsController::SetSumoTransform(bool nondynaonly)
125 {
126 }
127
128 // todo: remove next line !
129 void    KX_BulletPhysicsController::SetSimulatedTime(double time)
130 {
131 }
132         
133 // call from scene graph to update
134 bool KX_BulletPhysicsController::Update(double time)
135 {
136         return false;
137
138         // todo: check this code
139         //if (GetMass())
140         //{
141         //      return false;//true;
142 //      }
143 //      return false;
144 }
145
146 #endif //#ifdef USE_BULLET