Blender  V2.59
DummyPhysicsEnvironment.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: DummyPhysicsEnvironment.cpp 35173 2011-02-25 13:37:23Z 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 
00035 #include <stddef.h>
00036 
00037 #include "DummyPhysicsEnvironment.h"
00038 #include "PHY_IMotionState.h"
00039 
00040 DummyPhysicsEnvironment::DummyPhysicsEnvironment()
00041 {
00042         // create physicsengine data
00043 }
00044 
00045 
00046 
00047 DummyPhysicsEnvironment::~DummyPhysicsEnvironment()
00048 {
00049         //destroy physicsengine data
00050 }
00051 
00052 void DummyPhysicsEnvironment::beginFrame()
00053 {
00054         // beginning of logic frame: apply forces
00055 }
00056 
00057 void DummyPhysicsEnvironment::endFrame()
00058 {
00059         // end of logic frame: clear forces
00060 }
00061 
00062 
00063 
00064 bool            DummyPhysicsEnvironment::proceedDeltaTime(double  curTime,float timeStep,float interval)
00065 {
00066         //step physics simulation, typically perform
00067         
00068         //collision detection 
00069         //solve constraints
00070         //integrate solution
00071         // return true if an update was done.
00072         return true;
00073 }
00074 void            DummyPhysicsEnvironment::setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep)
00075 {
00076 }
00077  
00078 float           DummyPhysicsEnvironment::getFixedTimeStep()
00079 {
00080         return 0.f;
00081 }
00082 
00083 
00084 
00085 
00086 void DummyPhysicsEnvironment::setGravity(float x,float y,float z)
00087 {
00088 }
00089 
00090 
00091 
00092 
00093 
00094 
00095 
00096 int                     DummyPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type,
00097                 float pivotX,float pivotY,float pivotZ,float axisX,float axisY,float axisZ,
00098                         float axis1X,float axis1Y,float axis1Z,
00099                         float axis2X,float axis2Y,float axis2Z,int flag
00100                 )
00101 {
00102         
00103         int constraintid = 0;
00104         return constraintid;
00105 
00106 }
00107 
00108 void            DummyPhysicsEnvironment::removeConstraint(int   constraintid)
00109 {
00110         if (constraintid)
00111         {
00112         }
00113 }
00114 
00115 PHY_IPhysicsController* DummyPhysicsEnvironment::rayTest(PHY_IRayCastFilterCallback &filterCallback,float fromX,float fromY,float fromZ, float toX,float toY,float toZ)
00116 {
00117         //collision detection / raytesting
00118         return NULL;
00119 }
00120