20 #include <osg/Matrixd>
26 #include <unordered_map>
39 class DtCoordinateConverter;
41 class DtTerrainPatchObject;
42 class DtAgentUpdateResolverInterface;
43 class DtIntersectorsContainer;
44 class DtCoordinateSystem;
56 TerrainResultNoData = 0,
81 virtual void tick(
double simTime );
84 virtual void tickAttachment();
91 virtual double altitude()
const;
93 virtual void setNameAndRegister(
const std::string& name );
100 virtual void setCameraPositionAndOrientation(
const osg::Vec3d& position,
101 const osg::Quat& rotation );
103 virtual void getCameraPositionAndOrientation( osg::Vec3d& position,
104 osg::Quat& rotation )
const;
106 virtual void getCameraPositionAndOrientation( DtVector& position,
110 static void matrixdToTaitBryan(
const osg::Matrixd& mat, DtTaitBryan& tb,
bool isWorld2D =
false );
111 static double clampUnity(
double x );
121 virtual void startMoveObserverRight();
124 virtual void stopMoveObserverRight();
125 virtual void moveObserverRight(
double meters );
128 virtual void startMoveObserverForward();
131 virtual void stopMoveObserverForward();
132 virtual void moveObserverForward(
double meters );
136 virtual void startMoveObserverUp();
139 virtual void stopMoveObserverUp();
140 virtual void moveObserverUp(
double meters );
144 virtual void startMoveObserverLeft();
147 virtual void stopMoveObserverLeft();
148 virtual void moveObserverLeft(
double meters );
152 virtual void startMoveObserverBack();
155 virtual void stopMoveObserverBack();
156 virtual void moveObserverBack(
double meters );
160 virtual void startMoveObserverDown();
163 virtual void stopMoveObserverDown();
164 virtual void moveObserverDown(
double meters );
168 virtual void startMoveLevelObserverRight();
172 virtual void stopMoveLevelObserverRight();
173 virtual void moveLevelObserverRight(
double meters );
177 virtual void startMoveLevelObserverForward();
181 virtual void stopMoveLevelObserverForward();
182 virtual void moveLevelObserverForward(
double meters );
186 virtual void startMoveLevelObserverUp();
190 virtual void stopMoveLevelObserverUp();
191 virtual void moveLevelObserverUp(
double meters );
195 virtual void startMoveLevelObserverLeft();
199 virtual void stopMoveLevelObserverLeft();
200 virtual void moveLevelObserverLeft(
double meters );
204 virtual void startMoveLevelObserverBack();
208 virtual void stopMoveLevelObserverBack();
209 virtual void moveLevelObserverBack(
double meters );
213 virtual void startMoveLevelObserverDown();
216 virtual void stopMoveLevelObserverDown();
217 virtual void moveLevelObserverDown(
double meters );
221 virtual void startMoveAttachedRight();
224 virtual void stopMoveAttachedRight();
225 virtual void moveAttachedRight(
double meters );
228 virtual void startMoveAttachedForward();
231 virtual void stopMoveAttachedForward();
232 virtual void moveAttachedForward(
double meters );
236 virtual void startMoveAttachedUp();
239 virtual void stopMoveAttachedUp();
240 virtual void moveAttachedUp(
double meters );
244 virtual void startMoveAttachedLeft();
247 virtual void stopMoveAttachedLeft();
248 virtual void moveAttachedLeft(
double meters );
252 virtual void startMoveAttachedBack();
255 virtual void stopMoveAttachedBack();
256 virtual void moveAttachedBack(
double meters );
260 virtual void startMoveAttachedDown();
263 virtual void stopMoveAttachedDown();
264 virtual void moveAttachedDown(
double meters );
268 virtual void startMoveLevelAttachedRight();
272 virtual void stopMoveLevelAttachedRight();
273 virtual void moveLevelAttachedRight(
double meters );
277 virtual void startMoveLevelAttachedForward();
281 virtual void stopMoveLevelAttachedForward();
282 virtual void moveLevelAttachedForward(
double meters );
286 virtual void startMoveLevelAttachedUp();
290 virtual void stopMoveLevelAttachedUp();
291 virtual void moveLevelAttachedUp(
double meters );
295 virtual void startMoveLevelAttachedLeft();
299 virtual void stopMoveLevelAttachedLeft();
300 virtual void moveLevelAttachedLeft(
double meters );
304 virtual void startMoveLevelAttachedBack();
308 virtual void stopMoveLevelAttachedBack();
309 virtual void moveLevelAttachedBack(
double meters );
313 virtual void startMoveLevelAttachedDown();
316 virtual void stopMoveLevelAttachedDown();
317 virtual void moveLevelAttachedDown(
double meters );
321 virtual void startMoveAttachedContextRight();
324 virtual void stopMoveAttachedContextRight();
325 virtual void moveAttachedContextRight(
double meters );
329 virtual void startMoveAttachedContextForward();
332 virtual void stopMoveAttachedContextForward();
333 virtual void moveAttachedContextForward(
double meters );
337 virtual void startMoveAttachedContextUp();
340 virtual void stopMoveAttachedContextUp();
341 virtual void moveAttachedContextUp(
double meters );
345 virtual void startMoveAttachedContextLeft();
348 virtual void stopMoveAttachedContextLeft();
349 virtual void moveAttachedContextLeft(
double meters );
353 virtual void startMoveAttachedContextBack();
356 virtual void stopMoveAttachedContextBack();
357 virtual void moveAttachedContextBack(
double meters );
361 virtual void startMoveAttachedContextDown();
363 virtual void stopMoveAttachedContextDown();
364 virtual void moveAttachedContextDown(
double meters );
368 virtual void startYawLeft();
371 virtual void stopYawLeft();
372 virtual void rotateYawLeft(
double rads);
376 virtual void startYawRight();
380 virtual void stopYawRight();
381 virtual void rotateYawRight(
double rads);
385 virtual void startPitchUp();
388 virtual void stopPitchUp();
389 virtual void rotatePitchUp(
double rads );
390 virtual void rotateFlashlightPitchUp(
double rads );
394 virtual void startPitchDown();
397 virtual void stopPitchDown();
398 virtual void rotatePitchDown(
double rads );
399 virtual void rotateFlashlightPitchDown(
double rads );
403 virtual void startRollLeft();
406 virtual void stopRollLeft();
407 virtual void rollLeft(
double rads);
411 virtual void startRollRight();
414 virtual void stopRollRight();
415 virtual void rollRight(
double rads);
419 virtual void startLevelYawLeft();
422 virtual void stopLevelYawLeft();
426 virtual void startLevelYawRight();
430 virtual void stopLevelYawRight();
434 virtual void startLevelPitchUp();
437 virtual void stopLevelPitchUp();
438 virtual void rotateLevelPitchUp(
double rads);
442 virtual void startLevelPitchDown();
445 virtual void stopLevelPitchDown();
446 virtual void rotateLevelPitchDown(
double rads);
450 virtual void startLevelRollLeft();
453 virtual void stopLevelRollLeft();
454 virtual void rollLevelLeft(
double rads);
458 virtual void startLevelRollRight();
461 virtual void stopLevelRollRight();
462 virtual void rollLevelRight(
double rads);
465 virtual void rotateLevelYawLeft(
double rads );
466 virtual void rotateLevelYawRight(
double rads );
467 virtual void rotateFlashlightYawLeft(
double rads );
468 virtual void rotateFlashlightYawRight(
double rads );
470 virtual void startLookLeft();
471 virtual void stopLookLeft();
472 virtual void lookLeft(
double rads );
474 virtual void startLookRight();
475 virtual void stopLookRight();
476 virtual void lookRight(
double rads );
478 virtual void startLookUp();
479 virtual void stopLookUp();
480 virtual void lookUp(
double rads );
482 virtual void startLookDown();
483 virtual void stopLookDown();
484 virtual void lookDown(
double rads );
486 virtual void startLookTiltRight();
487 virtual void stopLookTiltRight();
488 virtual void lookTiltRight(
double rads );
490 virtual void startLookTiltLeft();
491 virtual void stopLookTiltLeft();
492 virtual void lookTiltLeft(
double rads );
495 virtual void startOrbitingLeft();
498 virtual void stopOrbitingLeft();
499 virtual void orbitLeft(
double rads );
503 virtual void startOrbitingRight();
506 virtual void stopOrbitingRight();
507 virtual void orbitRight(
double rads );
511 virtual void startOrbitingUp();
514 virtual void stopOrbitingUp();
515 virtual void orbitUp(
double rads );
519 virtual void startOrbitingDown();
522 virtual void stopOrbitingDown();
523 virtual void orbitDown(
double rads );
527 virtual void setLocation(
double x,
double y,
double z);
532 virtual void setAttachedLocation(
double x,
double y,
double z )
override;
533 virtual void setAttachedX(
double x )
override;
534 virtual void setAttachedY(
double y )
override;
535 virtual void setAttachedZ(
double z )
override;
536 virtual void getAttachedPosition(
double& x,
double& y,
double& z )
const override;
539 virtual void setOrientation(
double psi,
double theta,
double phi );
542 virtual void setTopographicOrientation(
double psi,
double theta,
double phi );
545 virtual void setOrientation(
double x,
double y,
double z,
double w);
548 virtual void setAttachedOrientation(
double psi,
double theta,
double phi )
override;
549 virtual void setAttachedYaw(
double psi)
override;
550 virtual void setAttachedPitch(
double theta)
override;
551 virtual void setAttachedRoll(
double phi)
override;
553 virtual void getAttachedOrientation(
double& psi,
double& theta,
double& phi)
const override;
555 virtual void getAttachedOrientationByDecomp(
double& psi,
double& theta,
double& phi)
const;
558 virtual void setAttachedOrientation(
double x,
double y,
double z,
563 void setLocalModelScalingEnabled(
bool enabled );
567 void setLocalModelScalingAmount(
float amount );
571 virtual void jumpTo(
double x,
double y,
double z );
576 virtual void orientTo(
double x,
double y,
double z );
579 virtual void dragTerrain(
double lastX,
double lastY,
double lastZ,
580 double currX,
double currY,
double currZ );
582 virtual void dragTerrain2(
double myStartDragX,
double myStartDragY,
583 double myStartDragZ,
int deltaMouseX,
int deltaMouseY );
585 virtual void dragGravityUp(
double windowUnits );
586 virtual void dragGravityDown(
double windowUnits );
587 virtual void dragGravityLeft(
double windowUnits );
588 virtual void dragGravityRight(
double windowUnits );
589 virtual void scrollObserverForward(
int wheelUnits );
590 virtual void scrollObserverBack(
int wheelUnits );
591 virtual void scrollLevelObserverForward(
int wheelUnits );
592 virtual void scrollLevelObserverBack(
int wheelUnits );
594 virtual void scrollFlashlightWider(
int wheelUnits );
595 virtual void scrollFlashlightNarrower(
int wheelUnits );
598 virtual float flashlightAngle();
602 virtual void startIncreasingViewResolution();
603 virtual void stopIncreasingViewResolution();
604 virtual void increaseViewResolution();
606 virtual void startDecreasingViewResolution();
607 virtual void stopDecreasingViewResolution();
608 virtual void decreaseViewResolution();
611 virtual void setViewResolution(
double resolution);
614 virtual double viewResolution()
const;
621 virtual void setCurrentViewMagnification(
double mag );
624 virtual double currentViewMagnification()
const;
633 virtual void setOrbitSpeed(
double speed );
636 virtual void setLinearSpeed(
double speed );
639 virtual void setRotationSpeed(
double speed );
642 virtual void setMinLinearSpeed(
double minSpeed );
645 virtual void setMaxLinearSpeed(
double maxSpeed );
648 virtual void setLinearScaledSpeedGain(
double gain );
655 virtual void gotoTerrainCenter(
DtUniqueID terrainPatch,
bool retry );
658 virtual void resetAttachment();
660 virtual void resetOrientation();
663 virtual void resetCamera();
664 virtual void level();
666 virtual void stopAll();
668 virtual void attachToObjects(
const std::vector<DtUniqueID>& elementIds );
669 virtual void setSecondaryAttachment(
const std::vector<DtUniqueID>& elementIds );
670 virtual void setLocationTrackAttachment(
const osg::Vec3d& location );
671 virtual void setLocationTrackAttachment(
double x,
double y,
double z );
673 virtual void attachToPart(
int partId);
674 virtual void detach();
676 virtual void setHideModelOnAttach(
bool hide );
680 virtual void setUsesBoundingVolumeForAttachedOffsets(
bool useBoundingVolume);
684 virtual bool usesBoundingVolumeForAttachedOffsets()
const;
689 virtual void setAttachmentHas3DCockpit(
bool cockpit );
691 virtual void scaleCurrentAttachments(
bool scaled );
692 virtual void setOrientToTargetConstraint(
bool orient );
693 virtual void setOrbiting(
bool orbit );
694 virtual void setOrientCameraToTargetConstraint(
bool orient );
696 virtual void setConstrainToTerrain(
bool trueFalse );
697 virtual void setConstrainToCenter(
bool trueFalse );
701 virtual void suppressConstrainToTerrain(
bool trueFalse );
703 virtual void setSpeedScaling(
bool trueFalse );
706 virtual void setSpeedScaledSpeed(
double speed );
709 virtual void getLocation(
double &x,
double &y,
double& z)
const;
711 virtual void getObserverPosition(
double &x,
double &y,
double& z)
const;
712 virtual void getEffectiveLocation(
double &x,
double &y,
double& z)
const;
716 virtual void getObserverCameraPosition(
double& x,
double& y,
double& z)
const;
719 virtual void getOrientation(
double& psi,
double& theta,
double& phi )
const;
723 virtual void getObserverCameraOrientation(
double& psi,
double& theta,
double& phi,
bool includeShake)
const;
726 virtual void getTopographicOrientation(
double& psi,
double& theta,
double& phi )
const;
728 virtual void getOrientation(
double& x,
double& y,
double& z,
double& w )
const;
730 virtual void getFlashlightOrientation(
double& x,
double& y,
double& z,
double& w )
const;
734 virtual void getObserverPlatformFront(
double& x,
double& y,
double& z)
const;
738 virtual void getObserverPlatformUp(
double& x,
double& y,
double& z)
const;
742 virtual void getObserverPlatformRight(
double& x,
double& y,
double& z)
const;
746 virtual void getObserverCameraFront(
double& x,
double& y,
double& z,
bool includeShake)
const;
749 virtual void getObserverCameraUp(
double& x,
double& y,
double& z,
bool includeShake)
const;
752 virtual void getObserverCameraRight(
double& x,
double& y,
double& z,
bool includeShake)
const;
754 virtual void getCameraUp(
double& x,
double& y,
double& z);
756 virtual void getCameraFront(
double& x,
double& y,
double& z);
758 virtual void getCameraRight(
double& x,
double& y,
double& z);
761 virtual void setCameraShakeRotation(
double x,
double y,
double z,
double w);
764 virtual void getCameraShakeRotation(
double& x,
double& y,
double& z,
double& w);;
773 virtual double heightAboveTerrainFromCurrentZoom(
double magnification = 1.)
const;
778 virtual double altitudeFromCurrentZoom(
double magnification=1.)
const;
782 virtual double zoomFromHeightAboveTerrain(
double hat,
double magnification=1)
const;
786 virtual double zoomFromAltitude(
double altitude,
double magnification=1.)
const;
792 virtual double zoomFromCurrentAltitude()
const;
796 virtual double topographicHeading()
const;
799 virtual void getLinearVelocity(
double &x,
double &y,
double &z)
const;
802 virtual void getRotationalVelocity(
double& x,
double& y,
double& z)
const;
807 virtual void setModeSetting(
int setting,
bool value );
814 virtual std::vector<DtUniqueID> currentAttachments()
const;
819 virtual const osg::Vec3d& locationTrackAttachmentVec3d()
const;
820 virtual void getLocationTrackAttachment(
double& x,
double& y,
double& z )
const;
834 virtual bool attachedObjectHidden()
const;
839 virtual bool attachmentHas3DCockpit()
const;
843 virtual osg::Vec3d attachedOffsetVector()
const;
849 virtual double attachedNearClipOffset()
const;
852 virtual double heightAboveTerrain()
const;
855 virtual double heightOfTerrain()
const;
866 virtual bool shouldOrientToGlobeCenter();
869 virtual void adjustToGlobeCurvature();
872 virtual bool shouldRotateGlobe();
874 virtual void calcObserverWorldVectors();
875 virtual const osg::Vec3d& observerWorldUp()
const;
876 virtual const osg::Vec3d& observerWorldNorth()
const;
877 virtual const osg::Vec3d& observerWorldEast()
const;
879 virtual const osg::Vec3d& attachedWorldUp()
const;
881 virtual osg::Vec3d& observerUp();
882 virtual osg::Vec3d& observerFront();
883 virtual osg::Vec3d& observerRight();
884 virtual void observerBasis(osg::Vec3d& up, osg::Vec3d& front, osg::Vec3d& right);
886 virtual osg::Vec3d& attachedUp();
887 virtual osg::Vec3d& attachedFront();
888 virtual osg::Vec3d& attachedRight();
890 virtual osg::Vec3d& attachedOffsetUp();
891 virtual osg::Vec3d& attachedOffsetFront();
892 virtual osg::Vec3d& attachedOffsetRight();
895 virtual osg::Vec3d& levelAttachedUp();
896 virtual osg::Vec3d& levelAttachedFront();
897 virtual osg::Vec3d& levelAttachedRight();
900 virtual osg::Vec3d& levelObserverMimicUp();
901 virtual osg::Vec3d& levelObserverMimicFront();
902 virtual osg::Vec3d& levelObserverMimicRight();
904 virtual osg::Vec3d& cameraUp();
905 virtual osg::Vec3d& cameraFront();
906 virtual osg::Vec3d& cameraRight();
908 virtual osg::Vec3d& levelObserverUp();
909 virtual osg::Vec3d& levelObserverFront();
910 virtual osg::Vec3d& levelObserverRight();
912 virtual void advanceOrbitLeft(
double rads );
913 virtual void advanceOrbitRight(
double rads );
914 virtual void advanceOrbitUp(
double rads );
915 virtual void advanceOrbitDown(
double rads );
917 virtual void makeLevelObserverMatrix();
920 virtual void calculateLevelAttachedRotation();
923 virtual void makeLevelObserverMimicMatrix();
928 virtual osg::Vec3d calcWorldPositionChange();
930 virtual osg::Vec3d calcMimicPositionChange();
932 virtual osg::Vec3d calcAttachedPosition(
const osg::Quat& attInverse,
const osg::Vec3d& attachedAdvance);
933 virtual osg::Vec3d calcAttachedAdvance(
const osg::Quat& tetherTrackInverse);
935 virtual osg::Vec3d calcFollowPositionChange();
936 virtual osg::Vec3d calcSpaceFollowPositionChange();
937 virtual osg::Vec3d calcTetherPositionChange();
938 virtual osg::Vec3d calcTetherTrackPositionChange();
940 virtual osg::Vec3d calcTrackPositionChange();
941 virtual osg::Quat calcTetherTrackRotation();
943 virtual osg::Quat calcFlashlightOrientationChange();
944 virtual osg::Quat calcWorldOrientationChange();
945 virtual osg::Quat calcTetherOrientationChange();
946 virtual osg::Quat calcMimicOrientationChange();
947 virtual osg::Quat calcFollowOrientationChange();
949 virtual void setCurrentAttachmentsVisibility(
bool visible );
960 virtual void orientTo(
const osg::Vec3d& target );
963 virtual void orientCameraTo(
const osg::Vec3d& target );
965 virtual TerrainResult getTerrainCenter(
const DtUniqueID& patchID, osg::Vec3d& center );
970 virtual void initializeAttachment();
972 virtual const osg::Vec3d& scalingIntersection()
const;
973 virtual void getViewIntersection();
976 virtual double linearSpeed();
979 virtual double speedScalingGain()
const;
981 virtual void calcTerrainConstraint(
const osg::Vec3d& prev );
988 virtual bool updateAttachPositionAndOrientation();
990 virtual bool getSecondaryAttachPosition( osg::Vec3d& position );
992 virtual void getObserverOffsetVector(
double& x,
double& y,
double& z )
const;
993 virtual void setObserverOffsetVector(
double x,
double y,
double z );
998 virtual void getCameraFromParentOffsetVector(
double& x,
double& y,
double& z )
const;
999 virtual void getCameraFromParentRotationOffset(
double& x,
double& y,
double& z,
double& w )
const;
1002 virtual void getAttachedRotationOffset(
double& x,
double& y,
double& z,
double& w )
const;
1003 virtual void setAttachedRotationOffset(
double x,
double y,
double z,
1007 osg::Vec3& bvolExtents, osg::Vec3d& bvolCenter );
1010 osg::Vec3& bvolExtents, osg::Vec3d& bvolCenter );
1012 virtual void setLocation(
const osg::Vec3d& location,
bool suppress=
true );
1014 virtual bool isMoving()
const;
1015 virtual bool isRotating()
const;
1017 virtual double computeNearClipDistance(
DtSceneObject* sceneObject );
1018 virtual float computeLocalModelScalingAmount(
DtSceneObject* sceneObject );
1020 virtual void calcScaledSpeed();
1021 virtual bool getTerrainOrPropIntersection(
const osg::Vec3d& startPos,
1031 virtual void getPositionAndOrientation(
DtSceneObject& sceneObject, osg::Vec3d& position,
1032 osg::Vec3d& orientToPosition, osg::Quat& orientation );
1034 virtual void getPositionAndOrientation(
DtTerrainPatchObject& patchObject, osg::Vec3d& position,
1035 osg::Vec3d& orientToPosition, osg::Quat& orientation );
1037 virtual void getPositionAndOrientation(
DtOsgObserverObject& observerObject, osg::Vec3d& position,
1038 osg::Vec3d& orientToPosition, osg::Quat& orientation );
1041 virtual void getPositionFromSceneObject(
DtSceneObject& sceneObject, osg::Vec3d& position )
const;
1044 virtual void getPositionFromObserverObject(
DtOsgObserverObject& observerObject, osg::Vec3d& position )
const;
1048 virtual bool getPartPositionOriFromSceneObject(
DtSceneObject& sceneObject,
1049 int partId, osg::Vec3d& position, osg::Quat& ori )
const;
1053 virtual void force2D();
1056 virtual void dimensionChanged(
bool is2D );
1057 virtual void setIs2D(
bool is2D );
1060 virtual double calculate3DAltitude()
const;
1063 virtual void calculateAltitude();
1067 virtual void synchronizeLocation(
double x,
double y,
double z );
1071 virtual void synchronizeOrientation(
double x,
double y,
double z,
double w );
1088 virtual void calcHeightAboveTerrain(
bool force=
false);
1091 std::list<DtChannel*> findChannels();
1094 std::list<const DtChannel*> findChannels()
const;
1105 virtual double frustumPixelHeight()
const;
1108 virtual void slot_coordinateSystemChanged();
1111 virtual void cache3DOffsetAndRotation();
1114 virtual void restoreAttachOffsetsFrom3DCache();
1119 virtual void slot_dateChanged();
1123 virtual bool getAttachedToBoundingVolume(
DtSceneObject*
const sceneObject, osg::Vec3d& boundingVolumeCenter, osg::Vec3& boundingVolumeExtents,
1124 double& maxOffset,
double& maxExtent);
1128 virtual bool setupAttachOffsetsAfterReset(
DtSceneObject*
const sceneObject, osg::Vec3d boundingVolumeCenter, osg::Vec3 boundingVolumeExtents,
1129 double maxOffset,
double maxExtent);
1134 virtual void setupAttachOffsets(
double maxExtent);
1138 virtual void reinitializeAfterBoundingVolumeChange();
1142 virtual void resetAfterBoundingVolumeChange();
1284 if(moving(Right)) myAdvance[0] += linearDistance;
1285 if(moving(Left)) myAdvance[0] -= linearDistance;
1286 if(moving(Forward)) myAdvance[1] += linearDistance;
1287 if(moving(Backward)) myAdvance[1] -= linearDistance;
1288 if(moving(Up)) myAdvance[2] += linearDistance;
1289 if(moving(Down)) myAdvance[2] -= linearDistance;
1301 myAdvance.set(0.0,0.0,0.0);
1302 myEuler.set(0.0,0.0,0.0);
1307 myAdvance.set(0.0,0.0,0.0);
1312 return myState == Stopped;
1317 return myState != Stopped;
1322 return (myState & d) != 0;
1327 myState = moving ? myState | d : myState & ~d;
1342 if(rotating(YawRight)) myEuler[0] -=
angle;
1343 if(rotating(YawLeft)) myEuler[0] +=
angle;
1344 if(rotating(PitchUp)) myEuler[1] +=
angle;
1345 if(rotating(PitchDown)) myEuler[1] -=
angle;
1346 if(rotating(RollRight)) myEuler[2] +=
angle;
1347 if(rotating(RollLeft)) myEuler[2] -=
angle;
1362 myEuler.set(0.0,0.0,0.0);
1367 return myState != Stopped;
1372 return (myState & d) != 0;
1377 myState = rotating ? myState | d : myState & ~d;
osg::Quat myCameraRotation
This is the camera (wrt the observer) as a quaternion.
Definition: DtOsgObserverObject.h:1443
osg::Vec3d myDragMove
Change in world position due to drag.
Definition: DtOsgObserverObject.h:1208
osg::Vec3d myMutableDownIntersect
Definition: DtOsgObserverObject.h:1522
Definition: DtOsgObserverObject.h:57
bool myHaveViewIntersect
Definition: DtOsgObserverObject.h:1518
void setRotating(Angle d, bool rotating)
Definition: DtOsgObserverObject.h:1375
ElementVisibilityMap myPendingVisibilityState
Definition: DtOsgObserverObject.h:1545
bool myAttachmentHas3DCockpit
Definition: DtOsgObserverObject.h:1484
osg::Vec3d myLevelObserverMimicUp
Definition: DtOsgObserverObject.h:1469
osg::Vec3d myAttachedWorldEast
Definition: DtOsgObserverObject.h:1451
bool myHave3DOffsetCache
Definition: DtOsgObserverObject.h:1249
int myOrientToTargetConstraint
This is an int rather than a bool because we increment/decrement it, much like a reference pointer...
Definition: DtOsgObserverObject.h:1500
osg::Vec3d myObserverUp
Definition: DtOsgObserverObject.h:1453
double myHeightOfTerrain
Definition: DtOsgObserverObject.h:1554
std::vector< DtUniqueID > myCurrentAttachments
Definition: DtOsgObserverObject.h:1165
double myStartGotoTerrainCenterTime
Definition: DtOsgObserverObject.h:1550
static const unsigned int FlagSupportOff
Is this node part of support (whether or not other scene objects can ground clamp to this model) ...
Definition: DtOsgNodeTraversalFlags.h:22
osg::Quat myLevelAttachedRotation
Definition: DtOsgObserverObject.h:1239
osg::Vec3d myAttachedOffsetUp
Definition: DtOsgObserverObject.h:1473
osg::Vec3d myAttachedOffsetRight
Definition: DtOsgObserverObject.h:1475
osg::Vec3d myOrbitAdvance
Definition: DtOsgObserverObject.h:1212
DtCoordinateConverter is the base class for 'local (cig) to geocentric' converters.
Definition: DtCoordinateConverter.h:25
osg::Vec3d myCameraRight
Definition: DtOsgObserverObject.h:1479
osg::Vec3d myCameraUp
Definition: DtOsgObserverObject.h:1477
double myHeightAboveTerrain
Definition: DtOsgObserverObject.h:1553
double myMaxLinearSpeed
Need just these, for terrain scaling.
Definition: DtOsgObserverObject.h:1413
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
double myLinearSpeed
Definition: DtOsgObserverObject.h:1409
This form is used for doing level ('flying carpet') style movements.
Definition: DtOsgObserverObject.h:1261
osg::Vec3d myLevelAttachedFront
Definition: DtOsgObserverObject.h:1466
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
bool myOrbitingLeft
Definition: DtOsgObserverObject.h:1403
osg::Vec3d myObserverPosition
Change in observer position this frame.
Definition: DtOsgObserverObject.h:1198
Contains makVrv:DtOsgNodeTraversalFlags class.
Utility class that contains intersectors for all model sets in the system (3d, xr, 2d) Use an object of this class when all models sets can be possibly needed. When you know which model set you need, you can just use the DtIntersectorCreator to create an intersector for a model set Models sets corresponding to 3d, xr and 2d are created by default (these correspond to values of 0, 1 and 5) Additional model sets can be registered with DtIntersectorsContainer::registerModelSet.
Definition: DtIntersectorsContainer.h:37
MotionState myFlashlightRotatingState
Definition: DtOsgObserverObject.h:1401
osg::Vec3d myLocationAttachPoint
Definition: DtOsgObserverObject.h:1568
osg::Vec3d my2DTo3DCachedObserverOffsetVector
Definition: DtOsgObserverObject.h:1245
osg::Vec3d myLevelAttachedPosition
Definition: DtOsgObserverObject.h:1205
double mySceneCenterOffsetX
Definition: DtOsgObserverObject.h:1418
void level()
Definition: DtOsgObserverObject.h:1360
bool mySpeedScaling
Definition: DtOsgObserverObject.h:1485
bool myViewResolutionDecreasingState
Definition: DtOsgObserverObject.h:1537
osg::Vec3d myLevelObserverFront
Definition: DtOsgObserverObject.h:1458
double myViewResolution
Definition: DtOsgObserverObject.h:1538
bool myLookingUp
Definition: DtOsgObserverObject.h:1427
osg::Vec3d myAttachedOffsetFront
Definition: DtOsgObserverObject.h:1474
osg::Matrixd myLevelObserverRotationMatrix
Definition: DtOsgObserverObject.h:1242
bool myOrbitingUp
Definition: DtOsgObserverObject.h:1405
static const double theCenterConstrainHeight
Definition: DtOsgObserverObject.h:1152
void applyMovement(double linearDistance)
Update the advance based upon the movement.
Definition: DtOsgObserverObject.h:1282
std::unordered_map< DtElementID, bool > ElementVisibilityMap
Definition: DtOsgObserverObject.h:1544
TerrainResult
Definition: DtOsgObserverObject.h:54
bool myOrbitingDown
Definition: DtOsgObserverObject.h:1406
bool myInternalSuppressConstrainToTerrain
suppress when jumping...
Definition: DtOsgObserverObject.h:1491
osg::Vec3d myObserverWorldUp
Definition: DtOsgObserverObject.h:1445
bool rotating(Angle d) const
Definition: DtOsgObserverObject.h:1370
osg::Vec3d myAttachedWorldNorth
Definition: DtOsgObserverObject.h:1450
osg::Vec3d myLevelObserverRight
Definition: DtOsgObserverObject.h:1459
bool myHaveTerrainPivot
Definition: DtOsgObserverObject.h:1516
const osg::Vec3d & advance() const
Get the current movement advance.
Definition: DtOsgObserverObject.h:1293
osg::Vec3d myAttachedFront
Definition: DtOsgObserverObject.h:1462
osg::Vec3d myLevelAttachedUp
Definition: DtOsgObserverObject.h:1465
osg::Quat myAttachedRotationOffset
My Attached rotation offset.
Definition: DtOsgObserverObject.h:1221
osg::Quat myPreviousAttachedObserverRotation
This is here so we can be in tether attach mode, detach, then attach to another entity and have a rea...
Definition: DtOsgObserverObject.h:1236
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
double mySpeedScaleHeightEquivalent
Definition: DtOsgObserverObject.h:1559
MotionState myAbsoluteLevelRotatingState
Definition: DtOsgObserverObject.h:1399
osg::Quat my2DTo3DCachedObserverRotationOffset
Definition: DtOsgObserverObject.h:1247
unsigned char myState
Definition: DtOsgObserverObject.h:1388
bool myLookingTiltLeft
Definition: DtOsgObserverObject.h:1430
DtSignalConnectionManager myConnections
Definition: DtOsgObserverObject.h:1572
double myLinearScaledSpeedGain
Definition: DtOsgObserverObject.h:1415
osg::Vec3d myObserverPositionVector
— Observer
Definition: DtOsgObserverObject.h:1180
bool myLookingLeft
Definition: DtOsgObserverObject.h:1426
osg::Vec3d myPreviousOffsetVector
Definition: DtOsgObserverObject.h:1531
bool myGotoTerrainCenterPending
Definition: DtOsgObserverObject.h:1548
A DtTerrainPatchObject contains the methods for loading a file as a terrain. When loading a file as a...
Definition: DtTerrainPatchObject.h:35
static const double theHeightAboveTerrainUpdatePeriod
Definition: DtOsgObserverObject.h:1147
bool myOrientToOnReset
Definition: DtOsgObserverObject.h:1502
bool myViewResolutionIncreasingState
Currently for 2D only, these variables will be ignored if projecting in 3D mode.
Definition: DtOsgObserverObject.h:1536
osg::Vec3d myObserverWorldEast
Definition: DtOsgObserverObject.h:1447
double mySceneCenterOffsetZ
Definition: DtOsgObserverObject.h:1420
MotionState myRotatingState
Definition: DtOsgObserverObject.h:1396
const osg::Vec3d & euler() const
Definition: DtOsgObserverObject.h:1350
osg::Matrixd myLevelObserverMimicRotationMatrix
Definition: DtOsgObserverObject.h:1241
double myAltitude
Definition: DtOsgObserverObject.h:1533
osg::Quat myAttachedRotation
Definition: DtOsgObserverObject.h:1238
osg::Vec3d myLevelObserverMimicFront
Definition: DtOsgObserverObject.h:1470
osg::Vec3d mySavedObserverOffsetVector
Used for switching between track mode and other attached modes.
Definition: DtOsgObserverObject.h:1195
osg::Vec3d myMasterPositionVector
Definition: DtOsgObserverObject.h:1182
bool myExternalSuppressConstrainToTerrain
suppress when told to
Definition: DtOsgObserverObject.h:1494
float myFlashlightAngle
Definition: DtOsgObserverObject.h:1564
bool myHideModelOnAttach
Definition: DtOsgObserverObject.h:1483
double myAttachedRoll
Definition: DtOsgObserverObject.h:1171
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
bool myMovedSinceLastHAT
Definition: DtOsgObserverObject.h:1563
bool myLocalModelScalingEnabled
Definition: DtOsgObserverObject.h:1188
bool moving() const
Definition: DtOsgObserverObject.h:1315
Contains makVrv::DtObserverObject class declaration.
bool myChanged
Definition: DtOsgObserverObject.h:1173
void applyRotation(double angle)
Definition: DtOsgObserverObject.h:1340
int myPartAttachment
Definition: DtOsgObserverObject.h:1167
osg::Quat myFinalCameraRotation
This is the combined camera/observer orientation; this is what the DtOsgChannel uses to orient itself...
Definition: DtOsgObserverObject.h:1434
Direction
Definition: DtOsgObserverObject.h:1265
This abstract base class defines the interface for OS-specific keyboard and mouse event listeners...
Definition: DtObserverObject.h:35
MotionState myAttachedObserverState
Definition: DtOsgObserverObject.h:1393
static const double theMaxTerrainRetryTime
Definition: DtOsgObserverObject.h:1149
MotionState myRotatingLevelState
Definition: DtOsgObserverObject.h:1397
osg::Vec3d my2DTo3DCachedObserverPosition
Definition: DtOsgObserverObject.h:1244
osg::Quat myMasterRotation
Definition: DtOsgObserverObject.h:1225
double myAttachedYaw
Definition: DtOsgObserverObject.h:1169
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtSignalConnectionManager myAttachmentBoundingVolumeSignals
Definition: DtOsgObserverObject.h:1163
osg::Vec3d myLastSpeedPositionVector
Definition: DtOsgObserverObject.h:1181
osg::Vec3d myLevelObserverUp
Definition: DtOsgObserverObject.h:1457
Contains makVrv::DtQuat class.
DtUniqueID myPendingTerrainPatchId
Definition: DtOsgObserverObject.h:1551
bool rotating() const
Definition: DtOsgObserverObject.h:1365
DtObserverObject::AttachType my3DAttachType
Definition: DtOsgObserverObject.h:1481
NorthType
Definition: DtObserverObject.h:62
double myHeightAboveTerrainTimer
Definition: DtOsgObserverObject.h:1486
double mySceneCenterOffsetY
Definition: DtOsgObserverObject.h:1419
osg::Vec3d myFinalCameraPositionVector
This is the combined camera/observer orientation; this is what the DtOsgChannel uses to orient itself...
Definition: DtOsgObserverObject.h:1438
bool myConstrainToCenter
This variable is true when the bounding radius is too big The reset view will be from far away trying...
Definition: DtOsgObserverObject.h:1256
bool myIsChangingDimension
Definition: DtOsgObserverObject.h:1250
double myCurvatureAdjustment
Definition: DtOsgObserverObject.h:1562
double myNextGotoTerrainCenterTime
Definition: DtOsgObserverObject.h:1549
static const double theMinViewResolution
Definition: DtOsgObserverObject.h:1155
Angle
Definition: DtOsgObserverObject.h:1330
MotionState myAbsoluteRotatingState
Definition: DtOsgObserverObject.h:1398
osg::Vec3d myObserverRotationalVelocityVector
Definition: DtOsgObserverObject.h:1186
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
osg::Vec3d myPreviousTerrainCenter
Definition: DtOsgObserverObject.h:1552
bool myMutableHaveDownIntersect
Definition: DtOsgObserverObject.h:1521
bool myForceOrientReset
Definition: DtOsgObserverObject.h:1506
void stop()
Definition: DtOsgObserverObject.h:1298
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
bool myOrientCameraToTargetConstraint
Definition: DtOsgObserverObject.h:1501
osg::Vec3d myObserverFront
Definition: DtOsgObserverObject.h:1454
osg::Vec3d myObserverWorldNorth
Definition: DtOsgObserverObject.h:1446
MotionState myLevelObserverState
Definition: DtOsgObserverObject.h:1392
bool myLookingTiltRight
Definition: DtOsgObserverObject.h:1429
osg::Vec3d myObserverOffsetVector
Current offset from an attachment, when attached.
Definition: DtOsgObserverObject.h:1192
double myLastTickTime
Definition: DtOsgObserverObject.h:1174
osg::Vec3d myPreviousPositionVector
for backing out if we hit a constraint
Definition: DtOsgObserverObject.h:1530
void clearAdvance()
Definition: DtOsgObserverObject.h:1305
bool moving(Direction d) const
Definition: DtOsgObserverObject.h:1320
osg::Vec3d myEuler
Definition: DtOsgObserverObject.h:1386
osg::Quat myCameraShakeRot
Definition: DtOsgObserverObject.h:1566
osg::Quat myFlashlightRotation
Flashlight orientation offset as a quaternion.
Definition: DtOsgObserverObject.h:1228
Base class to provide boost signal/slot management.
osg::Vec3d myViewIntersect
Definition: DtOsgObserverObject.h:1519
osg::Quat my2DTo3DCachedObserverRotation
Definition: DtOsgObserverObject.h:1246
osg::Vec3d myLevelObserverMimicRight
Definition: DtOsgObserverObject.h:1471
bool mySyncPending
Definition: DtOsgObserverObject.h:1183
osg::Vec3d myAdvance
This, when scaled, will provide the direction that the observer should move in as the result of tick-...
Definition: DtOsgObserverObject.h:1385
bool myLookingRight
-— Camera
Definition: DtOsgObserverObject.h:1425
osg::Vec3d myAttachedUp
Definition: DtOsgObserverObject.h:1461
DT_DLL_vrfutil double mag(double x[3])
osg::Vec3d myCameraOffset
This is the camera offset wrt to observer.
Definition: DtOsgObserverObject.h:1441
osg::Quat mySavedObserverRotation
This is used for switching between track mode and other attach modes.
Definition: DtOsgObserverObject.h:1231
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:44
osg::Vec3d myLevelAttachedRight
Definition: DtOsgObserverObject.h:1467
double myRotationSpeed
Definition: DtOsgObserverObject.h:1410
double myLastAttachedBvolDiameter
Definition: DtOsgObserverObject.h:1526
bool mySyncSuppressed
Definition: DtOsgObserverObject.h:1184
void setMoving(Direction d, bool moving)
Definition: DtOsgObserverObject.h:1325
double myMinLinearSpeed
Definition: DtOsgObserverObject.h:1414
osg::Quat myObserverRotation
This is our ENU observer orientation as a quaternion.
Definition: DtOsgObserverObject.h:1224
double myAttachedPitch
Definition: DtOsgObserverObject.h:1170
Contains DLL export macros.
double myLastAttachBvolOffset
Definition: DtOsgObserverObject.h:1527
MotionState myObserverState
Definition: DtOsgObserverObject.h:1391
osg::Vec3d myObserverLinearVelocityVector
Definition: DtOsgObserverObject.h:1185
float myLocalModelScalingAmount
Definition: DtOsgObserverObject.h:1189
osg::Vec3d myAttachedWorldUp
Definition: DtOsgObserverObject.h:1449
bool stopped()
Definition: DtOsgObserverObject.h:1310
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
std::vector< DtUniqueID > mySecondaryAttachments
Definition: DtOsgObserverObject.h:1166
osg::Vec3d myAttachPosition
Definition: DtOsgObserverObject.h:1524
A utility Quaternion class.
Definition: DtQuat.h:19
osg::Vec3d myOrientToPosition
Definition: DtOsgObserverObject.h:1210
bool myOrbitingRight
Definition: DtOsgObserverObject.h:1404
double myLastViewMagnification
Definition: DtOsgObserverObject.h:1542
osg::Vec3d myAttachedPosition
Definition: DtOsgObserverObject.h:1203
double myOrbitSpeed
Definition: DtOsgObserverObject.h:1408
static const double theMaxViewResolution
Definition: DtOsgObserverObject.h:1158
MotionState myLevelAttachedObserverState
Definition: DtOsgObserverObject.h:1394
DtModelSetId
Definition: DtModelSetEnums.h:19
bool myConstrainToTerrain
Definition: DtOsgObserverObject.h:1488
bool myUsesBoundingVolumeForAttachedOffsets
Whether or not the observer is using bounding volumes for attached offsets. This is all the time for ...
Definition: DtOsgObserverObject.h:1514
double myCurrentViewMagnification
Only used in 3D.
Definition: DtOsgObserverObject.h:1541
osg::Vec3d myObserverRight
Definition: DtOsgObserverObject.h:1455
bool myOrbiting
Definition: DtOsgObserverObject.h:1503
osg::Vec3d myCameraFront
Definition: DtOsgObserverObject.h:1478
bool myLookingDown
Definition: DtOsgObserverObject.h:1428
This abstract base class defines the interface for OS-specific keyboard and mouse event listeners...
Definition: DtOsgObserverObject.h:49
osg::Vec3d myLevelObserverPosition
Gravity change in observer position this frame.
Definition: DtOsgObserverObject.h:1201
double myCurrentObserverDistance
largest of the distances currently in play in a given frame. This is how far we'll advance...
Definition: DtOsgObserverObject.h:1218
double mySpeedScaleSpeed
Definition: DtOsgObserverObject.h:1416
static const double theObserverBoundingSphere
Definition: DtOsgObserverObject.h:1146
osg::Vec3d myAttachedRight
Definition: DtOsgObserverObject.h:1463
osg::Vec3d & euler()
Definition: DtOsgObserverObject.h:1355
AttachType
Definition: DtObserverObject.h:42
MotionState()
Definition: DtOsgObserverObject.h:1276