VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
makVrv::DtGroundClampingUpdater Class Reference

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. More...

Inheritance diagram for makVrv::DtGroundClampingUpdater:
Inheritance graph
[legend]

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
}
 Ground Clamping Modes. More...
 
- Public Types inherited from makVrv::DtTickable
enum  TickableListState { TickableNotOnList, TickableOnMainList, TickableOnThreadSafeList }
 Enumeration used to indicate which DtTickableManager's tickable list the tickable is on, if any. More...
 

Public Member Functions

 DtGroundClampingUpdater (DtDe &de, DtUniqueID id)
 CTOR. More...
 
virtual ~DtGroundClampingUpdater ()
 DTOR. More...
 
virtual void update (DtTime tNow)
 Calls doGroundClamp() More...
 
virtual void setEnabled (bool enabled)
 Set whether this updater is enabled. More...
 
virtual void setMode (GroundClampingMode mode)
 Set the type of ground clamping to do. More...
 
bool isClamping () const
 Determine if clamping is enabled, we're close enough, etc. More...
 
bool isClampingUp () const
 Check to see if the mode supports clamping up. More...
 
bool isClampingOrientation () const
 Check to see if the mode supports clamping orientation. More...
 
bool isClampingPosition () const
 Check to see if the mode supports clamping position. More...
 
virtual void setCullCylinderRadiusScale (float scale)
 Set the scale multiplier used to determine whether or not to cull the target according to its distance from the eye-point. More...
 
virtual void setClampAlways (bool enabled)
 When enabled, this causes clamping every frame (use judiciously) More...
 
virtual void setCheckForCulling (bool)
 When enabled check for object culling. More...
 
virtual void doGroundClamp (DtTime tNow)
 do the actual clamping. More...
 
virtual void setClampTimeThreshold (double)
 Sets the threshold for ground clamping by sim time. More...
 
- Public Member Functions inherited from makVrv::DtSceneObjectUpdater
 DtSceneObjectUpdater (DtDe &de, DtUniqueID id)
 CTOR. More...
 
virtual ~DtSceneObjectUpdater ()
 Virtual DTOR. More...
 
virtual void setNextUpdater (DtSceneObjectUpdater *nextUpdater)
 Set the next updater in the updater chain. More...
 
virtual void setPrevUpdater (DtSceneObjectUpdater *prevUpdater)
 Set the previous updater in the updater chain. More...
 
virtual bool needsUpdate (DtTime tNow)
 The check function called by DtTickableManager to verify if an update is required. More...
 
virtual void updateAdaptiveTickrate (const DtVector &lastPos, const DtTime &deltaTime)
 This is called by the update function after all the original chaining updates happen. More...
 
virtual void setVertexToUpdate (unsigned int vertex)
 Specify which vertex in the scene object this updater updates. More...
 
virtual void setInputPosition (const DtVector &position)
 Set the position input to this updater. More...
 
virtual void setInputOrientation (const DtTaitBryan &orientation)
 Set the orientation input to this updater. More...
 
virtual void setOutputPosition (const DtVector &position)
 Output the resultant position. More...
 
virtual void setOutputOrientation (const DtTaitBryan &orientation)
 Output the resultant orientation. More...
 
virtual void setOutputPositionAndOrientation (const DtVector &position, const DtTaitBryan &orientation)
 Set both the position and orientation at the same time. More...
 
virtual DtTime lastUpdateTime () const
 Get the time-stamp of the last update. More...
 
virtual void setSceneObject (DtSceneObject *sceneObject, bool addToTickableMgrIfHead)
 Set the scene object to be updated. More...
 
virtual void setSceneObject (DtSceneObject *sceneObject)
 Set the scene object to be updated. More...
 
virtual void setLodSystemEnabled (bool enabled)
 brief set if the lod update system is on for this model More...
 
virtual bool lodSystemEnabled () const
 brief gets if the lod update system is on for this model More...
 
virtual void setLodScaleSpeedFactor (float factor)
 brief sets the value that linearly adjusts the range of the lod radii by the velocity More...
 
virtual float lodScaleSpeedFactor () const
 brief gets the value that linearly adjusts the range of the lod radii by the velocity More...
 
virtual void setLodRadiusStart (float ratius)
 brief sets the near radius where the update rate starts to fall off More...
 
virtual float lodRadiusStart () const
 brief gets the near radius where the update rate starts to fall off More...
 
virtual void setLodRadiusEnd (float ratius)
 brief sets the far radius where the update rate stops falling off More...
 
virtual float lodRadiusEnd () const
 brief gets the far radius where the update rate stops falling off More...
 
virtual void setNearLodUpdateRate (int nearRate)
 sets the update rate at the near radius, defaults to every six ticks More...
 
virtual int nearLodUpdateRate () const
 brief gets the update rate at the near radius, defaults to every six ticks More...
 
virtual void setFarLodUpdateRate (int maxRate)
 brief the update rate at the far radius, defaults to every 30 ticks More...
 
virtual int farLodUpdateRate () const
 brief gets the update rate at the far radius defaults to every 30 ticks More...
 
DtUniqueID uniqueId () const
 Returns the distributed object id of this updater. More...
 
DtSceneObjectUpdaterfindNextUpdater () const
 Return the next updater in the updater chain. More...
 
DtSceneObjectUpdaterfindPrevUpdater () const
 Return the previous updater in the updater chain. More...
 
virtual bool isChainThreadSafe (DtSceneObjectUpdater *firstUpdater)
 Check all the updaters in the current chain and determine if the chain is thread safe. More...
 
virtual DtSceneObjectUpdaterchainHead ()
 Find the first updater in the chain. More...
 
virtual void setIsThreadSafe (bool safe)
 Override the DtTickable base class' method so retest the entire chain this updater belongs to. More...
 
DtSceneObjectfindSceneObject ()
 Get the current scene object for this updater. More...
 
DtSceneObject *const findSceneObject () const
 const correct version More...
 
- Public Member Functions inherited from makVrv::DtTickable
virtual bool updateIfNeeded (DtTime tNow)
 Calls needsUpdate(), and then calls update() if needsUpdate() is true. More...
 
virtual ~DtTickable ()
 Virtual DTOR. More...
 
virtual bool isThreadSafe () const
 
virtual void setTickableListState (TickableListState safeList)
 Track which tickable list (if any) this tickable is on Since the tickable constructor puts ALL tickables on the main (unThreadSafe) to start we need a way to check which list a tickable is on (and this way we can request removals from the correct list instead of having to call DtTickableManager::removeTickableObject(), which tries both lists). More...
 
virtual TickableListState tickableListState () const
 
virtual void setUpdatePeriod (unsigned int period)
 Specify how often (in # of frames) this tickable should call update. More...
 
virtual unsigned int updatePeriod () const
 

Protected Member Functions

bool computeGroundClampingHit (const DtVector &up, const DtVector &unclampedPosition, DtVector &hitLocation, DtVector &hitNormal)
 Compute the location and normal ground clamping hit for the current position returns true if a hit was achieved. More...
 
void computeIntersectionOrigin (const DtVector &up, const DtVector &unclampedPosition, DtVector &origin) const
 Get the position to use as object origin when ground clamping. More...
 
bool needClampThisTick () const
 Determine if we need to clamp this tick, or can use the last clamp. More...
 
bool targetIsMoving (const DtVector &newPos, const DtVector &lastPos) const
 Determine if our position has changed since the last time we were clamped. More...
 
bool targetIsTurning (const DtTaitBryan &newOri, const DtTaitBryan &lastOri) const
 Determine if our orientation has changed since the last time we were clamped. More...
 
bool checkCulling (const DtVector &up) const
 Check to see if the object is culled. More...
 
void clampToWater (DtTime tNow)
 
virtual void setNextUpdaterWithoutManagerPlacement (DtSceneObjectUpdater *updater)
 
- Protected Member Functions inherited from makVrv::DtSceneObjectUpdater
virtual void removeThreadSafeChainFromManager (DtSceneObjectUpdater *head)
 Helper method to remove an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) from the DtTickableManager's thread-safe tickable list. More...
 
virtual void removeUnThreadSafeChainFromManager (DtSceneObjectUpdater *head)
 Helper method to remove an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) from the DtTickableManager's un-thread-safe tickable list. More...
 
virtual void addThreadSafeChainToManager (DtSceneObjectUpdater *head)
 Helper method to add an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) to the DtTickableManager's thread-safe tickable list. More...
 
virtual void addUnThreadSafeChainToManager (DtSceneObjectUpdater *head)
 Helper method to add an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) to the DtTickableManager's un-thread-safe tickable list. More...
 
virtual void placeChainOnCorrectTickableList (DtSceneObjectUpdater *head)
 Examines the chain for the given head updater, removes the head from the approriate ticable list if necessary, and then adds the head to the correct (threaded or unthreaded) tickable list. More...
 
virtual void slot_sceneObjectToBeDeleted (const DtUniqueID &id)
 
- Protected Member Functions inherited from makVrv::DtTickable
 DtTickable (DtTickableManagerInterface *manager)
 CTOR. More...
 
 DtTickable ()
 Unimplemented default CTOR. More...
 
virtual void slot_managerAboutToBeDeleted ()
 

Static Protected Member Functions

static void computePerpendicularRotation (const DtVector &pos, const DtVector &hitNormal, const DtTaitBryan &orientation, DtTaitBryan &output)
 Find an orientation perpendicular to the normal vector. More...
 
static double angleDifference (double prev, double curr)
 compensating for rollover issues More...
 

Protected Attributes

bool myHaveLastClampedPosition
 
bool myHaveLastClampedOrientation
 
DtVector myLastClampedPosition
 
DtTaitBryan myLastClampedOrientation
 
DtVector myUnclampedPosition
 
DtTaitBryan myUnclampedOrientation
 
DtVector myLastUnclampedPosition
 
DtTaitBryan myLastUnclampedOrientation
 
double myLastCacheUpdateTime
 
double myLastClampTime
 
float myCullCylinderScale
 Object is not ground clamped if the camera is farther away than this times the object's bounding radius. More...
 
GroundClampingMode myMode
 The type of clamping this updater is doing. More...
 
DtIntersectionCachemyIntersectionCache
 Ground clamping optimization variables. More...
 
bool myEnabledFlag
 Ground clamping state. More...
 
bool myClampAlwaysFlag
 Always clamp regardless of time. More...
 
bool myClampCulledLastFrame
 Was the unclamped position outside the cull cylinder last frame. More...
 
bool myCheckForCull
 Whether or not to check to see if object is culled. Default is true. More...
 
double myClampTimeThreshold
 
bool myBecameEnabledThisTick
 
- Protected Attributes inherited from makVrv::DtSceneObjectUpdater
DtDemyDe
 The display engine. More...
 
DtUniqueID myUniqueId
 This distributed object's unique identifier. More...
 
DtSceneObjectmySceneObject
 A pointer to the current scene object being updated. More...
 
int myModelSet
 This updater is registered as a modelset-specific tickable; this is the modelset it's registered with. More...
 
boost::signalslib::connection mySceneObjectConnection
 
DtSceneObjectUpdatermyNextUpdater
 The next updater in the chain (or NULL) More...
 
DtSceneObjectUpdatermyPrevUpdater
 The previous updater in the chain (or NULL) More...
 
unsigned int myVertexToUpdate
 The default scene object vertex to update. More...
 
DtVector myInputPosition
 Input position. More...
 
DtTaitBryan myInputOrientation
 Input Orientation. More...
 
bool myPositionDataOutputted
 Flag to indicate if setOutputPosition has been called this tick. More...
 
bool myOrientationDataOutputted
 Flag to indicate if setOutputOrientation has been called this tick. More...
 
UpdateLODParams myLodUpdateParams
 automatic lod system params More...
 
- Protected Attributes inherited from makVrv::DtTickable
DtTickableManagerInterfacemyManager
 Pointer to manager for removal during destruction. More...
 
DtSignalConnectionManager myConnections
 
unsigned int myFrameCounter
 
unsigned int myFrameToUpdate
 
unsigned int myUpdatePeriod
 
DtTime myLastUpdateTime
 
bool myIsThreadSafe
 
TickableListState myTickableListState
 

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::signal< void(const
DtUniqueID &) > 
signal_updaterToBeDeleted
 

Detailed Description

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.

Member Enumeration Documentation

Ground Clamping Modes.

Enumerator
ClampNone 
ClampOrientation 
ClampPosition 
ClampUpright 
ClampOrientationAndPosition 
ClampOrientationAndUpright 
ClampPositionAndUpright 
ClampAll 

Constructor & Destructor Documentation

makVrv::DtGroundClampingUpdater::DtGroundClampingUpdater ( DtDe de,
DtUniqueID  id 
)

CTOR.

virtual makVrv::DtGroundClampingUpdater::~DtGroundClampingUpdater ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtGroundClampingUpdater::update ( DtTime  tNow)
virtual

Calls doGroundClamp()

Reimplemented from makVrv::DtSceneObjectUpdater.

virtual void makVrv::DtGroundClampingUpdater::setEnabled ( bool  enabled)
virtual

Set whether this updater is enabled.

A disabled updater will not ground clamp.

virtual void makVrv::DtGroundClampingUpdater::setMode ( GroundClampingMode  mode)
virtual

Set the type of ground clamping to do.

bool makVrv::DtGroundClampingUpdater::isClamping ( ) const

Determine if clamping is enabled, we're close enough, etc.

bool makVrv::DtGroundClampingUpdater::isClampingUp ( ) const
inline

Check to see if the mode supports clamping up.

bool makVrv::DtGroundClampingUpdater::isClampingOrientation ( ) const
inline

Check to see if the mode supports clamping orientation.

bool makVrv::DtGroundClampingUpdater::isClampingPosition ( ) const
inline

Check to see if the mode supports clamping position.

virtual void makVrv::DtGroundClampingUpdater::setCullCylinderRadiusScale ( float  scale)
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 void makVrv::DtGroundClampingUpdater::setClampAlways ( bool  enabled)
virtual

When enabled, this causes clamping every frame (use judiciously)

virtual void makVrv::DtGroundClampingUpdater::setCheckForCulling ( bool  )
virtual

When enabled check for object culling.

virtual void makVrv::DtGroundClampingUpdater::doGroundClamp ( DtTime  tNow)
virtual

do the actual clamping.

Called by update() Returns true if the object was ground clamped.

virtual void makVrv::DtGroundClampingUpdater::setClampTimeThreshold ( double  )
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

static void makVrv::DtGroundClampingUpdater::computePerpendicularRotation ( const DtVector pos,
const DtVector hitNormal,
const DtTaitBryan &  orientation,
DtTaitBryan &  output 
)
staticprotected

Find an orientation perpendicular to the normal vector.

bool makVrv::DtGroundClampingUpdater::computeGroundClampingHit ( const DtVector up,
const DtVector unclampedPosition,
DtVector hitLocation,
DtVector hitNormal 
)
protected

Compute the location and normal ground clamping hit for the current position returns true if a hit was achieved.

void makVrv::DtGroundClampingUpdater::computeIntersectionOrigin ( const DtVector up,
const DtVector unclampedPosition,
DtVector origin 
) const
protected

Get the position to use as object origin when ground clamping.

bool makVrv::DtGroundClampingUpdater::needClampThisTick ( ) const
protected

Determine if we need to clamp this tick, or can use the last clamp.

bool makVrv::DtGroundClampingUpdater::targetIsMoving ( const DtVector newPos,
const DtVector lastPos 
) const
protected

Determine if our position has changed since the last time we were clamped.

bool makVrv::DtGroundClampingUpdater::targetIsTurning ( const DtTaitBryan &  newOri,
const DtTaitBryan &  lastOri 
) const
protected

Determine if our orientation has changed since the last time we were clamped.

bool makVrv::DtGroundClampingUpdater::checkCulling ( const DtVector up) const
protected

Check to see if the object is culled.

void makVrv::DtGroundClampingUpdater::clampToWater ( DtTime  tNow)
protected
virtual void makVrv::DtGroundClampingUpdater::setNextUpdaterWithoutManagerPlacement ( DtSceneObjectUpdater updater)
protectedvirtual
static double makVrv::DtGroundClampingUpdater::angleDifference ( double  prev,
double  curr 
)
staticprotected

compensating for rollover issues

Friends And Related Function Documentation

friend class DtSurfaceClampingUpdater
friend

Member Data Documentation

const double makVrv::DtGroundClampingUpdater::theClampTimeThreshold
staticprotected
const double makVrv::DtGroundClampingUpdater::theMaxCacheInterval
staticprotected
const double makVrv::DtGroundClampingUpdater::theClampDistThreshold
staticprotected
const double makVrv::DtGroundClampingUpdater::theClampOrientThreshold
staticprotected
const double makVrv::DtGroundClampingUpdater::theIsectLength
staticprotected
bool makVrv::DtGroundClampingUpdater::myHaveLastClampedPosition
protected
bool makVrv::DtGroundClampingUpdater::myHaveLastClampedOrientation
protected
DtVector makVrv::DtGroundClampingUpdater::myLastClampedPosition
protected
DtTaitBryan makVrv::DtGroundClampingUpdater::myLastClampedOrientation
protected
DtVector makVrv::DtGroundClampingUpdater::myUnclampedPosition
protected
DtTaitBryan makVrv::DtGroundClampingUpdater::myUnclampedOrientation
protected
DtVector makVrv::DtGroundClampingUpdater::myLastUnclampedPosition
protected
DtTaitBryan makVrv::DtGroundClampingUpdater::myLastUnclampedOrientation
protected
double makVrv::DtGroundClampingUpdater::myLastCacheUpdateTime
protected
double makVrv::DtGroundClampingUpdater::myLastClampTime
protected
float makVrv::DtGroundClampingUpdater::myCullCylinderScale
protected

Object is not ground clamped if the camera is farther away than this times the object's bounding radius.

GroundClampingMode makVrv::DtGroundClampingUpdater::myMode
protected

The type of clamping this updater is doing.

DtIntersectionCache* makVrv::DtGroundClampingUpdater::myIntersectionCache
protected

Ground clamping optimization variables.

bool makVrv::DtGroundClampingUpdater::myEnabledFlag
protected

Ground clamping state.

bool makVrv::DtGroundClampingUpdater::myClampAlwaysFlag
protected

Always clamp regardless of time.

bool makVrv::DtGroundClampingUpdater::myClampCulledLastFrame
protected

Was the unclamped position outside the cull cylinder last frame.

bool makVrv::DtGroundClampingUpdater::myCheckForCull
protected

Whether or not to check to see if object is culled. Default is true.

double makVrv::DtGroundClampingUpdater::myClampTimeThreshold
protected
bool makVrv::DtGroundClampingUpdater::myBecameEnabledThisTick
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)