|
Blender
V2.59
|
00001 /* 00002 * $Id: DummyPhysicsEnvironment.h 35072 2011-02-22 12:42:55Z jesterking $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software Foundation, 00018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00021 * All rights reserved. 00022 * 00023 * The Original Code is: all of this file. 00024 * 00025 * Contributor(s): none yet. 00026 * 00027 * ***** END GPL LICENSE BLOCK ***** 00028 */ 00029 00034 #ifndef _DUMMYPHYSICSENVIRONMENT 00035 #define _DUMMYPHYSICSENVIRONMENT 00036 00037 #include "PHY_IPhysicsEnvironment.h" 00038 00047 class DummyPhysicsEnvironment : public PHY_IPhysicsEnvironment 00048 { 00049 00050 public: 00051 DummyPhysicsEnvironment (); 00052 virtual ~DummyPhysicsEnvironment (); 00053 virtual void beginFrame(); 00054 virtual void endFrame(); 00055 // Perform an integration step of duration 'timeStep'. 00056 virtual bool proceedDeltaTime(double curTime,float timeStep,float interval); 00057 virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep); 00058 virtual float getFixedTimeStep(); 00059 00060 virtual void setGravity(float x,float y,float z); 00061 00062 virtual int createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type, 00063 float pivotX,float pivotY,float pivotZ, 00064 float axisX,float axisY,float axisZ, 00065 float axis1X=0,float axis1Y=0,float axis1Z=0, 00066 float axis2X=0,float axis2Y=0,float axis2Z=0,int flag=0 00067 ); 00068 00069 virtual void removeConstraint(int constraintid); 00070 00071 //complex constraint for vehicles 00072 virtual PHY_IVehicle* getVehicleConstraint(int constraintId) 00073 { 00074 return 0; 00075 } 00076 00077 virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ); 00078 virtual bool cullingTest(PHY_CullingCallback callback, void* userData, PHY__Vector4* planes, int nplanes, int occlusionRes) { return false; } 00079 00080 00081 //gamelogic callbacks 00082 virtual void addSensor(PHY_IPhysicsController* ctrl) {} 00083 virtual void removeSensor(PHY_IPhysicsController* ctrl) {} 00084 virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user) 00085 { 00086 } 00087 virtual bool requestCollisionCallback(PHY_IPhysicsController* ctrl) { return false; } 00088 virtual bool removeCollisionCallback(PHY_IPhysicsController* ctrl) { return false;} 00089 virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) {return 0;} 00090 virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight) { return 0;} 00091 00092 virtual void setConstraintParam(int constraintId,int param,float value,float value1) 00093 { 00094 } 00095 00096 virtual float getConstraintParam(int constraintId,int param) 00097 { 00098 return 0.f; 00099 } 00100 00101 00102 #ifdef WITH_CXX_GUARDEDALLOC 00103 public: 00104 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:DummyPhysicsEnvironment"); } 00105 void operator delete( void *mem ) { MEM_freeN(mem); } 00106 #endif 00107 }; 00108 00109 #endif //_DUMMYPHYSICSENVIRONMENT 00110