AnimatLab  2
Test
OsgAttachment.cpp
1 // OsgAttachment.cpp: implementation of the OsgAttachment class.
2 //
4 
5 #include "StdAfx.h"
6 #include <stdarg.h>
7 #include "OsgMovableItem.h"
8 #include "OsgBody.h"
9 #include "OsgJoint.h"
10 #include "OsgRigidBody.h"
11 #include "OsgStructure.h"
12 #include "OsgUserData.h"
13 #include "OsgUserDataVisitor.h"
14 
15 #include "OsgMouseSpring.h"
16 #include "OsgLight.h"
17 #include "OsgCameraManipulator.h"
18 #include "OsgDragger.h"
19 
20 #include "OsgAttachment.h"
21 
22 
23 namespace OsgAnimatSim
24 {
25  namespace Environment
26  {
27  namespace Bodies
28  {
29 
31 // Construction/Destruction
33 
34 OsgAttachment::OsgAttachment()
35 {
36  m_bPhsyicsDefined = false;
37  SetThisPointers();
38 }
39 
40 OsgAttachment::~OsgAttachment()
41 {
42 
43  try
44  {
45  DeleteGraphics();
46  DeletePhysics(false);
47  }
48  catch(...)
49  {Std_TraceMsg(0, "Caught Error in desctructor of OsgAttachment\r\n", "", -1, false, true);}
50 }
51 
52 void OsgAttachment::CreateGraphicsGeometry()
53 {
54  m_osgGeometry = CreateSphereGeometry(LatitudeSegments(), LongtitudeSegments(), m_fltRadius);
55 }
56 
57 void OsgAttachment::CreatePhysicsGeometry()
58 {
59  m_bPhsyicsDefined = true;
60 }
61 
62 void OsgAttachment::ResizePhysicsGeometry() {}
63 
65 {
66  CreateGeometry();
67 
68  OsgRigidBody::CreateItem();
69 }
70 
71  } //Bodies
72  } // Environment
73 } //VortexAnimatSim
74 
Declares the vortex Light class.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
virtual void CreateParts()
Allows the rigid body to create its parts using the chosen physics engine.
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.
float m_fltRadius
The radius of the sensor part. It is shown as a sphere object.
Definition: Sensor.h:29
osg::Geometry ANIMAT_OSG_PORT * CreateSphereGeometry(int latres, int longres, float radius)