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