AnimatLab  2
Test
OsgOdorSensor.cpp
1 // OsgOdorSensor.cpp: implementation of the OsgOdorSensor 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 "OsgOdorSensor.h"
21 
22 namespace OsgAnimatSim
23 {
24  namespace Environment
25  {
26  namespace Bodies
27  {
28 
30 // Construction/Destruction
32 
33 OsgOdorSensor::OsgOdorSensor()
34 {
35  m_bPhsyicsDefined = false;
36  SetThisPointers();
37 }
38 
39 OsgOdorSensor::~OsgOdorSensor()
40 {
41  try
42  {
43  DeleteGraphics();
44  DeletePhysics(false);
45  }
46  catch(...)
47  {Std_TraceMsg(0, "Caught Error in desctructor of OsgOdorSensor/\r\n", "", -1, false, true);}
48 }
49 
50 void OsgOdorSensor::CreateGraphicsGeometry()
51 {
52  m_osgGeometry = CreateSphereGeometry(LatitudeSegments(), LongtitudeSegments(), m_fltRadius);
53 }
54 
55 void OsgOdorSensor::CreatePhysicsGeometry()
56 {
57  m_bPhsyicsDefined = true;
58 }
59 
60 void OsgOdorSensor::ResizePhysicsGeometry() {}
61 
63 {
64  CreateGeometry();
65 
66  OsgRigidBody::CreateItem();
67 }
68 
69  } //Bodies
70  } // Environment
71 } //VortexAnimatSim
72 
Declares the vortex Light class.
virtual void CreateParts()
Allows the rigid body to create its parts using the chosen physics engine.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
Declares the vortex odor sensor 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.
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)