AnimatLab  2
Test
RbStructure.cpp
Go to the documentation of this file.
1 
7 #include "StdAfx.h"
8 #include "RbMovableItem.h"
9 #include "RbBody.h"
10 #include "RbRigidBody.h"
11 #include "RbJoint.h"
12 #include "RbStructure.h"
13 #include "RbSimulator.h"
14 
15 namespace RoboticsAnimatSim
16 {
17  namespace Environment
18  {
19 
27 {
28  m_lpRbBody = NULL;
29  SetThisPointers();
30 }
31 
39 {
40 }
41 
42 void RbStructure::Body(RigidBody *lpBody)
43 {
44  Structure::Body(lpBody);
45  m_lpRbBody = dynamic_cast<RbMovableItem *>(lpBody);
46 
47  if(!m_lpRbBody)
48  THROW_TEXT_ERROR(Rb_Err_lUnableToConvertToVsRigidBody, Rb_Err_strUnableToConvertToVsRigidBody, "ID: " + lpBody->Name());
49 }
50 
51 void RbStructure::SetThisPointers()
52 {
53  RbMovableItem::SetThisPointers();
54 
55  m_lpThisST = dynamic_cast<Structure *>(this);
56  if(!m_lpThisST)
57  THROW_TEXT_ERROR(Rb_Err_lThisPointerNotDefined, Rb_Err_strThisPointerNotDefined, "m_lpThisST, " + m_lpThisAB->Name());
58 }
59 
60 void RbStructure::Create()
61 {
62  CreateItem();
63 
64  Structure::Create();
65 }
66 
68 {
69  RbMovableItem::Physics_ResetSimulation();
70 
71  Structure::ResetSimulation();
72 }
73 
74  } // Environment
75 } //RoboticsAnimatSim
virtual RigidBody * Body()
Gets the root body.
Definition: Structure.cpp:115
Declares the vortex structure class.
virtual void ResetSimulation()
Resets the simulation back to time 0.
Definition: RbStructure.cpp:67
Structure()
Default constructor.
Definition: Structure.cpp:53
Classes for implementing the cm-labs vortex physics engine for AnimatLab.