~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h

  • Committer: Reinhard Tartler
  • Date: 2014-05-31 01:50:05 UTC
  • mfrom: (14.2.27 sid)
  • Revision ID: siretart@tauware.de-20140531015005-ml6druahuj82nsav
mergeĀ fromĀ debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
class PHY_IPhysicsEnvironment
106
106
{
107
107
        public:
108
 
                virtual         ~PHY_IPhysicsEnvironment(){};
109
 
                virtual void            beginFrame() = 0;
110
 
                virtual void            endFrame() = 0;
 
108
                virtual         ~PHY_IPhysicsEnvironment(){}
 
109
                virtual void            BeginFrame() = 0;
 
110
                virtual void            EndFrame() = 0;
111
111
                /// Perform an integration step of duration 'timeStep'.
112
 
                virtual bool            proceedDeltaTime(double curTime,float timeStep,float interval)=0;
 
112
                virtual bool            ProceedDeltaTime(double curTime,float timeStep,float interval)=0;
113
113
                ///draw debug lines (make sure to call this during the render phase, otherwise lines are not drawn properly)
114
 
                virtual void            debugDrawWorld() {}
115
 
                virtual void            setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep)=0;
 
114
                virtual void            DebugDrawWorld() {}
 
115
                virtual void            SetFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep)=0;
116
116
                //returns 0.f if no fixed timestep is used
117
 
                virtual float           getFixedTimeStep()=0;
 
117
                virtual float           GetFixedTimeStep()=0;
118
118
 
119
119
                ///setDebugMode is used to support several ways of debug lines, contact point visualization
120
 
                virtual void            setDebugMode(int debugMode) {}
 
120
                virtual void            SetDebugMode(int debugMode) {}
121
121
                ///setNumIterations set the number of iterations for iterative solvers
122
 
                virtual void            setNumIterations(int numIter) {}
 
122
                virtual void            SetNumIterations(int numIter) {}
123
123
                ///setNumTimeSubSteps set the number of divisions of the timestep. Tradeoff quality versus performance.
124
 
                virtual void            setNumTimeSubSteps(int numTimeSubSteps) {}
 
124
                virtual void            SetNumTimeSubSteps(int numTimeSubSteps) {}
 
125
                virtual int                     GetNumTimeSubSteps() {return 0; }
125
126
                ///setDeactivationTime sets the minimum time that an objects has to stay within the velocity tresholds until it gets fully deactivated
126
 
                virtual void            setDeactivationTime(float dTime) {}
 
127
                virtual void            SetDeactivationTime(float dTime) {}
127
128
                ///setDeactivationLinearTreshold sets the linear velocity treshold, see setDeactivationTime
128
 
                virtual void            setDeactivationLinearTreshold(float linTresh) {}
 
129
                virtual void            SetDeactivationLinearTreshold(float linTresh) {}
129
130
                ///setDeactivationAngularTreshold sets the angular velocity treshold, see setDeactivationTime
130
 
                virtual void            setDeactivationAngularTreshold(float angTresh) {}
 
131
                virtual void            SetDeactivationAngularTreshold(float angTresh) {}
131
132
                ///setContactBreakingTreshold sets tresholds to do with contact point management
132
 
                virtual void            setContactBreakingTreshold(float contactBreakingTreshold) {}
 
133
                virtual void            SetContactBreakingTreshold(float contactBreakingTreshold) {}
133
134
                ///continuous collision detection mode, very experimental for Bullet
134
 
                virtual void            setCcdMode(int ccdMode) {}
 
135
                virtual void            SetCcdMode(int ccdMode) {}
135
136
                ///successive overrelaxation constant, in case PSOR is used, values in between 1 and 2 guarantee converging behavior
136
 
                virtual void            setSolverSorConstant(float sor) {}
 
137
                virtual void            SetSolverSorConstant(float sor) {}
137
138
                ///setSolverType, internal setting, chooses solvertype, PSOR, Dantzig, impulse based, penalty based
138
 
                virtual void            setSolverType(int solverType) {}
 
139
                virtual void            SetSolverType(int solverType) {}
139
140
                ///setTau sets the spring constant of a penalty based solver
140
 
                virtual void            setSolverTau(float tau) {}
 
141
                virtual void            SetSolverTau(float tau) {}
141
142
                ///setDamping sets the damper constant of a penalty based solver
142
 
                virtual void            setSolverDamping(float damping) {}
 
143
                virtual void            SetSolverDamping(float damping) {}
143
144
                ///linear air damping for rigidbodies
144
 
                virtual void            setLinearAirDamping(float damping) {}
 
145
                virtual void            SetLinearAirDamping(float damping) {}
145
146
                /// penetrationdepth setting
146
 
                virtual void            setUseEpa(bool epa) {}
147
 
 
148
 
                virtual void            setGravity(float x,float y,float z)=0;
149
 
                virtual void            getGravity(MT_Vector3& grav) = 0;
150
 
 
151
 
                virtual int                     createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type,
 
147
                virtual void            SetUseEpa(bool epa) {}
 
148
 
 
149
                virtual void            SetGravity(float x,float y,float z)=0;
 
150
                virtual void            GetGravity(MT_Vector3& grav) = 0;
 
151
 
 
152
                virtual int                     CreateConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type,
152
153
                        float pivotX,float pivotY,float pivotZ,
153
154
                        float axis0X,float axis0Y,float axis0Z,
154
155
                        float axis1X=0,float axis1Y=0,float axis1Z=0,
155
156
                        float axis2X=0,float axis2Y=0,float axis2Z=0,int flag=0
156
157
                )=0;
157
 
                virtual void            removeConstraint(int    constraintid)=0;
158
 
                virtual float           getAppliedImpulse(int   constraintid) { return 0.0f; }
 
158
                virtual void            RemoveConstraint(int    constraintid)=0;
 
159
                virtual float           GetAppliedImpulse(int   constraintid) { return 0.0f; }
159
160
 
160
161
 
161
162
                //complex constraint for vehicles
162
 
                virtual PHY_IVehicle*   getVehicleConstraint(int constraintId) =0;
 
163
                virtual PHY_IVehicle*   GetVehicleConstraint(int constraintId) =0;
163
164
 
164
165
                // Character physics wrapper
165
 
                virtual PHY_ICharacter* getCharacterController(class KX_GameObject* ob) =0;
 
166
                virtual PHY_ICharacter* GetCharacterController(class KX_GameObject* ob) =0;
166
167
 
167
 
                virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ)=0;
 
168
                virtual PHY_IPhysicsController* RayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ)=0;
168
169
 
169
170
                //culling based on physical broad phase
170
171
                // the plane number must be set as follow: near, far, left, right, top, botton
171
172
                // the near plane must be the first one and must always be present, it is used to get the direction of the view
172
 
                virtual bool cullingTest(PHY_CullingCallback callback, void *userData, MT_Vector4* planeNormals, int planeNumber, int occlusionRes, const int *viewport, double modelview[16], double projection[16]) = 0;
 
173
                virtual bool CullingTest(PHY_CullingCallback callback, void *userData, MT_Vector4* planeNormals, int planeNumber, int occlusionRes, const int *viewport, double modelview[16], double projection[16]) = 0;
173
174
 
174
175
                //Methods for gamelogic collision/physics callbacks
175
176
                //todo:
176
 
                virtual void addSensor(PHY_IPhysicsController* ctrl)=0;
177
 
                virtual void removeSensor(PHY_IPhysicsController* ctrl)=0;
178
 
                virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user)=0;
179
 
                virtual bool requestCollisionCallback(PHY_IPhysicsController* ctrl)=0;
180
 
                virtual bool removeCollisionCallback(PHY_IPhysicsController* ctrl)=0;
 
177
                virtual void AddSensor(PHY_IPhysicsController* ctrl)=0;
 
178
                virtual void RemoveSensor(PHY_IPhysicsController* ctrl)=0;
 
179
                virtual void AddTouchCallback(int response_class, PHY_ResponseCallback callback, void *user)=0;
 
180
                virtual bool RequestCollisionCallback(PHY_IPhysicsController* ctrl)=0;
 
181
                virtual bool RemoveCollisionCallback(PHY_IPhysicsController* ctrl)=0;
181
182
                //These two methods are *solely* used to create controllers for sensor! Don't use for anything else
182
183
                virtual PHY_IPhysicsController* CreateSphereController(float radius,const MT_Vector3& position) =0;
183
184
                virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight)=0;
184
185
                
185
 
                virtual void    setConstraintParam(int constraintId,int param,float value,float value1) = 0;
186
 
                virtual float   getConstraintParam(int constraintId,int param) = 0;
 
186
                virtual void    SetConstraintParam(int constraintId,int param,float value,float value1) = 0;
 
187
                virtual float   GetConstraintParam(int constraintId,int param) = 0;
187
188
                
188
 
                virtual void    exportFile(const char* filename) {};
 
189
                virtual void    ExportFile(const char* filename) {};
189
190
 
190
191
 
191
192
#ifdef WITH_CXX_GUARDEDALLOC