1 #ifndef SimTK_SIMBODY_FORCE_GRAVITY_H_
2 #define SimTK_SIMBODY_FORCE_GRAVITY_H_
126 Real zeroHeight = 0);
157 const Vec3& gravity);
218 Gravity& setDefaultGravityVector(
const Vec3& gravity);
234 {
return setDefaultDownDirection(
UnitVec3(down)); }
246 Gravity& setDefaultMagnitude(Real g);
256 Gravity& setDefaultZeroHeight(Real zeroHeight);
270 Vec3 getDefaultGravityVector()
const;
273 const UnitVec3& getDefaultDownDirection()
const;
275 Real getDefaultMagnitude()
const;
278 Real getDefaultZeroHeight()
const;
318 bool isExcluded)
const;
352 const Vec3& down)
const
353 {
return setDownDirection(state,
UnitVec3(down)); }
364 const Gravity& setMagnitude(
State& state, Real g)
const;
375 const Gravity& setZeroHeight(
State& state, Real hz)
const;
397 Vec3 getGravityVector(
const State& state)
const;
413 Real getMagnitude(
const State& state)
const;
422 Real getZeroHeight(
const State& state)
const;
448 Real getPotentialEnergy(
const State& state)
const;
487 {
return getBodyForces(state)[mobod]; }
513 long long getNumEvaluations()
const;
518 bool isForceCacheValid(
const State& state)
const;
523 void invalidateForceCache(
const State& state)
const;
534 #endif // SimTK_SIMBODY_FORCE_GRAVITY_H_
This is the base class from which all Force element handle classes derive.
Definition: Force.h:50
This is for arrays indexed by mobilized body number within a subsystem (typically the SimbodyMatterSu...
UnitVec< Real, 1 > UnitVec3
Definition: UnitVec.h:41
This is the Vector class intended to appear in user code.
Definition: BigMatrix.h:186
This force element represents a uniform gravitational field applied to a set of bodies.
Definition: Force_Gravity.h:67
const Gravity & setDownDirection(State &state, const Vec3 &down) const
Convenience overload that takes the down direction as a Vec3 and normalizes it (throwing away the mag...
Definition: Force_Gravity.h:351
Gravity & setDefaultDownDirection(const Vec3 &down)
Convenience overload that takes the down direction as a Vec3 and normalizes it (throwing away the mag...
Definition: Force_Gravity.h:233
This is the handle class for the hidden State implementation.
Definition: State.h:264
Includes internal headers providing declarations for the basic SimTK Core classes, including Simmatrix.
#define SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(DERIVED, DERIVED_IMPL, PARENT)
Definition: PrivateImplementation.h:343
const SpatialVec & getBodyForce(const State &state, MobilizedBodyIndex mobod) const
Convenience method to extract the gravitational force on just one body; see getBodyForces() to get th...
Definition: Force_Gravity.h:486
Gravity()
Default constructor creates an empty handle.
Definition: Force_Gravity.h:188
This is a concrete subsystem which can apply arbitrary forces to a MultibodySystem.
Definition: GeneralForceSubsystem.h:47
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:72
This subsystem contains the bodies ("matter") in the multibody system, the mobilizers (joints) that d...
Definition: SimbodyMatterSubsystem.h:130