VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
makVrv::DtOverWaterUpdater Class Reference

Class to periodically check if a location is over triton dynamic ocean or not (assumed to be land). DtOverWaterUpdater uses an intersector to make this determination; if a dynamic terrain object exists and the test height is <= the current sea level height set for the dynamic ocean layer, then isOverWater() will return true. Because intersectors are computationally expensive, this class makes use of the DtTickableManager's ability to spread out ticking tickables that have an update period > 1. By default, DtOverWaterUpdater will check every 60 frames to see if its input location is over water; this can be changed by calling DtTickable::setUpdatePeriod().

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

Public Member Functions

 DtOverWaterUpdater (DtDe &de, DtUniqueID id)
 
virtual ~DtOverWaterUpdater ()
 
virtual void slot_dynamicOceanObjectsChanged ()
 
virtual bool needsUpdate (DtTime tNow)
 
virtual void update (DtTime tNow)
 
virtual void setLocalLocation (const DtVector &location)
 
virtual const DtVectorlocalLocation () const
 
virtual bool isOverWater () const
 
virtual void setIsOverWater (bool isOverWater)
 
virtual bool locationIsChanged () const
 
virtual void setLocationIsChanged (bool locationIsChanged)
 
- Public Member Functions inherited from makVrv::DtTickable
virtual bool updateIfNeeded (DtTime tNow)
 
virtual ~DtTickable ()
 
virtual void setTickableEnabled (bool enabled)
 
virtual void setIsThreadSafe (bool safe)
 
virtual bool isThreadSafe () const
 
virtual void setTickableListState (TickableListState safeList)
 
virtual TickableListState tickableListState () const
 
virtual void setUpdatePeriod (unsigned int period)
 
virtual unsigned int updatePeriod () const
 
virtual bool adaptiveTickLodEnabled () const
 

Protected Attributes

DtDemyDe
 
DtVector myLocalLocation
 
bool myLocationIsChanged
 
bool myIsOverWater
 
DtSignalConnectionManager mySignalConnections
 
- Protected Attributes inherited from makVrv::DtTickable
DtTickableManagerInterfacemyManager
 
DtSignalConnectionManager myConnections
 
unsigned int myFrameCounter
 
unsigned int myFrameToUpdate
 
unsigned int myUpdatePeriod
 
unsigned int myTickableIndex
 
DtTime myLastUpdateTime
 
bool myIsThreadSafe
 
TickableListState myTickableListState
 

Private Member Functions

 DtOverWaterUpdater ()
 

Additional Inherited Members

- Public Types inherited from makVrv::DtTickable
enum  TickableListState { TickableNotOnList, TickableOnMainList, TickableOnThreadSafeList }
 
- Protected Member Functions inherited from makVrv::DtTickable
 DtTickable (DtTickableManagerInterface *manager)
 
 DtTickable ()=delete
 
virtual void slot_managerAboutToBeDeleted ()
 

Constructor & Destructor Documentation

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

Constructor. This uses the pattern for distributable objects; although no agents are provided for this class, they could be easily added. Typically, one of these updaters is created locally by an already distributed object, such as the rotor wash updater and surface clamping updater.

virtual makVrv::DtOverWaterUpdater::~DtOverWaterUpdater ( )
virtual

Destructor.

makVrv::DtOverWaterUpdater::DtOverWaterUpdater ( )
private

(Unimplemented) Default Constructor

Member Function Documentation

virtual bool makVrv::DtOverWaterUpdater::needsUpdate ( DtTime  tNow)
virtual

DtTickable Overrides.

Called by the tickable manager to determine if the updater needs to be updated. This checks the myLocationIsChanged flag, preventing updates for non-moving objects

Reimplemented from makVrv::DtTickable.

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

If updateNeeded() returns true, this is called to do the actual update. It will set the isOverWater flag to true or false.

Implements makVrv::DtTickable.

virtual void makVrv::DtOverWaterUpdater::setLocalLocation ( const DtVector location)
virtual

Set/get the location that will be tested. This should be called each frame.

virtual const DtVector& makVrv::DtOverWaterUpdater::localLocation ( ) const
virtual

Set/get the location that will be tested. This should be called each frame.

virtual bool makVrv::DtOverWaterUpdater::isOverWater ( ) const
virtual

Get/set whether the current local location is over dynamic ocean. Normally set during update()

virtual void makVrv::DtOverWaterUpdater::setIsOverWater ( bool  isOverWater)
virtual

Get/set whether the current local location is over dynamic ocean. Normally set during update()

virtual bool makVrv::DtOverWaterUpdater::locationIsChanged ( ) const
virtual

Set/get whether the input location has changed since the last update. Normally set to true in setLocalLocation (if the input differs from myLocalLocation) and set to false in update().

virtual void makVrv::DtOverWaterUpdater::setLocationIsChanged ( bool  locationIsChanged)
virtual

Set/get whether the input location has changed since the last update. Normally set to true in setLocalLocation (if the input differs from myLocalLocation) and set to false in update().

virtual void makVrv::DtOverWaterUpdater::slot_dynamicOceanObjectsChanged ( )
virtual

This method is connected to signals from the DtDynamicOceanManager that indicate when dynamic ocean objects are added or removed. It just sets myLocationIsChanged to true to force an update the next scheduled frame.

Member Data Documentation

DtDe& makVrv::DtOverWaterUpdater::myDe
protected
DtVector makVrv::DtOverWaterUpdater::myLocalLocation
protected
bool makVrv::DtOverWaterUpdater::myLocationIsChanged
protected
bool makVrv::DtOverWaterUpdater::myIsOverWater
protected
DtSignalConnectionManager makVrv::DtOverWaterUpdater::mySignalConnections
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)