Game Development Reference
if (!body->hasFiniteMass()) return;
// Apply the mass-scaled force to the body
body->addForce(gravity * body->getMass());
The spring force generator now needs to know where the spring is attached on
each object, and it should generate an appropriate force with its application point.
Excerpt from include/cyclone/fgen.h
* A force generator that applies a Spring force.
class Spring : public ForceGenerator
/** The point of connection of the spring, in local coordinates. */
* The point of connection of the spring to the other object,
* in that object's local coordinates.
/** The particle at the other end of the spring. */
/** Holds the spring constant. */
/** Holds the rest length of the spring. */
/** Creates a new spring with the given parameters. */
Spring(const Vector3 &localConnectionPt,
const Vector3 &otherConnectionPt,
/** Applies the spring force to the given particle. */