AnimatLab  2
Test
RbRigidBody.cpp
1 // RbRigidBody.cpp: implementation of the RbRigidBody class.
2 //
4 
5 #include "StdAfx.h"
6 #include "RbMovableItem.h"
7 #include "RbBody.h"
8 #include "RbJoint.h"
9 #include "RbRigidBody.h"
10 #include "RbSimulator.h"
11 
12 namespace RoboticsAnimatSim
13 {
14  namespace Environment
15  {
16 
18 // Construction/Destruction
20 
21 RbRigidBody::RbRigidBody()
22 {
23  m_lpMaterial = NULL;
24  m_lpRbSim = NULL;
25 }
26 
27 RbRigidBody::~RbRigidBody()
28 {
29 
30 try
31 {
32 }
33 catch(...)
34 {Std_TraceMsg(0, "Caught Error in desctructor of RbRigidBody\r\n", "", -1, false, true);}
35 }
36 
37 bool RbRigidBody::Physics_IsDefined()
38 {
39  return true;
40 }
41 
42 bool RbRigidBody::Physics_IsGeometryDefined()
43 {
44  return true;
45 }
46 
47 CStdFPoint RbRigidBody::Physics_GetCurrentPosition()
48 {
49  CStdFPoint vPos;
50  return vPos;
51 }
52 
53 RbSimulator *RbRigidBody::GetRbSimulator()
54 {
55  if(!m_lpRbSim)
56  {
57  m_lpRbSim = dynamic_cast<RbSimulator *>(m_lpThisAB->GetSimulator());
58  if(!m_lpThisRbMI)
59  THROW_TEXT_ERROR(Rb_Err_lThisPointerNotDefined, Rb_Err_strThisPointerNotDefined, "m_lpRbSim, " + m_lpThisAB->Name());
60  }
61  return m_lpRbSim;
62 }
63 
64 void RbRigidBody::Physics_UpdateNode()
65 {
66 }
67 
68 void RbRigidBody::Physics_SetFreeze(bool bVal)
69 {
70 }
71 
72 void RbRigidBody::Physics_SetMass(float fltVal)
73 {
74 }
75 
76 float RbRigidBody::Physics_GetMass()
77 {
78  return 0;
79 }
80 
81 float RbRigidBody::Physics_GetDensity()
82 {
83  return 0;
84 }
85 
86 void RbRigidBody::Physics_SetMaterialID(std::string strID)
87 {
88 }
89 
90 void RbRigidBody::Physics_SetVelocityDamping(float fltLinear, float fltAngular)
91 {
92 }
93 
94 void RbRigidBody::Physics_SetCenterOfMass(float fltTx, float fltTy, float fltTz)
95 {
96 }
97 
98 void RbRigidBody::Physics_FluidDataChanged()
99 {
100 }
101 
102 void RbRigidBody::Physics_WakeDynamics()
103 {
104 }
105 
106 void RbRigidBody::Physics_ContactSensorAdded(ContactSensor *lpSensor)
107 {
108 }
109 
110 void RbRigidBody::Physics_ContactSensorRemoved()
111 {
112 }
113 
114 void RbRigidBody::Physics_ChildBodyAdded(RigidBody *lpChild)
115 {
116 }
117 
118 void RbRigidBody::Physics_ChildBodyRemoved(bool bHasStaticJoint)
119 {
120 }
121 
122 void RbRigidBody::Physics_CollectData()
123 {
124 }
125 
126 void RbRigidBody::Physics_CollectExtraData()
127 {
128 }
129 
130 void RbRigidBody::Physics_ResetSimulation()
131 {
132 }
133 
134 void RbRigidBody::Physics_EnableCollision(RigidBody *lpBody)
135 {
136 }
137 
138 void RbRigidBody::Physics_DisableCollision(RigidBody *lpBody)
139 {
140 }
141 
142 void RbRigidBody::Physics_AddBodyForceAtLocalPos(float fltPx, float fltPy, float fltPz, float fltFx, float fltFy, float fltFz, bool bScaleUnits)
143 {
144 }
145 
146 void RbRigidBody::Physics_AddBodyForceAtWorldPos(float fltPx, float fltPy, float fltPz, float fltFx, float fltFy, float fltFz, bool bScaleUnits)
147 {
148 }
149 
150 void RbRigidBody::Physics_AddBodyTorque(float fltTx, float fltTy, float fltTz, bool bScaleUnits)
151 {
152 }
153 
154 CStdFPoint RbRigidBody::Physics_GetVelocityAtPoint(float x, float y, float z)
155 {
156  CStdFPoint linVel(0,0,0);
157  return linVel;
158 }
159 
160 bool RbRigidBody::Physics_HasCollisionGeometry()
161 {
162  return true;
163 }
164 
165 void RbRigidBody::Physics_StepHydrodynamicSimulation()
166 {
167 }
168 
169 float *RbRigidBody::Physics_GetDataPointer(const std::string &strDataType)
170 {
171  std::string strType = Std_CheckString(strDataType);
172  RigidBody *lpBody = dynamic_cast<RigidBody *>(this);
173 
174  if(strType == "BODYBUOYANCY")
175  return (&m_fltReportNull);
176 
177  if(strType == "BODYDRAGFORCEX")
178  return (&m_fltReportNull);
179 
180  if(strType == "BODYDRAGFORCEY")
181  return (&m_fltReportNull);
182 
183  if(strType == "BODYDRAGFORCEZ")
184  return (&m_fltReportNull);
185 
186  if(strType == "BODYDRAGTORQUEX")
187  return (&m_fltReportNull);
188 
189  if(strType == "BODYDRAGTORQUEY")
190  return (&m_fltReportNull);
191 
192  if(strType == "BODYDRAGTORQUEZ")
193  return (&m_fltReportNull);
194 
195  if(strType == "BODYTORQUEX")
196  return (&m_fltReportNull);
197 
198  if(strType == "BODYTORQUEY")
199  return (&m_fltReportNull);
200 
201  if(strType == "BODYTORQUEZ")
202  return (&m_fltReportNull);
203 
204  if(strType == "BODYFORCEX")
205  return (&m_fltReportNull);
206 
207  if(strType == "BODYFORCEY")
208  return (&m_fltReportNull);
209 
210  if(strType == "BODYFORCEZ")
211  return (&m_fltReportNull);
212 
213  if(strType == "BODYLINEARVELOCITYX")
214  return (&m_fltReportNull);
215 
216  if(strType == "BODYLINEARVELOCITYY")
217  return (&m_fltReportNull);
218 
219  if(strType == "BODYLINEARVELOCITYZ")
220  return (&m_fltReportNull);
221 
222  if(strType == "BODYANGULARVELOCITYX")
223  return (&m_fltReportNull);
224 
225  if(strType == "BODYANGULARVELOCITYY")
226  return (&m_fltReportNull);
227 
228  if(strType == "BODYANGULARVELOCITYZ")
229  return (&m_fltReportNull);
230 
231  if(strType == "BODYLINEARACCELERATIONX")
232  return (&m_fltReportNull);
233 
234  if(strType == "BODYLINEARACCELERATIONY")
235  return (&m_fltReportNull);
236 
237  if(strType == "BODYLINEARACCELERATIONZ")
238  return (&m_fltReportNull);
239 
240  if(strType == "BODYANGULARACCELERATIONX")
241  return (&m_fltReportNull);
242 
243  if(strType == "BODYANGULARACCELERATIONY")
244  return (&m_fltReportNull);
245 
246  if(strType == "BODYANGULARACCELERATIONZ")
247  return (&m_fltReportNull);
248 
249  return NULL;
250 }
251 
252  } // Environment
253 } //RoboticsAnimatSim
RbMaterialType * m_lpMaterial
The pointer to the material for this body.
Definition: RbRigidBody.h:58
float m_fltReportNull
Used to report back nulls.
Definition: RbMovableItem.h:21
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.