AnimatLab  2
Test
VsAttachment.cpp
1 // VsAttachment.cpp: implementation of the VsAttachment class.
2 //
4 
5 #include "StdAfx.h"
6 #include "VsMovableItem.h"
7 #include "VsBody.h"
8 #include "VsJoint.h"
9 #include "VsMotorizedJoint.h"
10 #include "VsRigidBody.h"
11 #include "VsAttachment.h"
12 #include "VsSimulator.h"
13 #include "VsDragger.h"
14 
15 namespace VortexAnimatSim
16 {
17  namespace Environment
18  {
19  namespace Bodies
20  {
21 
23 // Construction/Destruction
25 
26 VsAttachment::VsAttachment()
27 {
28  SetThisPointers();
29 }
30 
31 VsAttachment::~VsAttachment()
32 {
33 
34  try
35  {
36  DeleteGraphics();
37  DeletePhysics();
38  }
39  catch(...)
40  {Std_TraceMsg(0, "Caught Error in desctructor of VsAttachment\r\n", "", -1, false, true);}
41 }
42 
43 void VsAttachment::CreateGraphicsGeometry()
44 {
45  m_osgGeometry = CreateSphereGeometry(LatitudeSegments(), LongtitudeSegments(), m_fltRadius);
46 }
47 
48 void VsAttachment::CreatePhysicsGeometry() {}
49 
50 void VsAttachment::ResizePhysicsGeometry() {}
51 
53 {
54  CreateGeometry();
55 
56  VsRigidBody::CreateItem();
57 }
58 
59  } //Bodies
60  } // Environment
61 } //VortexAnimatSim
62 
virtual void CreateParts()
Allows the rigid body to create its parts using the chosen physics engine.
osg::Geometry * CreateSphereGeometry(int latres, int longres, float radius)
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
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.
float m_fltRadius
The radius of the sensor part. It is shown as a sphere object.
Definition: Sensor.h:29