AnimatLab  2
Test
RbLinearHillMuscle.cpp
1 // RbLinearHillMuscle.cpp: implementation of the RbLinearHillMuscle 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 "RbLinearHillMuscle.h"
13 #include "RbSimulator.h"
14 
15 namespace RoboticsAnimatSim
16 {
17  namespace Environment
18  {
19  namespace Bodies
20  {
21 
23 // Construction/Destruction
25 
26 RbLinearHillMuscle::RbLinearHillMuscle()
27 {
28  SetThisPointers();
29 }
30 
31 RbLinearHillMuscle::~RbLinearHillMuscle()
32 {
33 
34  try
35  {
36  }
37  catch(...)
38  {Std_TraceMsg(0, "Caught Error in desctructor of RbLinearHillMuscle\r\n", "", -1, false, true);}
39 }
40 
41 void RbLinearHillMuscle::CreateParts()
42 {
43  //We do nothing in createparts because we cannot build the line until after all parts are created
44  //so we can get a handle to the attachment points.
45 }
46 
48 {
49  LinearHillMuscle::CreateJoints();
50  RbLine::CreateParts();
51 }
52 
54 {
55  LinearHillMuscle::ResetSimulation();
56  RbLine::ResetSimulation();
57 }
58 
60 {
61  LinearHillMuscle::AfterResetSimulation();
62  RbLine::AfterResetSimulation();
63 }
64 
66 {
68 
69  RbLine::StepSimulation(m_fltTension);
70 }
71 
72  } //Bodies
73  } // Environment
74 } //RoboticsAnimatSim
75 
virtual void CreateJoints()
Allows the rigid body to create its joints using the chosen physics engine.
virtual void ResetSimulation()
Resets the simulation back to time 0.
virtual void AfterResetSimulation()
Called after a simulation reset for some objects.
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 StepSimulation()
Step the simulation for this object.
float m_fltTension
Tension of the muscle.
Definition: MuscleBase.h:39
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
virtual void CalculateTension()
Calculates the tension.