AnimatLab  2
Test
VsOdorSensor.cpp
1 // VsOdorSensor.cpp: implementation of the VsOdorSensor 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 "VsOdorSensor.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 VsOdorSensor::VsOdorSensor()
27 {
28  SetThisPointers();
29 }
30 
31 VsOdorSensor::~VsOdorSensor()
32 {
33  try
34  {
35  DeleteGraphics();
36  DeletePhysics();
37  }
38  catch(...)
39  {Std_TraceMsg(0, "Caught Error in desctructor of VsOdorSensor/\r\n", "", -1, false, true);}
40 }
41 
42 void VsOdorSensor::CreateGraphicsGeometry()
43 {
44  m_osgGeometry = CreateSphereGeometry(LatitudeSegments(), LongtitudeSegments(), m_fltRadius);
45 }
46 
47 void VsOdorSensor::CreatePhysicsGeometry() {}
48 
49 void VsOdorSensor::ResizePhysicsGeometry() {}
50 
52 {
53  CreateGeometry();
54 
55  VsRigidBody::CreateItem();
56 }
57 
58  } //Bodies
59  } // Environment
60 } //VortexAnimatSim
61 
Declares the vortex odor sensor class.
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.
virtual void CreateParts()
Allows the rigid body to create its parts using the chosen physics engine.
float m_fltRadius
The radius of the sensor part. It is shown as a sphere object.
Definition: Sensor.h:29