4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
29 #ifndef _DUMMYPHYSICSENVIRONMENT
30 #define _DUMMYPHYSICSENVIRONMENT
32 #include "PHY_IPhysicsEnvironment.h"
35 * DummyPhysicsEnvironment is an empty placeholder
36 * Alternatives are ODE,Sumo and Dynamo PhysicsEnvironments
37 * Use DummyPhysicsEnvironment as a base to integrate your own physics engine
38 * Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc.)
40 * A derived class may be able to 'construct' entities by loading and/or converting
42 class DummyPhysicsEnvironment : public PHY_IPhysicsEnvironment
46 DummyPhysicsEnvironment ();
47 virtual ~DummyPhysicsEnvironment ();
48 virtual void beginFrame();
49 virtual void endFrame();
50 // Perform an integration step of duration 'timeStep'.
51 virtual bool proceedDeltaTime(double curTime,float timeStep);
52 virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep);
53 virtual float getFixedTimeStep();
55 virtual void setGravity(float x,float y,float z);
57 virtual int createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type,
58 float pivotX,float pivotY,float pivotZ,
59 float axisX,float axisY,float axisZ,
60 float axis1X=0,float axis1Y=0,float axis1Z=0,
61 float axis2X=0,float axis2Y=0,float axis2Z=0
64 virtual void removeConstraint(int constraintid);
66 //complex constraint for vehicles
67 virtual PHY_IVehicle* getVehicleConstraint(int constraintId)
72 virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ);
76 virtual void addSensor(PHY_IPhysicsController* ctrl) {}
77 virtual void removeSensor(PHY_IPhysicsController* ctrl) {}
78 virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user)
81 virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl) {}
82 virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl) {}
83 virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) {return 0;}
84 virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight) { return 0;}
86 virtual void setConstraintParam(int constraintId,int param,float value,float value1)
92 #endif //_DUMMYPHYSICSENVIRONMENT