AnimatLab  2
Test
OsgFreeJoint.cpp
Go to the documentation of this file.
1 
7 #include "StdAfx.h"
8 #include <stdarg.h>
9 #include "OsgMovableItem.h"
10 #include "OsgBody.h"
11 #include "OsgJoint.h"
12 #include "OsgRigidBody.h"
13 #include "OsgStructure.h"
14 #include "OsgUserData.h"
15 #include "OsgUserDataVisitor.h"
16 
17 #include "OsgMouseSpring.h"
18 #include "OsgLight.h"
19 #include "OsgCameraManipulator.h"
20 #include "OsgDragger.h"
21 
22 #include "OsgFreeJoint.h"
23 
24 
25 namespace OsgAnimatSim
26 {
27  namespace Environment
28  {
29  namespace Joints
30  {
31 
39 {
40  m_bPhsyicsDefined = false;
41  SetThisPointers();
42 }
43 
51 {
52  try
53  {
54  DeleteGraphics();
55  DeletePhysics(false);
56  }
57  catch(...)
58  {Std_TraceMsg(0, "Caught Error in desctructor of OsgFreeJoint/\r\n", "", -1, false, true);}
59 }
60 
61 void OsgFreeJoint::DeletePhysics(bool bIncludeChildren)
62 {
63 }
64 
65 void OsgFreeJoint::SetupPhysics()
66 {
67  m_bPhsyicsDefined = true;
68 }
69 
70 void OsgFreeJoint::CreateJoint()
71 {
72  SetupGraphics();
73  SetupPhysics();
74 }
75 
76 #pragma region DataAccesMethods
77 
78 
79 bool OsgFreeJoint::SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError)
80 {
81  if(OsgJoint::Physics_SetData(strDataType, strValue))
82  return true;
83 
84  if(BallSocket::SetData(strDataType, strValue, false))
85  return true;
86 
87  //If it was not one of those above then we have a problem.
88  if(bThrowError)
89  THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType, "Data Type", strDataType);
90 
91  return false;
92 }
93 
94 void OsgFreeJoint::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
95 {
96  OsgJoint::Physics_QueryProperties(aryProperties);
97  BallSocket::QueryProperties(aryProperties);
98 }
99 
100 #pragma endregion
101 
102  } // Joints
103  } // Environment
104 } //VortexAnimatSim
Declares the vortex Light class.
virtual void SetupGraphics()
Sets up the graphics for the joint.
Definition: OsgJoint.cpp:196
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
Declares the vs universal class.
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.
Declares the vortex structure class.