#include <palActuators.h>
Public Member Functions | |
void | Init (palBody *pb1, palBody *pb2, float rest_length, float Ks, float Kd) |
void | Apply () |
The above equations represent the force that is applied to two bodies (a and b). Where is the spring constant. ("stiffness") is the damping constant. is the resting length of the spring. is the distance between the two bodies. and is the difference between the two bodies velocities.
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.
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. |