|
VR-Engage
2.2
|
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>
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 |
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. |
| makVre::DtAimPointTickable::DtAimPointTickable | ( | makVrv::DtDe & | de, |
| DtAttributeHandle & | state, | ||
| Orientation | ori = UP, | ||
| ScreenScale | screenScale = SCALED ) |
Constructor.
| de | Reference to the display engine |
| state | Reference to the attribute handle for state tracking |
| ori | Orientation option for the aim point |
| screenScale | Scaling 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.
|
overridevirtual |
Virtual destructor.
Ensures proper cleanup of resources used by derived classes.
|
overridevirtual |
Updates the aim point.
| tNow | Current 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.
|
overridevirtual |
Checks if an update is needed.
| tNow | Current simulation time |
Determines whether the aim point needs to be updated at the current time. This helps optimize performance by avoiding unnecessary updates.
|
virtual |
Sets the target scene object.
| obj | Pointer 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.
|
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.
|
protected |
Time of the last update.
|
protected |
Reference to the attribute handle for state tracking.
|
protected |
Reference to the display engine.
|
protected |
Target scene object to associate with the aim point.
|
protected |
Current screen scaling option.
|
protected |
Current orientation option.
|
protected |
Flag indicating whether model depth has been initialized.
|
protected |
Flag indicating whether scaling has been initialized.