16 #include <matrix/vlVector.h>
17 #include <matrix/vlTaitBryan.h>
21 class DtTritonManager;
22 class Dt3DLineModelInstanceSegment;
24 class DtCoordinateConverter;
151 ImpactState myImpactState;
187 DtTaitBryan
worldOri(
const DtTaitBryan& bodyOffset)
const;
193 DtTaitBryan
localOri(
const DtTaitBryan& ori)
const;
Defines a buoyancy sample point.
Definition: DtRk4MotionModel.h:99
double a_z
Definition: DtRk4MotionModel.h:238
bool myIsGeocentric
Flag to decide whether to do magic hacks during force computation.
Definition: DtRk4MotionModel.h:143
bool mySinking
Definition: DtRk4MotionModel.h:255
void applyForce(const DtVector &offset, const DtVector &force)
apply a force at offset (in entity coordinatess) for the next frame
Dt3DLineModelInstanceSegment * myDebugLine[8]
Definition: DtRk4MotionModel.h:253
double myRollInertia
Definition: DtRk4MotionModel.h:264
double myPitchInertia
Definition: DtRk4MotionModel.h:265
void setSpeed(double speed)
Set the forward speed of the object.
double dv_y
Definition: DtRk4MotionModel.h:224
void setSinkingSpeedScale(double scale)
Allow the user to vary the speed at which ships sink.
DtVector origin() const
Get the origin of the simulation's topo system in world coordinates.
Implementation of a buoyancy model using RK4 integration.
Definition: DtRk4MotionModel.h:31
DtCoordinateConverter is the base class for 'local (cig) to geocentric' converters.
Definition: DtCoordinateConverter.h:25
void setOrigin(const DtVector &pos)
Set an origin point in world coordinates for the simulation to use for its topo coordinate system...
BuoyancySample & operator=(const BuoyancySample &obj)
Assignment operator.
double dv_pitch
Definition: DtRk4MotionModel.h:228
double mySinkingSpeedScale
Definition: DtRk4MotionModel.h:262
double dv_x
Definition: DtRk4MotionModel.h:226
void setPosition(const DtVector &position)
Set the object's position in world coordinates.
double dv_heading
Definition: DtRk4MotionModel.h:232
BuoyancySample(DtDe &de, DtVector offset, double area, double extent, double density, double waterline)
CTOR.
DtTaitBryan orientation
Definition: DtRk4MotionModel.h:213
virtual ~DtRk4MotionModel()
DTOR.
DtVector position() const
Get the object's position in world coordinates.
double myForwardSpeed
Definition: DtRk4MotionModel.h:259
void addBuoyancySample(BuoyancySample *bs)
Add a buoyancy sample point to the simulated object.
Motion state of the simulation.
Definition: DtRk4MotionModel.h:209
double myWaterline
Z offset to the waterline.
Definition: DtRk4MotionModel.h:132
double mySinkingDensity
Definition: DtRk4MotionModel.h:260
bool mySinkingFloat[6]
Definition: DtRk4MotionModel.h:261
DtVector worldPos(const DtVector &bodyOffset) const
Convert local position offset into world position.
DtVector position
Definition: DtRk4MotionModel.h:211
double myRollTorque
Definition: DtRk4MotionModel.h:257
bool isSinking()
Returns whether the model is currently sinking.
BuoyancySampleVec myBuoyancySamples
Definition: DtRk4MotionModel.h:271
static const double theGeocentricWaterLineNudge
adjustment for geocentric terrains for all buoyant objects.
Definition: DtRk4MotionModel.h:178
double myWaterAltitude
Altitude of water at this sample's position; should be updated as needed.
Definition: DtRk4MotionModel.h:140
BuoyancySampleVec & buoyancySamples()
Get a list of the sample points.
void applyRollTorque(double magnitude)
Apply a torque around the forward vector for the next frame.
double sinkingSpeedScale() const
Get the current sinking speed scale.
Contains DLL export macros.
DtRk4MotionModel(makVrv::DtDe &de)
CTOR.
void setOrientation(const DtTaitBryan &orientation)
Set the object's orientation in world coordinates.
double dy
Definition: DtRk4MotionModel.h:223
DtTaitBryan localOri(const DtTaitBryan &ori) const
Convert world orientation into local hrp.
virtual void slot_coordinateSystemChanged()
Update the cached coordinate converter.
double dz
Definition: DtRk4MotionModel.h:221
DtVector myOffset
Offset from object origin in object coordinates.
Definition: DtRk4MotionModel.h:135
void sink()
Start simulated sinking.
double dpitch
Definition: DtRk4MotionModel.h:227
DtVector localPos(const DtVector &pos) const
Convert world position offset into local position.
Acceleration acceleration(const State &initial, double dt)
Compute the second derivatives for the passed in motion state over time step dt.
double a_x
Definition: DtRk4MotionModel.h:240
double dv_z
Definition: DtRk4MotionModel.h:222
friend struct BuoyancySample
Definition: DtRk4MotionModel.h:181
static const double theTimeStep
time step for the motion model in seconds (currently 1/60 of a second)
Definition: DtRk4MotionModel.h:175
double a_heading
Definition: DtRk4MotionModel.h:243
AppliedForce myAppliedForce
Definition: DtRk4MotionModel.h:252
DtVector force
Definition: DtRk4MotionModel.h:205
double computeFlatForce(const DtVector &pos, const DtVector &vel, const DtTaitBryan &ori)
Compute the net force along the object's up vector at the sample point, assuming a flat water surface...
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:24
DtVector myOriginPos
Definition: DtRk4MotionModel.h:267
double myHeadingTorque
Definition: DtRk4MotionModel.h:256
DtVector velocity
Definition: DtRk4MotionModel.h:212
DtTaitBryan worldOri(const DtTaitBryan &bodyOffset) const
Convert local pitch/roll offset into world orientation.
void tick(double dt)
Tick the physics simulation.
double dheading
Definition: DtRk4MotionModel.h:231
void setTargetOrientation(const DtTaitBryan &orientation)
Set the resting orientation of the object in world coordinates.
void unsink()
Restore the object to the water surface.
std::vector< BuoyancySample * > BuoyancySampleVec
Definition: DtRk4MotionModel.h:158
double dx
Definition: DtRk4MotionModel.h:225
DtTaitBryan orientation() const
Get the object's orientation in world coordinates.
State myState
Definition: DtRk4MotionModel.h:254
double myArea
Area of the sample in m^2.
Definition: DtRk4MotionModel.h:129
void moveOrigin(const DtVector &pos)
Move the origin of the simulation's topo system to a new origin, in world coordinates.
double myExtent
Depth extent of the sample point in meters.
Definition: DtRk4MotionModel.h:123
DtTaitBryan rotationalVelocity
Definition: DtRk4MotionModel.h:214
double droll
Definition: DtRk4MotionModel.h:229
Base class to provide boost signal/slot management.
First and second derivatives of the simulation's motion state.
Definition: DtRk4MotionModel.h:218
double a_pitch
Definition: DtRk4MotionModel.h:241
void setRotationalInertia(double pitchInertia, double rollInertia)
Set roll and pitch inertia coefficients in entity local coordinates.
double myPitchTorque
Definition: DtRk4MotionModel.h:258
DtDe & myDe
Definition: DtRk4MotionModel.h:136
Helper class to draw a styleable line segment; generates a geode containing the line segment geometry...
Definition: Dt3DLineModelInstanceSegment.h:24
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...
DtDe & myDe
Definition: DtRk4MotionModel.h:269
void applyHeadingTorque(double magnitude)
Apply a torque around the up vector for the next frame.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
double a_roll
Definition: DtRk4MotionModel.h:242
double myDensity
Density of the sample point in kg/m^3.
Definition: DtRk4MotionModel.h:126
voidpf uLong offset
Definition: ioapi.h:42
double computeForce(const DtVector &pos, const DtVector &vel, const DtDcm &ori)
Compute the net force along the object's up vector at the sample point.
double dv_roll
Definition: DtRk4MotionModel.h:230
Definition: DtRk4MotionModel.h:202
DtCoordinateConverter * myCoordinateConverter
Definition: DtRk4MotionModel.h:199
DtVector offset
Definition: DtRk4MotionModel.h:204
double a_y
Definition: DtRk4MotionModel.h:239
DtRk4MotionModel * myParent
Definition: DtRk4MotionModel.h:137
DtVector velocity() const
Get the object's linear velocity in world coordinates.
Second derivative of the simulation's motion state.
Definition: DtRk4MotionModel.h:236