45 #ifndef CGELLinearSpringH 46 #define CGELLinearSpringH 101 glColor4fv( (
const float *)&
m_color);
119 double m_length = m_link01.
length();
125 if (m_length < 0.000001) {
return; }
131 if (m_length > 0.000001)
double m_kDamperElongation
Linear damping.
Definition: CGELLinearSpring.h:177
static chai3d::cColorf s_default_color
Default property - color property.
Definition: CGELLinearSpring.h:193
void addForce(chai3d::cVector3d &a_force)
This method adds a force to this mass particle.
Definition: CGELMassParticle.h:94
Implementation of a mass particle.
cGELLinearSpring(cGELMassParticle *a_node0, cGELMassParticle *a_node1)
Constructor of cGELLinearSpring.
Definition: CGELLinearSpring.cpp:71
bool m_enabled
Is link enabled?
Definition: CGELLinearSpring.h:174
~cGELLinearSpring()
Destructor of cGELLinearSpring.
Definition: CGELLinearSpring.cpp:94
This class implements a linear spring between two mass particles.
Definition: CGELLinearSpring.h:71
chai3d::cVector3d m_pos
Position of particle.
Definition: CGELMassParticle.h:216
cVector3d cSub(const cVector3d &a_vector1, const cVector3d &a_vector2)
cVector3d cMul(const double &a_value, const cVector3d &a_vector)
chai3d::cColorf m_color
Color property used for displaying link.
Definition: CGELLinearSpring.h:148
double m_length0
Initial length of link.
Definition: CGELLinearSpring.h:180
void render()
This method graphically renders this spring using OpenGL.
Definition: CGELLinearSpring.h:98
cGELMassParticle * m_node1
Node 1 of current link.
Definition: CGELLinearSpring.h:161
This class implements a simple mass particle point.
Definition: CGELMassParticle.h:69
cGELMassParticle * m_node0
Node 0 of current link.
Definition: CGELLinearSpring.h:158
double m_kSpringElongation
Linear spring constant.
Definition: CGELLinearSpring.h:171
void computeForces()
This method computes the forces that are applied on the mass nodes.
Definition: CGELLinearSpring.h:115
static double s_default_kSpringElongation
Default property - linear stiffness.
Definition: CGELLinearSpring.h:190