VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtAimPointTickable Class Reference

Detailed Description

DtAimPointTickable is a component that updates the visualization of an aim point or targeting reticle associated with a specified scene object (typically a weapon or targeting system). It inherits from DtTickable, allowing it to receive regular update calls from the display engine's main loop. This is used to provide visual feedback for aiming and targeting in the simulation.

#include <aimPointTickable.h>

Inheritance diagram for makVre::DtAimPointTickable:
[legend]

Public Types

enum  Orientation { UP , TOWARD_OBSERVER }
 
enum  ScreenScale { SCALED , CONSTANT }
 

Public Member Functions

 DtAimPointTickable (makVrv::DtDe &de, DtAttributeHandle &state, Orientation ori=UP, ScreenScale screenScale=SCALED)
 
virtual ~DtAimPointTickable () override
 
virtual void update (DtTime tNow) override
 
virtual bool needsUpdate (DtTime tNow) override
 
virtual void setSceneObject (makVrv::DtSceneObjectAgent *obj)
 

Protected Member Functions

virtual void actualUpdate ()
 

Protected Attributes

DtTime myLastUpdatedTime
 
DtAttributeHandle myState
 
makVrv::DtDe & myDe
 
makVrv::DtSceneObjectAgent * mySceneObject
 
ScreenScale myScreenScale
 
Orientation myOrientation
 
bool myInitModelDepth
 
bool myInitializedScaling
 

Member Enumeration Documentation

◆ Orientation

Orientation options for the aim point.

Defines how the aim point should be oriented in the 3D scene.

Enumerator
UP 

Aim point is oriented upward regardless of view direction.

TOWARD_OBSERVER 

Aim point is oriented to face the observer/camera.

◆ ScreenScale

Screen scaling options for the aim point.

Defines how the aim point size should be adjusted relative to the screen.

Enumerator
SCALED 

Aim point size scales with distance (appears smaller at greater distances)

CONSTANT 

Aim point size remains constant regardless of distance.

Constructor & Destructor Documentation

◆ DtAimPointTickable()

makVre::DtAimPointTickable::DtAimPointTickable ( makVrv::DtDe & de,
DtAttributeHandle & state,
Orientation ori = UP,
ScreenScale screenScale = SCALED )

Constructor.

Parameters
deReference to the display engine
stateReference to the attribute handle for state tracking
oriOrientation option for the aim point
screenScaleScaling option for the aim point

Creates a new aim point tickable component associated with the specified display engine and attribute state. The orientation and screen scaling options control the appearance of the aim point.

References de(), SCALED, and UP.

◆ ~DtAimPointTickable()

virtual makVre::DtAimPointTickable::~DtAimPointTickable ( )
overridevirtual

Virtual destructor.

Ensures proper cleanup of resources used by derived classes.

Member Function Documentation

◆ update()

virtual void makVre::DtAimPointTickable::update ( DtTime tNow)
overridevirtual

Updates the aim point.

Parameters
tNowCurrent simulation time

Called by the tickable manager to update the aim point visualization. This method updates the aim point's position, orientation, and appearance based on the target scene object's current state. If no scene object is set, this method does nothing.

◆ needsUpdate()

virtual bool makVre::DtAimPointTickable::needsUpdate ( DtTime tNow)
overridevirtual

Checks if an update is needed.

Parameters
tNowCurrent simulation time
Returns
True if an update should be performed, false otherwise

Determines whether the aim point needs to be updated at the current time. This helps optimize performance by avoiding unnecessary updates.

◆ setSceneObject()

virtual void makVre::DtAimPointTickable::setSceneObject ( makVrv::DtSceneObjectAgent * obj)
virtual

Sets the target scene object.

Parameters
objPointer to the scene object to associate with the aim point

Sets the scene object that the aim point should be associated with. This can be changed at any time to switch the aim point to a different entity. Setting this to NULL disables the aim point visualization.

◆ actualUpdate()

virtual void makVre::DtAimPointTickable::actualUpdate ( )
protectedvirtual

Performs the actual aim point update.

Internal method that performs the actual work of updating the aim point visualization based on the current state of the target scene object. This handles positioning, orientation, and scaling of the aim point.

Member Data Documentation

◆ myLastUpdatedTime

DtTime makVre::DtAimPointTickable::myLastUpdatedTime
protected

Time of the last update.

◆ myState

DtAttributeHandle makVre::DtAimPointTickable::myState
protected

Reference to the attribute handle for state tracking.

◆ myDe

makVrv::DtDe& makVre::DtAimPointTickable::myDe
protected

Reference to the display engine.

◆ mySceneObject

makVrv::DtSceneObjectAgent* makVre::DtAimPointTickable::mySceneObject
protected

Target scene object to associate with the aim point.

◆ myScreenScale

ScreenScale makVre::DtAimPointTickable::myScreenScale
protected

Current screen scaling option.

◆ myOrientation

Orientation makVre::DtAimPointTickable::myOrientation
protected

Current orientation option.

◆ myInitModelDepth

bool makVre::DtAimPointTickable::myInitModelDepth
protected

Flag indicating whether model depth has been initialized.

◆ myInitializedScaling

bool makVre::DtAimPointTickable::myInitializedScaling
protected

Flag indicating whether scaling has been initialized.


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