#include <GeneralForceSubsystem.h>
Each force is represented by a Force object. For example, to add a spring between two bodies, you would write
GeneralForceSubsystem forces(system); ... Force::TwoPointLinearSpring(forces, body1, station1, body2, station2, k, x0);
Public Member Functions | |
GeneralForceSubsystem () | |
GeneralForceSubsystem (MultibodySystem &) | |
ForceIndex | adoptForce (Force &force) |
Attach a new force to this subsystem. | |
int | getNForces () const |
Get the number of Forces which have been added. | |
const Force & | getForce (ForceIndex index) const |
Get a const reference to a Force by index. | |
Force & | updForce (ForceIndex index) |
Get a modifiable reference to a Force by index. | |
Public Attributes | |
GeneralForceSubsystem | |
ForceSubsystem |
GeneralForceSubsystem | ( | MultibodySystem & | ) | [explicit] |
ForceIndex adoptForce | ( | Force & | force | ) |
Attach a new force to this subsystem.
The subsystem takes over ownership of the force, leaving the passed in handle as a reference to it.
int getNForces | ( | ) | const |
Get the number of Forces which have been added.
Reimplemented from ForceSubsystem.