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

Detailed Description

The DtDeadReckonOverrider modifies dead reckoning settings for the ownship entity when it is engaged. Specifically, it disables acceleration-based prediction and smoothing to provide more responsive and accurate control when a player is directly controlling the entity.

This component automatically locates the scene object and its dead reckoning updater, then modifies the settings. When the component is shut down or the scene object is deleted, the original settings are restored.

#include <deadReckonOverrider.h>

Inheritance diagram for makVre::DtDeadReckonOverrider:
[legend]

Public Member Functions

 DtDeadReckonOverrider ()
 
virtual ~DtDeadReckonOverrider () override
 
virtual bool initialize (DtPlayerStation *player, DtInitTable &config) override
 
virtual bool postInitialize () override
 
virtual void tick (double dt) override
 
virtual void shutdown () override
 
virtual const char * type () const override
 
- Public Member Functions inherited from makVre::DtPlayerComponent
 DtPlayerComponent ()
 
virtual ~DtPlayerComponent ()
 
virtual void setName (const std::string &name)
 
virtual const std::string & name ()
 
virtual DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () const
 

Protected Member Functions

bool findSceneObject ()
 
bool findDeadReckonUpdater ()
 
void slot_sceneObjectToBeDeleted (const makVrv::DtUniqueID &id)
 
- Protected Member Functions inherited from makVre::DtPlayerComponent
virtual void initializeStateAttributes ()
 

Protected Attributes

makVrv::DtSceneObject * mySceneObject
 
makVrv::DtDeadReckonUpdater * myDeadReckonUpdater
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Constructor & Destructor Documentation

◆ DtDeadReckonOverrider()

makVre::DtDeadReckonOverrider::DtDeadReckonOverrider ( )

Constructor for DtDeadReckonOverrider.

Initializes the component with null pointers for scene object and dead reckoning updater.

◆ ~DtDeadReckonOverrider()

virtual makVre::DtDeadReckonOverrider::~DtDeadReckonOverrider ( )
overridevirtual

Virtual destructor for DtDeadReckonOverrider.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtDeadReckonOverrider::initialize ( DtPlayerStation * player,
DtInitTable & config )
overridevirtual

Initializes the component with configuration from Lua.

Performs basic initialization using the parent class implementation.

Parameters
playerPointer to the player station this component belongs to
configConfiguration table containing initialization parameters
Returns
True if initialization succeeds, false otherwise

Reimplemented from makVre::DtPlayerComponent.

References makVre::DtPlayerComponent::player().

◆ postInitialize()

virtual bool makVre::DtDeadReckonOverrider::postInitialize ( )
overridevirtual

Performs post-initialization setup.

Called after all components have been initialized.

Returns
True if post-initialization succeeds, false otherwise

Reimplemented from makVre::DtPlayerComponent.

◆ tick()

virtual void makVre::DtDeadReckonOverrider::tick ( double dt)
overridevirtual

Updates the component state.

Attempts to find the scene object and dead reckoning updater if not already found, then modifies the dead reckoning settings to disable acceleration-based prediction and smoothing.

Parameters
dtDelta time in seconds since the last tick

Implements makVre::DtPlayerComponent.

◆ shutdown()

virtual void makVre::DtDeadReckonOverrider::shutdown ( )
overridevirtual

Shuts down the component.

Disconnects from the scene object's deletion signal and restores original dead reckoning settings if the engine is not being destroyed.

Reimplemented from makVre::DtPlayerComponent.

◆ type()

virtual const char * makVre::DtDeadReckonOverrider::type ( ) const
overridevirtual

Returns the component type identifier.

Returns
The component type string

Implements makVre::DtPlayerComponent.

◆ findSceneObject()

bool makVre::DtDeadReckonOverrider::findSceneObject ( )
protected

Locates the scene object for the player's entity.

Attempts to find the scene object corresponding to the player's element ID. If found, connects to the scene object's deletion signal to handle cleanup.

Returns
True if the scene object was found or previously found, false otherwise

◆ findDeadReckonUpdater()

bool makVre::DtDeadReckonOverrider::findDeadReckonUpdater ( )
protected

Locates the dead reckoning updater for the scene object.

Searches through the scene object's updater chain to find a dead reckoning updater.

Returns
True if the dead reckoning updater was found or previously found, false otherwise

◆ slot_sceneObjectToBeDeleted()

void makVre::DtDeadReckonOverrider::slot_sceneObjectToBeDeleted ( const makVrv::DtUniqueID & id)
protected

Signal handler for scene object deletion.

Called when the connected scene object is about to be deleted. Performs cleanup by disconnecting signals and clearing pointers.

Parameters
idThe unique ID of the scene object being deleted

Member Data Documentation

◆ mySceneObject

makVrv::DtSceneObject* makVre::DtDeadReckonOverrider::mySceneObject
protected

Pointer to the scene object for the player's entity.

◆ myDeadReckonUpdater

makVrv::DtDeadReckonUpdater* makVre::DtDeadReckonOverrider::myDeadReckonUpdater
protected

Pointer to the dead reckoning updater for the scene object.


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