![]() |
VR-Forces Developer's Guide
|
DtGroundClampingUpdater is a scene object updater that is given a position and orientation, and depending on how it is configured, updates a scene object with a position and orientation that are clamped to the underlying terrain.

Public Types | |
| enum | GroundClampingMode { ClampNone = 0, ClampOrientation = 1, ClampPosition = 2, ClampUpright = 4, ClampOrientationAndPosition = ClampOrientation | ClampPosition, ClampOrientationAndUpright = ClampOrientation | ClampUpright, ClampPositionAndUpright = ClampPosition | ClampUpright, ClampAll = ClampOrientation | ClampPosition | ClampUpright } |
Public Types inherited from makVrv::DtTickable | |
| enum | TickableListState { TickableNotOnList, TickableOnMainList, TickableOnThreadSafeList } |
Public Member Functions | |
| DtGroundClampingUpdater (DtDe &de, DtUniqueID id) | |
| virtual | ~DtGroundClampingUpdater () |
| virtual void | update (DtTime tNow) |
| virtual void | setGroundClampingEnabled (bool enabled) |
| virtual void | setMode (GroundClampingMode mode) |
| bool | isClamping () const |
| bool | isClampingUp () const |
| bool | isClampingOrientation () const |
| bool | isClampingPosition () const |
| virtual void | setCullCylinderRadiusScale (float scale) |
| virtual void | setClampAlways (bool enabled) |
| virtual void | setCheckForCulling (bool) |
| virtual void | doGroundClamp (DtTime tNow) |
| virtual void | setClampTimeThreshold (double) |
Public Member Functions inherited from makVrv::DtSceneObjectUpdater | |
| DtSceneObjectUpdater (DtDe &de, DtUniqueID id) | |
| virtual | ~DtSceneObjectUpdater () |
| virtual void | setNextUpdater (DtSceneObjectUpdater *nextUpdater) |
| virtual void | setPrevUpdater (DtSceneObjectUpdater *prevUpdater) |
| virtual bool | needsUpdate (DtTime tNow) |
| virtual void | updateAdaptiveTickrate (const DtVector &lastPos, const DtTime &deltaTime) |
| virtual void | setVertexToUpdate (unsigned int vertex) |
| virtual void | setInputPosition (const DtVector &position) |
| virtual void | setInputOrientation (const DtTaitBryan &orientation) |
| virtual void | setOutputPosition (const DtVector &position) |
| virtual DtVector | outputPosition () const |
| virtual void | setOutputOrientation (const DtTaitBryan &orientation) |
| virtual DtTaitBryan | outputOrientation () const |
| virtual void | setOutputPositionAndOrientation (const DtVector &position, const DtTaitBryan &orientation) |
| virtual DtTime | lastUpdateTime () const |
| virtual void | setSceneObject (DtSceneObject *sceneObject, bool addToTickableMgrIfHead) |
| virtual void | setSceneObject (DtSceneObject *sceneObject) |
| DtUniqueID | uniqueId () const |
| DtSceneObjectUpdater * | findNextUpdater () const |
| DtSceneObjectUpdater * | findPrevUpdater () const |
| virtual bool | isChainThreadSafe (DtSceneObjectUpdater *firstUpdater) |
| virtual DtSceneObjectUpdater * | chainHead () |
| virtual void | setIsThreadSafe (bool safe) |
| virtual void | setTickableEnabled (bool enabled) override |
| virtual void | setAdaptiveTickLodEnabled (bool enabled) |
| virtual bool | adaptiveTickLodEnabled () const override |
| virtual void | setLodScaleSpeedFactor (float factor) |
| virtual float | lodScaleSpeedFactor () const |
| virtual void | setLodRadiusStart (float ratius) |
| virtual float | lodRadiusStart () const |
| virtual void | setLodRadiusEnd (float ratius) |
| virtual float | lodRadiusEnd () const |
| virtual void | setNearLodUpdateRate (int nearRate) |
| virtual int | nearLodUpdateRate () const |
| virtual void | setFarLodUpdateRate (int maxRate) |
| virtual int | farLodUpdateRate () const |
| DtSceneObject * | findActiveSceneObject () |
| DtSceneObject *const | findActiveSceneObject () const |
| DtSceneObject * | findSceneObjectForModelSet (DtModelSetId modelSet) |
| DtSceneObject *const | findSceneObjectForModelSet (DtModelSetId modelSet) const |
| virtual void | addSceneObjectToUpdate (DtModelSetId modelSet, DtSceneObject *sceneObject, bool addToTickableMgrIfHead=true) |
| virtual void | removeSceneObjectToUpdate (DtModelSetId modelSet, DtSceneObject *sceneObject) |
| virtual void | addSceneObjectToUpdateAtChainEnd (DtModelSetId modelSet, DtSceneObject *sceneObject, bool addToTickableMgrIfHead=true) |
| virtual void | removeSceneObjectToUpdateAtChainEnd (DtModelSetId modelSet, DtSceneObject *sceneObject) |
Public Member Functions inherited from makVrv::DtTickable | |
| virtual bool | updateIfNeeded (DtTime tNow) |
| virtual | ~DtTickable () |
| virtual bool | isThreadSafe () const |
| virtual void | setTickableListState (TickableListState safeList) |
| virtual TickableListState | tickableListState () const |
| virtual void | setUpdatePeriod (unsigned int period) |
| virtual unsigned int | updatePeriod () const |
Protected Member Functions | |
| bool | computeGroundClampingHit (const DtVector &up, const DtVector &unclampedPosition, DtVector &hitLocation, DtVector &hitNormal) |
| void | computeIntersectionOrigin (const DtVector &up, const DtVector &unclampedPosition, DtVector &origin) const |
| bool | needClampThisTick () const |
| bool | targetIsMoving (const DtVector &newPos, const DtVector &lastPos) const |
| bool | targetIsTurning (const DtTaitBryan &newOri, const DtTaitBryan &lastOri) const |
| bool | checkCulling (const DtVector &up) const |
| void | clampToWater (DtTime tNow) |
| virtual void | setNextUpdaterWithoutManagerPlacement (DtSceneObjectUpdater *updater) |
| virtual void | slot_coordinateSystemChanged () |
Protected Member Functions inherited from makVrv::DtSceneObjectUpdater | |
| virtual void | removeThreadSafeChainFromManager (DtSceneObjectUpdater *head) |
| virtual void | removeUnThreadSafeChainFromManager (DtSceneObjectUpdater *head) |
| virtual void | addThreadSafeChainToManager (DtSceneObjectUpdater *head) |
| virtual void | addUnThreadSafeChainToManager (DtSceneObjectUpdater *head) |
| virtual void | placeChainOnCorrectTickableList (DtSceneObjectUpdater *head) |
| virtual void | slot_sceneObjectToBeDeleted (const DtUniqueID &id) |
Protected Member Functions inherited from makVrv::DtTickable | |
| DtTickable (DtTickableManagerInterface *manager) | |
| DtTickable ()=delete | |
| virtual void | slot_managerAboutToBeDeleted () |
Static Protected Member Functions | |
| static void | computePerpendicularRotation (const DtVector &pos, const DtVector &hitNormal, const DtTaitBryan &orientation, DtTaitBryan &output) |
| static double | angleDifference (double prev, double curr) |
Static Protected Attributes | |
| static const double | theClampTimeThreshold |
| static const double | theMaxCacheInterval |
| static const double | theClampDistThreshold |
| static const double | theClampOrientThreshold |
| static const double | theIsectLength |
Friends | |
| class | DtSurfaceClampingUpdater |
Additional Inherited Members | |
Public Attributes inherited from makVrv::DtSceneObjectUpdater | |
| boost::signalslib::signal < void(const DtUniqueID &) > | signal_updaterToBeDeleted |
Protected Types inherited from makVrv::DtSceneObjectUpdater | |
| using | ModelSetToSceneObjectMap = std::map< DtModelSetId, DtSceneObject * > |
| using | SceneObjectConnectionsMap = std::unordered_map< DtUniqueID, boost::signalslib::connection > |
| makVrv::DtGroundClampingUpdater::DtGroundClampingUpdater | ( | DtDe & | de, |
| DtUniqueID | id | ||
| ) |
CTOR.
|
virtual |
DTOR.
|
virtual |
Calls doGroundClamp()
Reimplemented from makVrv::DtSceneObjectUpdater.
|
virtual |
Set whether this updater is enabled. A disabled updater will not ground clamp.
|
virtual |
Set the type of ground clamping to do.
| bool makVrv::DtGroundClampingUpdater::isClamping | ( | ) | const |
Determine if clamping is enabled, we're close enough, etc.
|
inline |
Check to see if the mode supports clamping up.
|
inline |
Check to see if the mode supports clamping orientation.
|
inline |
Check to see if the mode supports clamping position.
|
virtual |
Set the scale multiplier used to determine whether or not to cull the target according to its distance from the eye-point.
Calculates a cylinder with radius equal to the target's bounding radius multiplied by the scale factor and infinite length, oriented along the local up vector. If the eye-point is outside of that cylinder, the target will not be ground clamped.
|
virtual |
When enabled, this causes clamping every frame (use judiciously)
|
virtual |
When enabled check for object culling.
|
virtual |
do the actual clamping. Called by update() Returns true if the object was ground clamped.
|
virtual |
Sets the threshold for ground clamping by sim time. Any number < 0 will prevent updating based purely on simtime only. Default is 3 seconds. Set time in seconds.
|
staticprotected |
Find an orientation perpendicular to the normal vector.
|
protected |
Compute the location and normal ground clamping hit for the current position returns true if a hit was achieved.
|
protected |
Get the position to use as object origin when ground clamping.
|
protected |
Determine if we need to clamp this tick, or can use the last clamp.
|
protected |
Determine if our position has changed since the last time we were clamped.
|
protected |
Determine if our orientation has changed since the last time we were clamped.
|
protected |
Check to see if the object is culled.
|
protected |
|
protectedvirtual |
|
protectedvirtual |
slot for when the coordinate system changes
|
staticprotected |
compensating for rollover issues
|
friend |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Object is not ground clamped if the camera is farther away than this times the object's bounding radius.
|
protected |
The type of clamping this updater is doing.
|
protected |
Ground clamping optimization variables.
|
protected |
Ground clamping state.
|
protected |
Always clamp regardless of time.
|
protected |
Was the unclamped position outside the cull cylinder last frame.
|
protected |
Whether or not to check to see if object is culled. Default is true.
|
protected |
|
protected |
|
protected |
|
protected |