AnimatLab  2
Test
RbSpring.cpp
1 // RbSpring.cpp: implementation of the RbSpring class.
2 //
4 
5 #include "StdAfx.h"
6 #include "RbMovableItem.h"
7 #include "RbBody.h"
8 #include "RbJoint.h"
9 #include "RbMotorizedJoint.h"
10 #include "RbRigidBody.h"
11 #include "RbLine.h"
12 #include "RbSpring.h"
13 #include "RbSimulator.h"
14 
15 namespace RoboticsAnimatSim
16 {
17  namespace Environment
18  {
19  namespace Bodies
20  {
21 
23 // Construction/Destruction
25 
26 RbSpring::RbSpring()
27 {
28  SetThisPointers();
29 }
30 
31 RbSpring::~RbSpring()
32 {
33  try
34  {
35  }
36  catch(...)
37  {Std_TraceMsg(0, "Caught Error in desctructor of RbSpring/\r\n", "", -1, false, true);}
38 }
39 
41 {
42  Spring::CreateJoints();
43  RbLine::CreateParts();
44 }
45 
47 {
48  Spring::ResetSimulation();
49  RbLine::ResetSimulation();
50 }
51 
52 void RbSpring::AfterResetSimulation()
53 {
54  Spring::AfterResetSimulation();
55  RbLine::AfterResetSimulation();
56 }
57 
59 {
61  RbLine::StepSimulation(m_fltTension);
62 }
63 
64 
65  } //Joints
66  } // Environment
67 } //RoboticsAnimatSim
virtual void CreateJoints()
Allows the rigid body to create its joints using the chosen physics engine.
Definition: RbSpring.cpp:40
virtual void ResetSimulation()
Resets the simulation back to time 0.
Definition: RbSpring.cpp:46
virtual void StepSimulation()
Step the simulation for this object.
Definition: RbSpring.cpp:58
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 CalculateTension()
Calculates the tension.
Definition: Spring.cpp:197
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
float m_fltTension
The current force being applied by the spring.
Definition: Spring.h:53