AnimatLab  2
Test
OsgRigidBody.h
1 // OsgRigidBody.h: interface for the OsgRigidBody class.
2 //
4 
5 #pragma once
6 
7 namespace OsgAnimatSim
8 {
9  namespace Environment
10  {
11 
50  class ANIMAT_OSG_PORT OsgRigidBody : public OsgBody
51  {
52  protected:
53  RigidBody *m_lpThisRB;
54 
55  //We need these arrays to store body data that could potentially be charted.
56  //this may be scaled so we need to store it in here instead of just using the
57  //body data directly from the physics engine.
58  CStdFPoint m_vPos;
59  float m_vLinearVelocity[3];
60  float m_vAngularVelocity[3];
61  float m_vLinearAcceleration[3];
62  float m_vAngularAcceleration[3];
63  float m_vForce[3];
64  float m_vTorque[3];
65 
66  virtual void SetThisPointers();
67 
68  virtual void ProcessContacts() = 0;
69 
70  virtual void SetupChildGraphics(bool bRoot);
71  virtual void DeleteChildGraphics(bool bRoot);
72 
73  virtual void CreateSensorPart() = 0;
74  virtual void CreateDynamicPart() = 0;
75 
76  virtual void UpdatePositionAndRotationFromMatrix();
77 
78  virtual void ShowSelectedVertex();
79  virtual void HideSelectedVertex();
80  virtual void GetBaseValues() = 0;
81 
82  virtual void CreateGeometry(bool bOverrideStatic = false);
83 
84  public:
85  OsgRigidBody();
86  virtual ~OsgRigidBody();
87 
88  virtual osg::MatrixTransform *ParentOSG();
89 
90  virtual void SetupPhysics();
91  virtual bool AddOsgNodeToParent();
92 
93  virtual void StartGripDrag();
94  virtual void EndGripDrag();
95 
96  virtual void Initialize();
97  virtual void BuildLocalMatrix();
98  virtual float *Physics_GetDataPointer(const std::string &strDataType);
99  virtual void Physics_UpdateMatrix();
100  virtual void Physics_SetColor();
101  virtual void Physics_TextureChanged();
102  virtual void Physics_Resize();
103  virtual void Physics_SelectedVertex(float fltXPos, float fltYPos, float fltZPos);
104  virtual void Physics_ResizeSelectedReceptiveFieldVertex();
105  virtual osg::Matrix GetComMatrix(bool bInvert = false);
106  };
107 
108  } // Environment
109 } //OsgAnimatSim
A common class for all rigid body data specific to vortex.
Definition: OsgRigidBody.h:50
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
Vortex base body class.
Definition: OsgBody.h:26