00001 //=========================================================================== 00002 /* 00003 This file is part of the GEL dynamics engine. 00004 Copyright (C) 2003-2009 by Francois Conti, Stanford University. 00005 All rights reserved. 00006 00007 \author <http://www.chai3d.org> 00008 \author Francois Conti 00009 \version 2.0.0 $Rev: 251 $ 00010 */ 00011 //=========================================================================== 00012 00013 //--------------------------------------------------------------------------- 00014 #ifndef CGELWorldH 00015 #define CGELWorldH 00016 //--------------------------------------------------------------------------- 00017 #include "chai3d.h" 00018 #include "CGELMesh.h" 00019 //--------------------------------------------------------------------------- 00020 00021 //=========================================================================== 00029 //=========================================================================== 00030 00031 //=========================================================================== 00039 //=========================================================================== 00040 class cGELWorld : public cGenericObject 00041 { 00042 public: 00043 00044 //----------------------------------------------------------------------- 00045 // CONSTRUCTOR & DESTRUCTOR: 00046 //----------------------------------------------------------------------- 00047 00049 cGELWorld(); 00050 00052 ~cGELWorld(); 00053 00054 00055 //----------------------------------------------------------------------- 00056 // METHODS: 00057 //----------------------------------------------------------------------- 00058 00060 void updateDynamics(double a_time); 00061 00063 void clearExternalForces(); 00064 00066 void updateSkins(); 00067 00068 00069 //----------------------------------------------------------------------- 00070 // MEMBERS: 00071 //----------------------------------------------------------------------- 00072 00074 list<cGELMesh*> m_gelMeshes; 00075 00077 double m_simulationTime; 00078 00080 double m_integrationTime; 00081 00083 cVector3d m_gravity; 00084 00085 00086 private: 00087 00088 //----------------------------------------------------------------------- 00089 // METHODS: 00090 //----------------------------------------------------------------------- 00091 00093 virtual void render(const int a_renderMode=CHAI_RENDER_MODE_RENDER_ALL); 00094 }; 00095 00096 00097 //=========================================================================== 00106 //=========================================================================== 00107 class cGELWorldCollision : public cGenericCollision 00108 { 00109 public: 00110 00111 //----------------------------------------------------------------------- 00112 // CONSTRUCTOR & DESTRUCTOR: 00113 //----------------------------------------------------------------------- 00114 00116 cGELWorldCollision(cGELWorld* a_gelWorld) {m_gelWorld = a_gelWorld;} 00117 00119 virtual ~cGELWorldCollision() {}; 00120 00121 00122 //----------------------------------------------------------------------- 00123 // METHODS: 00124 //----------------------------------------------------------------------- 00125 00127 virtual void initialize() {}; 00128 00130 virtual void render() {}; 00131 00133 virtual bool computeCollision(cVector3d& a_segmentPointA, 00134 cVector3d& a_segmentPointB, 00135 cCollisionRecorder& a_recorder, 00136 cCollisionSettings& a_settings); 00137 00138 private: 00139 00140 00141 //----------------------------------------------------------------------- 00142 // MEMBERS: 00143 //----------------------------------------------------------------------- 00144 00146 cGELWorld* m_gelWorld; 00147 }; 00148 00149 //--------------------------------------------------------------------------- 00150 #endif 00151 //--------------------------------------------------------------------------- 00152 00153