5 #include "VsMaterialType.h"
7 #include "VsIntersectionEvent.h"
8 #include "VsMouseSpring.h"
9 #include "VsCameraManipulator.h"
10 #include "VsSimulationWindowMgr.h"
23 VsSimulationWindowMgr *m_vsWinMgr;
26 osg::ref_ptr<osg::Group> m_grpScene;
29 osg::ref_ptr<osgManipulator::CommandManager> m_osgCmdMgr;
32 VxUniverse *m_uUniverse;
37 osg::AlphaFunc *m_osgAlphafunc;
39 VsIntersectionEvent m_vsIntersect;
41 double m_dblTotalVortexStepTime;
42 long m_lStepVortexTimeCount;
44 double m_dblTotalStepTime;
45 long m_lStepTimeCount;
50 virtual void SnapshotStopFrame();
53 void InitializeVortex(
int argc,
const char **argv);
54 void InitializeVortexViewer(
int argc,
const char **argv);
55 void SetSimulationStabilityParams();
57 virtual void StepSimulation();
58 virtual void SimulateEnd();
60 virtual void UpdateSimulationWindows();
62 osg::NotifySeverity ConvertTraceLevelToOSG();
64 osg::ref_ptr<osg::Node> m_Spline;
70 Vx::VxUniverse* Universe();
72 VsRigidBody *TrackBody();
73 osg::Group *OSGRoot() {
return m_grpScene.get();};
74 osgManipulator::CommandManager *OsgCmdMgr() {
return m_osgCmdMgr.get();};
83 #pragma region CreateMethods
85 virtual Vx::VxTriangleMesh *CreatTriangleMeshFromOsg(osg::Node *osgNode);
86 virtual Vx::VxConvexMesh *CreateConvexMeshFromOsg(osg::Node *osgNode);
87 virtual void GenerateCollisionMeshFile(std::string strOriginalMeshFile, std::string strCollisionMeshFile,
float fltScaleX,
float fltScaleY,
float fltScaleZ);
88 virtual void ConvertV1MeshFile(std::string strOriginalMeshFile, std::string strNewMeshFile, std::string strTexture);
92 #pragma region MutatorOverrides
94 virtual void StabilityScale(
float fltVal);
95 virtual void LinearCompliance(
float fltVal,
bool bUseScaling =
true);
96 virtual void AngularCompliance(
float fltVal,
bool bUseScaling =
true);
97 virtual void LinearDamping(
float fltVal,
bool bUseScaling =
true);
98 virtual void AngularDamping(
float fltVal,
bool bUseScaling =
true);
99 virtual void LinearKineticLoss(
float fltVal,
bool bUseScaling =
true);
100 virtual void AngularKineticLoss(
float fltVal,
bool bUseScaling =
true);
102 virtual void PhysicsTimeStep(
float fltVal);
103 virtual void Gravity(
float fltVal,
bool bUseScaling =
true);
104 virtual int GetMaterialID(std::string strID);
108 #pragma region HelperMethods
110 virtual void GetPositionAndRotationFromD3DMatrix(
float (&aryTransform)[4][4], CStdFPoint &vPos, CStdFPoint &vRot);
113 virtual unsigned long long GetTimerTick();
114 virtual double TimerDiff_n(
unsigned long long lStart,
unsigned long long lEnd);
115 virtual double TimerDiff_u(
unsigned long long lStart,
unsigned long long lEnd);
116 virtual double TimerDiff_m(
unsigned long long lStart,
unsigned long long lEnd);
117 virtual double TimerDiff_s(
unsigned long long lStart,
unsigned long long lEnd);
118 virtual void MicroSleep(
unsigned int iMicroTime);
119 virtual void WriteToConsole(std::string strMessage);
123 virtual void AlphaThreshold(
float fltValue);
125 virtual float *GetDataPointer(
const std::string &strDataType);
127 virtual void Reset();
128 virtual void ResetSimulation();
130 virtual void Initialize(
int argc,
const char **argv);
131 virtual void ShutdownSimulation();
132 virtual void ToggleSimulation();
133 virtual void StopSimulation();
134 virtual bool StartSimulation();
135 virtual bool PauseSimulation();
136 virtual void Save(std::string strFile);
138 static VsSimulator *ConvertSimulator(Simulator *lpSim);
Vortex physical structure implementation.
Simulates the entire environment.
Declares the vortex heads-up display class.
Records the simulation keyframes and videos.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
Declares the vortex MeshMgr class.