Om
1.0.0
A universal framework for multimedia simulation
|
A class that applies a damped spring force between two physics objects. More...
#include <omPhysicsSpring.h>
Public Member Functions | |
Spring () | |
Create a new spring with no objects attached. More... | |
Spring (ObjectState *newObject1, ObjectState *newObject2, const Vector3f &newLocalR1, const Vector3f &newLocalR2) | |
Create a new spring attachment between the specified objects at the given local points. More... | |
Spring (RigidObject *newObject1, RigidObject *newObject2, const Vector3f &newLocalR1, const Vector3f &newLocalR2) | |
Create a new spring attachment between the specified objects at the given local points. More... | |
RigidObject * | getObject1 () const |
Return a pointer to first object that is affected by the spring. More... | |
RigidObject * | getObject2 () const |
Return a pointer to second object that is affected by the spring. More... | |
void | setObject1 (RigidObject *newObject1) |
Set a pointer to first object that is affected by the spring. More... | |
void | setObject2 (RigidObject *newObject2) |
Set a pointer to second object that is affected by the spring. More... | |
ObjectState * | getObjectState1 () const |
Return a pointer to first object state that is affected by the spring. More... | |
ObjectState * | getObjectState2 () const |
Return a pointer to second object state that is affected by the spring. More... | |
void | setObjectState1 (ObjectState *newObjectState1) |
Set a pointer to first object state that is affected by the spring. More... | |
void | setObjectState2 (ObjectState *newObjectState2) |
Set a pointer to second object state that is affected by the spring. More... | |
const Vector3f & | getLocalPoint1 () const |
Return the spring's attachment point on the first object in its local space. More... | |
const Vector3f & | getLocalPoint2 () const |
Return the spring's attachment point on the second object in its local space. More... | |
void | setLocalPoint1 (const Vector3f &newLocalPoint1) |
Set the spring's attachment point on the first object in its local space. More... | |
void | setLocalPoint2 (const Vector3f &newLocalPoint2) |
Set the spring's attachment point on the second object in its local space. More... | |
Float | getRestLength () const |
Return the rest length of this spring in meters. More... | |
void | setRestLength (Float newRestLength) |
Set the rest length of this spring in meters. More... | |
Float | getStiffness () const |
Return the stiffness constant of this spring (kg/s^2). More... | |
void | setStiffness (Float newStiffness) |
Set the stiffness constant of this spring (kg/s^2). More... | |
Float | getDamping () const |
Return the damping constant of this spring. More... | |
void | setDamping (Float newDamping) |
Set the damping constant of this spring. More... | |
virtual void | applyForce (Float dt) |
Apply force vectors to all objects that this Force effects. More... | |
virtual Bool | setContext (PhysicsContext *newContext) |
Set a pointer to the physics context this force field should use to do simulation. More... | |
virtual Bool | addSceneObjects (PhysicsSceneID sceneID) |
Add internal context objects to the scene with the specified ID. More... | |
Public Member Functions inherited from om::physics::forces::Force | |
virtual | ~Force () |
Destory this force object. More... | |
const ForceType & | getType () const |
Return an object representing the type of this Force. More... | |
Public Member Functions inherited from om::physics::context::PhysicsSceneObject | |
virtual Bool | addSceneObjects (PhysicsSceneID sceneID) |
Add internal context objects to the scene with the specified ID. More... | |
virtual Bool | removeSceneObjects (PhysicsSceneID sceneID) |
Remove internal context objects from the scene with the specified ID. More... | |
Public Member Functions inherited from om::physics::context::PhysicsContextObject | |
virtual | ~PhysicsContextObject () |
Destory this physics context object. More... | |
PhysicsContext * | getContext () const |
Return a pointer to the physics context this context object is using to do simulation. More... | |
Bool | clearContext () |
Clear the previous context from this object. More... | |
Static Public Attributes | |
static const ForceType | TYPE |
A force type object that represents the type of a spring. More... | |
Static Public Attributes inherited from om::physics::forces::Force | |
static const ResourceType | RESOURCE_TYPE |
The resource type for a force. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from om::physics::forces::Force | |
Force (const ForceType *newType) | |
Create a Force object that has the specified type. More... | |
Protected Member Functions inherited from om::physics::context::PhysicsContextObject | |
PhysicsContextObject () | |
Create a new physics context object that doesn't have an associated physics context. More... | |
PhysicsContextObject (PhysicsContext *newContext) | |
Create a new physics context object that uses the specified context for simulation. More... | |
Protected Attributes inherited from om::physics::context::PhysicsContextObject | |
PhysicsContext * | context |
A pointer to the physics context this object is using. More... | |
A class that applies a damped spring force between two physics objects.
om::physics::forces::Spring::Spring | ( | ) |
Create a new spring with no objects attached.
om::physics::forces::Spring::Spring | ( | ObjectState * | newObject1, |
ObjectState * | newObject2, | ||
const Vector3f & | newLocalR1, | ||
const Vector3f & | newLocalR2 | ||
) |
Create a new spring attachment between the specified objects at the given local points.
om::physics::forces::Spring::Spring | ( | RigidObject * | newObject1, |
RigidObject * | newObject2, | ||
const Vector3f & | newLocalR1, | ||
const Vector3f & | newLocalR2 | ||
) |
Create a new spring attachment between the specified objects at the given local points.
|
inline |
Return a pointer to first object that is affected by the spring.
|
inline |
Return a pointer to second object that is affected by the spring.
void om::physics::forces::Spring::setObject1 | ( | RigidObject * | newObject1 | ) |
Set a pointer to first object that is affected by the spring.
void om::physics::forces::Spring::setObject2 | ( | RigidObject * | newObject2 | ) |
Set a pointer to second object that is affected by the spring.
|
inline |
Return a pointer to first object state that is affected by the spring.
|
inline |
Return a pointer to second object state that is affected by the spring.
|
inline |
Set a pointer to first object state that is affected by the spring.
|
inline |
Set a pointer to second object state that is affected by the spring.
|
inline |
Return the spring's attachment point on the first object in its local space.
If the object is invalid (e.g. NULL), the point is assumed to be in world space.
|
inline |
Return the spring's attachment point on the second object in its local space.
If the object is invalid (e.g. NULL), the point is assumed to be in world space.
|
inline |
Set the spring's attachment point on the first object in its local space.
If the object is invalid (e.g. NULL), the point is assumed to be in world space.
|
inline |
Set the spring's attachment point on the second object in its local space.
If the object is invalid (e.g. NULL), the point is assumed to be in world space.
|
inline |
Return the rest length of this spring in meters.
|
inline |
Set the rest length of this spring in meters.
The new rest length is clamped to be greater than or equal to zero.
|
inline |
Return the stiffness constant of this spring (kg/s^2).
|
inline |
Set the stiffness constant of this spring (kg/s^2).
The new stiffness constant is clamped to be greater than or equal to zero.
|
inline |
Return the damping constant of this spring.
|
inline |
Set the damping constant of this spring.
The new damping constant is clamped to be greater than or equal to zero.
|
virtual |
Apply force vectors to all objects that this Force effects.
These force vectors should be based on the internal configuration of the force system.
Implements om::physics::forces::Force.
|
virtual |
Set a pointer to the physics context this force field should use to do simulation.
Reimplemented from om::physics::context::PhysicsContextObject.
|
virtual |
Add internal context objects to the scene with the specified ID.
|
static |
A force type object that represents the type of a spring.