This is a concrete subsystem which can apply arbitrary forces to a MultibodySystem. More...
#include <GeneralForceSubsystem.h>
Public Member Functions | |
GeneralForceSubsystem () | |
GeneralForceSubsystem (MultibodySystem &) | |
ForceIndex | adoptForce (Force &force) |
Attach a new force to this subsystem. | |
int | getNumForces () 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. | |
bool | isForceDisabled (const State &state, ForceIndex index) const |
Get whether a force is disabled. | |
void | setForceIsDisabled (State &state, ForceIndex index, bool disabled) |
Set whether a force is disabled. | |
SimTK_PIMPL_DOWNCAST (GeneralForceSubsystem, ForceSubsystem) | |
int | getNForces () const |
This is a concrete subsystem which can apply arbitrary forces to a MultibodySystem.
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);
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 [inline] |
int getNumForces | ( | ) | const |
Get the number of Forces which have been added.
bool isForceDisabled | ( | const State & | state, | |
ForceIndex | index | |||
) | const |
Get whether a force is disabled.
void setForceIsDisabled | ( | State & | state, | |
ForceIndex | index, | |||
bool | disabled | |||
) |
Set whether a force is disabled.
SimTK_PIMPL_DOWNCAST | ( | GeneralForceSubsystem | , | |
ForceSubsystem | ||||
) |