AnimatLab  2
Test
BlLinearHillMuscle.cpp
1 // BlLinearHillMuscle.cpp: implementation of the BlLinearHillMuscle class.
2 //
4 
5 #include "StdAfx.h"
6 #include "BlJoint.h"
7 #include "BlMotorizedJoint.h"
8 #include "BlRigidBody.h"
9 #include "BlLine.h"
10 #include "BlLinearHillMuscle.h"
11 #include "BlSimulator.h"
12 
13 namespace BulletAnimatSim
14 {
15  namespace Environment
16  {
17  namespace Bodies
18  {
19 
21 // Construction/Destruction
23 
24 BlLinearHillMuscle::BlLinearHillMuscle()
25 {
26  SetThisPointers();
27 }
28 
29 BlLinearHillMuscle::~BlLinearHillMuscle()
30 {
31 
32  try
33  {
34  DeleteGraphics();
35  DeletePhysics(false);
36  }
37  catch(...)
38  {Std_TraceMsg(0, "Caught Error in desctructor of BlLinearHillMuscle\r\n", "", -1, false, true);}
39 }
40 
41 void BlLinearHillMuscle::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  BlLine::CreateParts();
51 }
52 
54 {
55  LinearHillMuscle::ResetSimulation();
56  BlLine::ResetSimulation();
57 }
58 
60 {
61  LinearHillMuscle::AfterResetSimulation();
62  BlLine::AfterResetSimulation();
63 }
64 
66 {
68 
69  BlLine::StepSimulation(m_fltTension);
70 }
71 
72  } //Bodies
73  } // Environment
74 } //BulletAnimatSim
75 
virtual void AfterResetSimulation()
Called after a simulation reset for some objects.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
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.
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 StepSimulation()
Step the simulation for this object.
virtual void CalculateTension()
Calculates the tension.