4 #include "BlMaterialType.h"
5 #include "BlAnimatCollisionDispatcher.h"
18 btDefaultCollisionConfiguration *m_lpCollisionConfiguration;
20 btConstraintSolver *m_lpSolver;
21 btBroadphaseInterface *m_lpBroadPhase;
22 btDiscreteDynamicsWorld *m_lpDynamicsWorld;
23 osgbCollision::GLDebugDrawer m_dbgDraw;
25 std::list<FluidPlane *> m_aryFluidPlanes;
29 double m_dblTotalVortexStepTime;
30 long m_lStepVortexTimeCount;
32 int m_iSubstepCallbackCount;
37 void InitializeBullet(
int argc,
const char **argv);
38 void InitializeBulletViewer(
int argc,
const char **argv);
39 void SetSimulationStabilityParams();
41 virtual void StepSimulation();
42 virtual void SimulateEnd();
48 btDefaultCollisionConfiguration *CollisionConfig() {
return m_lpCollisionConfiguration;};
50 btConstraintSolver *Solver() {
return m_lpSolver;};
51 btBroadphaseInterface *BroadPhase() {
return m_lpBroadPhase;}
52 btDiscreteDynamicsWorld *DynamicsWorld() {
return m_lpDynamicsWorld;};
54 #pragma region CreateMethods
56 virtual void GenerateCollisionMeshFile(std::string strOriginalMeshFile, std::string strCollisionMeshFile,
float fltScaleX,
float fltScaleY,
float fltScaleZ);
57 virtual void ConvertV1MeshFile(std::string strOriginalMeshFile, std::string strNewMeshFile, std::string strTexture);
61 #pragma region MutatorOverrides
63 virtual void StabilityScale(
float fltVal);
64 virtual void LinearCompliance(
float fltVal,
bool bUseScaling =
true);
65 virtual void AngularCompliance(
float fltVal,
bool bUseScaling =
true);
66 virtual void LinearDamping(
float fltVal,
bool bUseScaling =
true);
67 virtual void AngularDamping(
float fltVal,
bool bUseScaling =
true);
68 virtual void LinearKineticLoss(
float fltVal,
bool bUseScaling =
true);
69 virtual void AngularKineticLoss(
float fltVal,
bool bUseScaling =
true);
71 virtual void Gravity(
float fltVal,
bool bUseScaling =
true);
75 #pragma region HelperMethods
77 virtual void GetPositionAndRotationFromD3DMatrix(
float (&aryTransform)[4][4], CStdFPoint &vPos, CStdFPoint &vRot);
81 #pragma region FluidMethods
83 virtual void AddFluidPlane(FluidPlane *lpPlane);
84 virtual void RemoveFluidPlane(FluidPlane *lpPlane);
85 virtual bool HasFluidPlane(FluidPlane *lpPlane);
86 virtual void SortFluidPlanes();
87 virtual FluidPlane *FindFluidPlaneForDepth(
float fltDepth);
91 void BulletStepFinished(btScalar timeStep);
94 virtual void ResetSimulation();
95 virtual void Initialize(
int argc,
const char **argv);
Records the simulation keyframes and videos.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.