Blender V2.61 - r43446

DummyPhysicsEnvironment.h

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