~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
#include "PHY_IPhysicsEnvironment.h"
20
20
#include <vector>
 
21
#include <set>
21
22
class CcdPhysicsController;
22
23
#include "LinearMath/btVector3.h"
23
24
#include "LinearMath/btTransform.h"
55
56
 
56
57
protected:
57
58
        btIDebugDraw*   m_debugDrawer;
 
59
        
 
60
        class btDefaultCollisionConfiguration* m_collisionConfiguration;
 
61
        class btBroadphaseInterface*                    m_broadphase;
 
62
 
58
63
        //solver iterations
59
64
        int     m_numIterations;
60
65
        
69
74
 
70
75
        btContactSolverInfo     m_solverInfo;
71
76
        
 
77
        void    processFhSprings(double curTime,float timeStep);
72
78
 
73
79
        public:
74
80
                CcdPhysicsEnvironment(btDispatcher* dispatcher=0, btOverlappingPairCache* pairCache=0);
114
120
                virtual void            setDebugMode(int debugMode);
115
121
 
116
122
                virtual void            setGravity(float x,float y,float z);
 
123
                virtual void            getGravity(PHY__Vector3& grav);
 
124
 
117
125
 
118
126
                virtual int                     createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type,
119
127
                        float pivotX,float pivotY,float pivotZ,
120
128
                        float axisX,float axisY,float axisZ,
121
129
                        float axis1X=0,float axis1Y=0,float axis1Z=0,
122
 
                        float axis2X=0,float axis2Y=0,float axis2Z=0
 
130
                        float axis2X=0,float axis2Y=0,float axis2Z=0,int flag=0
123
131
                        );
124
132
 
125
133
 
131
139
                        const btVector3& linearMinLimits,
132
140
                        const btVector3& linearMaxLimits,
133
141
                        const btVector3& angularMinLimits,
134
 
                        const btVector3& angularMaxLimits
 
142
                        const btVector3& angularMaxLimits,int flags
135
143
                        );
136
144
 
137
145
                virtual void    setConstraintParam(int constraintId,int param,float value,float value1);
156
164
 
157
165
                btTypedConstraint*      getConstraintById(int constraintId);
158
166
 
159
 
                virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ, 
160
 
                                                                                float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ);
 
167
                virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ);
161
168
 
162
169
 
163
170
                //Methods for gamelogic collision/physics callbacks
183
190
 
184
191
                void    removeCcdPhysicsController(CcdPhysicsController* ctrl);
185
192
 
 
193
                void    updateCcdPhysicsController(CcdPhysicsController* ctrl, btScalar newMass, int newCollisionFlags, short int newCollisionGroup, short int newCollisionMask);
 
194
 
 
195
                void    disableCcdPhysicsController(CcdPhysicsController* ctrl);
 
196
 
 
197
                void    enableCcdPhysicsController(CcdPhysicsController* ctrl);
 
198
 
186
199
                btBroadphaseInterface*  getBroadphase();
187
200
 
188
 
                
189
 
                
 
201
                btDispatcher*   getDispatcher();
190
202
                
191
203
 
192
204
                bool    IsSatCollisionDetectionEnabled() const
200
212
                }
201
213
 
202
214
        
203
 
                int     GetNumControllers();
204
 
 
205
 
                CcdPhysicsController* GetPhysicsController( int index);
206
 
 
207
 
                
208
 
 
209
215
                const btPersistentManifold*     GetManifold(int index) const;
210
216
 
211
217
        
212
218
                void    SyncMotionStates(float timeStep);
213
219
 
214
 
                
 
220
                class   btSoftRigidDynamicsWorld*       getDynamicsWorld()
 
221
                {
 
222
                        return m_dynamicsWorld;
 
223
                }
215
224
        
216
225
                class btConstraintSolver*       GetConstraintSolver();
217
226
 
220
229
                
221
230
 
222
231
                
223
 
                std::vector<CcdPhysicsController*> m_controllers;
 
232
                std::set<CcdPhysicsController*> m_controllers;
224
233
                
225
 
                std::vector<CcdPhysicsController*> m_triggerControllers;
 
234
                std::set<CcdPhysicsController*> m_triggerControllers;
226
235
 
227
236
                PHY_ResponseCallback    m_triggerCallbacks[PHY_NUM_RESPONSE];
228
237
                void*                   m_triggerCallbacksUserPtrs[PHY_NUM_RESPONSE];
229
238
                
230
239
                std::vector<WrapperVehicle*>    m_wrapperVehicles;
231
240
 
232
 
                //use explicit btDiscreteDynamicsWorld* so that we have access to 
 
241
                //use explicit btSoftRigidDynamicsWorld/btDiscreteDynamicsWorld* so that we have access to 
233
242
                //btDiscreteDynamicsWorld::addRigidBody(body,filter,group) 
234
243
                //so that we can set the body collision filter/group at the time of creation 
235
244
                //and not afterwards (breaks the collision system for radar/near sensor)
236
245
                //Ideally we would like to have access to this function from the btDynamicsWorld interface
237
246
                //class btDynamicsWorld*        m_dynamicsWorld;
238
 
                class   btDiscreteDynamicsWorld*        m_dynamicsWorld;
 
247
                class   btSoftRigidDynamicsWorld*       m_dynamicsWorld;
239
248
                
240
249
                class btConstraintSolver*       m_solver;
241
250