palSpring Class Reference

#include <palActuators.h>

Inheritance diagram for palSpring:

palActuator

List of all members.

Public Member Functions

void Init (palBody *pb1, palBody *pb2, float rest_length, float Ks, float Kd)
void Apply ()


Detailed Description

A spring. A spring exerts a force on two connected bodies, according to Hook's law.

\[ f_a = -k_s (|L| - R) + k_d \frac{\dot L \bullet L}{|L|} \frac{L}{|L|} \]

\[ f_b = -f_a \]

The above equations represent the force that is applied to two bodies (a and b). Where $k_s$ is the spring constant. ("stiffness") $k_d$ is the damping constant. $R$ is the resting length of the spring. $L$ is the distance between the two bodies. and $\dot L$ is the difference between the two bodies velocities.


Member Function Documentation

void palSpring::Apply (  )  [virtual]

Ensures the actuator operates for the current time step

Implements palActuator.

void palSpring::Init ( palBody pb1,
palBody pb2,
float  rest_length,
float  Ks,
float  Kd 
) [inline]

Initializes the spring.

Parameters:
pb1 The body to connect the spring to (1)
pb2 The body to connect the spring to (2)
rest_length The resting length of the spring.
Ks The spring constant.
Kd The damping constant.


The documentation for this class was generated from the following files:

Generated on Mon Aug 31 13:58:02 2009 for pal by  doxygen 1.5.7.1