AnimatLab  2
Test
VsSpring.h
1 // VsSpring.h: interface for the VsSpring class.
2 //
4 
5 #if !defined(AFX_VSSPRINGJOINT_H__FB4AFDAA_982E_4893_83F3_05BFF60F5643__INCLUDED_)
6 #define AFX_VSSPRINGJOINT_H__FB4AFDAA_982E_4893_83F3_05BFF60F5643__INCLUDED_
7 
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif
11 
12 namespace VortexAnimatSim
13 {
14  namespace Environment
15  {
16  namespace Bodies
17  {
18 
19  class VORTEX_PORT AnimatVxSpring : public Vx::VxSpring
20  {
21  public:
22  AnimatVxSpring() : Vx::VxSpring() {};
23  AnimatVxSpring(Vx::VxPart* part1, Vx::VxPart* part2, Vx::VxReal naturalLength, Vx::VxReal stiffness, Vx::VxReal damping)
24  : Vx::VxSpring(part1, part2, naturalLength,stiffness, damping) {};
25  virtual ~AnimatVxSpring() {};
26 
27  void EnableBodies()
28  {Vx::VxSpring::enableBodies();}
29  };
30 
31  class VORTEX_PORT VsSpring : public VsLine, public AnimatSim::Environment::Bodies::Spring
32  {
33  protected:
34  //Vx::VxSpring *m_vxSpring;
35  AnimatVxSpring *m_vxSpring;
36 
37  virtual void SetupPhysics();
38  virtual void DeletePhysics();
39  virtual void InitializeAttachments();
40 
41  public:
42  VsSpring();
43  virtual ~VsSpring();
44 
45  virtual void Enabled(bool bVal);
46  virtual void NaturalLength(float fltVal, bool bUseScaling = true);
47  virtual void Stiffness(float fltVal, bool bUseScaling = true);
48  virtual void Damping(float fltVal, bool bUseScaling = true);
49 
50  virtual void Physics_CollectData();
51  virtual void Physics_Resize();
52 
53  virtual void CreateJoints();
54  virtual void ResetSimulation();
55  virtual void AfterResetSimulation();
56  virtual void StepSimulation();
57  };
58 
59  } //Joints
60  } // Environment
61 } //VortexAnimatSim
62 
63 #endif // !defined(AFX_VSSPRINGJOINT_H__FB4AFDAA_982E_4893_83F3_05BFF60F5643__INCLUDED_)
Spring body part type.
Definition: Spring.h:25
Classes for implementing the cm-labs vortex physics engine for AnimatLab.