![]() |
VR-Forces 4.8 Class Documentation
|
Implementation of a buoyancy model using RK4 integration. More...

Classes | |
| struct | Acceleration |
| Second derivative of the simulation's motion state. More... | |
| struct | AppliedForce |
| struct | BuoyancySample |
| Defines a buoyancy sample point. More... | |
| struct | Derivative |
| First and second derivatives of the simulation's motion state. More... | |
| struct | State |
| Motion state of the simulation. More... | |
Public Types | |
| typedef std::vector < BuoyancySample * > | BuoyancySampleVec |
Public Member Functions | |
| DtRk4MotionModel (makVrv::DtDe &de) | |
| CTOR. More... | |
| virtual | ~DtRk4MotionModel () |
| DTOR. More... | |
| void | tick (double dt) |
| Tick the physics simulation. More... | |
| DtVector | velocity () const |
| Get the object's linear velocity in world coordinates. More... | |
| DtVector | position () const |
| Get the object's position in world coordinates. More... | |
| DtTaitBryan | orientation () const |
| Get the object's orientation in world coordinates. More... | |
| void | setPosition (const DtVector &position) |
| Set the object's position in world coordinates. More... | |
| void | setOrientation (const DtTaitBryan &orientation) |
| Set the object's orientation in world coordinates. More... | |
| void | setTargetOrientation (const DtTaitBryan &orientation) |
| Set the resting orientation of the object in world coordinates. More... | |
| void | setSpeed (double speed) |
| Set the forward speed of the object. More... | |
| void | sink () |
| Start simulated sinking. More... | |
| void | unsink () |
| Restore the object to the water surface. More... | |
| bool | isSinking () |
| Returns whether the model is currently sinking. More... | |
| void | setSinkingSpeedScale (double scale) |
| Allow the user to vary the speed at which ships sink. More... | |
| double | sinkingSpeedScale () const |
| Get the current sinking speed scale. More... | |
| void | setRotationalInertia (double pitchInertia, double rollInertia) |
| Set roll and pitch inertia coefficients in entity local coordinates. More... | |
| void | applyForce (const DtVector &offset, const DtVector &force) |
| apply a force at offset (in entity coordinatess) for the next frame More... | |
| void | applyHeadingTorque (double magnitude) |
| Apply a torque around the up vector for the next frame. More... | |
| void | applyRollTorque (double magnitude) |
| Apply a torque around the forward vector for the next frame. More... | |
| void | addBuoyancySample (BuoyancySample *bs) |
| Add a buoyancy sample point to the simulated object. More... | |
| BuoyancySampleVec & | buoyancySamples () |
| Get a list of the sample points. More... | |
| void | setOrigin (const DtVector &pos) |
| Set an origin point in world coordinates for the simulation to use for its topo coordinate system. More... | |
| DtVector | origin () const |
| Get the origin of the simulation's topo system in world coordinates. More... | |
| void | moveOrigin (const DtVector &pos) |
| Move the origin of the simulation's topo system to a new origin, in world coordinates. More... | |
Static Public Attributes | |
| static const double | theTimeStep |
| time step for the motion model in seconds (currently 1/60 of a second) More... | |
| static const double | theGeocentricWaterLineNudge |
| adjustment for geocentric terrains for all buoyant objects. More... | |
Private Member Functions | |
| DtVector | worldPos (const DtVector &bodyOffset) const |
| Convert local position offset into world position. More... | |
| DtTaitBryan | worldOri (const DtTaitBryan &bodyOffset) const |
| Convert local pitch/roll offset into world orientation. More... | |
| DtVector | localPos (const DtVector &pos) const |
| Convert world position offset into local position. More... | |
| DtTaitBryan | localOri (const DtTaitBryan &ori) const |
| Convert world orientation into local hrp. More... | |
| virtual void | slot_coordinateSystemChanged () |
| Update the cached coordinate converter. More... | |
| Derivative | evaluate (const State &initial, double dt, const Derivative &d) |
| Compute the derivatives from the passed in motion state and initial derivatives, over time step dt. More... | |
| Acceleration | acceleration (const State &initial, double dt) |
| Compute the second derivatives for the passed in motion state over time step dt. More... | |
Friends | |
| struct | BuoyancySample |
Additional Inherited Members | |
Protected Types inherited from makVrv::DtSignalConnectionManager | |
| typedef std::vector < boost::signalslib::connection > | Connections |
| A collection of signals. More... | |
| typedef std::vector < boost::signalslib2::connection > | Connections2 |
Protected Member Functions inherited from makVrv::DtSignalConnectionManager | |
| bool | blockConnection (int index, bool blocked) |
| Blocks/unblocks connections. More... | |
| bool | connectionBlocked (int index) const |
| check whether connections are blocked. More... | |
| DtSignalConnectionManager () | |
| CTOR. More... | |
| virtual | ~DtSignalConnectionManager () |
| DTOR. More... | |
| void | manageConnection (const boost::signalslib::connection &conn) |
| Connect a signal. More... | |
| void | manageConnection (const boost::signalslib2::connection &conn) |
| DtSignalConnectionManager & | operator+= (const boost::signalslib::connection &conn) |
| Connect a signal. More... | |
| DtSignalConnectionManager & | operator+= (const boost::signalslib2::connection &conn) |
| bool | blockConnections (bool blocked) |
| Blocks/unblocks connections. More... | |
| int | numberOfConnections () const |
| Get the number of connections. More... | |
| void | disconnectSignals () |
| Disconnect all signals. More... | |
| bool | connectionsBlocked () const |
| check whether connections are blocked. More... | |
Protected Attributes inherited from makVrv::DtSignalConnectionManager | |
| Connections | myConnections |
| The connected signals. More... | |
| Connections2 | myConnections2 |
| bool | myConnectionsBlocked |
| bool | myIndiviualConnectionedBlocked |
| std::vector < boost::signalslib2::shared_connection_block * > | mySharedConnectionsBlockManager |
| blocking Connections manager for signal2 connection More... | |
Implementation of a buoyancy model using RK4 integration.
Basic usage is to attach buoyancy floats, set position/orientation, and tick every frame.
| typedef std::vector<BuoyancySample*> makVrv::DtRk4MotionModel::BuoyancySampleVec |
| makVrv::DtRk4MotionModel::DtRk4MotionModel | ( | makVrv::DtDe & | de | ) |
CTOR.
|
virtual |
DTOR.
| void makVrv::DtRk4MotionModel::tick | ( | double | dt | ) |
Tick the physics simulation.
Internally this runs multiple fixed time steps until the full dt has been ticked through.
| DtVector makVrv::DtRk4MotionModel::velocity | ( | ) | const |
Get the object's linear velocity in world coordinates.
| DtVector makVrv::DtRk4MotionModel::position | ( | ) | const |
Get the object's position in world coordinates.
| DtTaitBryan makVrv::DtRk4MotionModel::orientation | ( | ) | const |
Get the object's orientation in world coordinates.
| void makVrv::DtRk4MotionModel::setPosition | ( | const DtVector & | position | ) |
Set the object's position in world coordinates.
| void makVrv::DtRk4MotionModel::setOrientation | ( | const DtTaitBryan & | orientation | ) |
Set the object's orientation in world coordinates.
| void makVrv::DtRk4MotionModel::setTargetOrientation | ( | const DtTaitBryan & | orientation | ) |
Set the resting orientation of the object in world coordinates.
| void makVrv::DtRk4MotionModel::setSpeed | ( | double | speed | ) |
Set the forward speed of the object.
This overwrites the current velocity
| void makVrv::DtRk4MotionModel::sink | ( | ) |
Start simulated sinking.
| void makVrv::DtRk4MotionModel::unsink | ( | ) |
Restore the object to the water surface.
| bool makVrv::DtRk4MotionModel::isSinking | ( | ) |
Returns whether the model is currently sinking.
| void makVrv::DtRk4MotionModel::setSinkingSpeedScale | ( | double | scale | ) |
Allow the user to vary the speed at which ships sink.
| double makVrv::DtRk4MotionModel::sinkingSpeedScale | ( | ) | const |
Get the current sinking speed scale.
Set roll and pitch inertia coefficients in entity local coordinates.
apply a force at offset (in entity coordinatess) for the next frame
| void makVrv::DtRk4MotionModel::applyHeadingTorque | ( | double | magnitude | ) |
Apply a torque around the up vector for the next frame.
| void makVrv::DtRk4MotionModel::applyRollTorque | ( | double | magnitude | ) |
Apply a torque around the forward vector for the next frame.
| void makVrv::DtRk4MotionModel::addBuoyancySample | ( | BuoyancySample * | bs | ) |
Add a buoyancy sample point to the simulated object.
| BuoyancySampleVec& makVrv::DtRk4MotionModel::buoyancySamples | ( | ) |
Get a list of the sample points.
| void makVrv::DtRk4MotionModel::setOrigin | ( | const DtVector & | pos | ) |
Set an origin point in world coordinates for the simulation to use for its topo coordinate system.
Use this only for initialization; to move the origin of a running simulation, use moveOrigin instead.
| DtVector makVrv::DtRk4MotionModel::origin | ( | ) | const |
Get the origin of the simulation's topo system in world coordinates.
| void makVrv::DtRk4MotionModel::moveOrigin | ( | const DtVector & | pos | ) |
Move the origin of the simulation's topo system to a new origin, in world coordinates.
Convert local position offset into world position.
|
private |
Convert local pitch/roll offset into world orientation.
Convert world position offset into local position.
|
private |
Convert world orientation into local hrp.
|
privatevirtual |
Update the cached coordinate converter.
|
private |
Compute the derivatives from the passed in motion state and initial derivatives, over time step dt.
|
private |
Compute the second derivatives for the passed in motion state over time step dt.
|
friend |
|
static |
time step for the motion model in seconds (currently 1/60 of a second)
|
static |
adjustment for geocentric terrains for all buoyant objects.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |