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

Detailed Description

DtWeaponPoseUpdater tracks the observer's position and orientation and updates corresponding weapon pose attributes. It maintains the weapon's geocentric position and orientation for use by other components, performing coordinate transformations from local to network coordinates. The component also validates whether the pose is currently valid based on scene visibility status.

#include <weaponPoseUpdater.h>

Inheritance diagram for makVre::DtWeaponPoseUpdater:
[legend]

Public Member Functions

 DtWeaponPoseUpdater ()
 
virtual ~DtWeaponPoseUpdater () override
 
virtual bool initialize (DtPlayerStation *player, DtInitTable &config) 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 bool postInitialize ()
 
virtual void setName (const std::string &name)
 
virtual const std::string & name ()
 
virtual DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () const
 

Protected Member Functions

void updateWeaponPosition ()
 
- Protected Member Functions inherited from makVre::DtPlayerComponent
virtual void initializeStateAttributes ()
 

Protected Attributes

makVrv::DtObserver * myObserver
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Constructor & Destructor Documentation

◆ DtWeaponPoseUpdater()

makVre::DtWeaponPoseUpdater::DtWeaponPoseUpdater ( )

Constructor for DtWeaponPoseUpdater.

Initializes the component with default values

◆ ~DtWeaponPoseUpdater()

virtual makVre::DtWeaponPoseUpdater::~DtWeaponPoseUpdater ( )
overridevirtual

Virtual destructor for DtWeaponPoseUpdater.

Member Function Documentation

◆ initialize()

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

Initializes the weapon pose updater component.

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

Connects to the renderer's post-update signal, finds the observer, and initializes weapon pose state attributes with default values

Reimplemented from makVre::DtPlayerComponent.

References makVre::DtPlayerComponent::player().

◆ tick()

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

Called every frame to update component state.

Parameters
dtDelta time since the last frame in seconds

This implementation is currently empty as the actual updates occur in the updateWeaponPosition method connected to the renderer's post-update signal

Implements makVre::DtPlayerComponent.

◆ shutdown()

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

Shuts down the weapon pose updater component.

Disconnects from the renderer's post-update signal

Reimplemented from makVre::DtPlayerComponent.

◆ type()

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

Returns the type identifier for this component.

Returns
The type string for DtWeaponPoseUpdater

Implements makVre::DtPlayerComponent.

◆ updateWeaponPosition()

void makVre::DtWeaponPoseUpdater::updateWeaponPosition ( )
protected

Updates the weapon position and orientation based on observer state.

Gets the current observer position and orientation, transforms them from local to geocentric coordinates, and updates the weaponLocation and weaponOrientation attributes. Also updates the weaponPoseValid flag based on scene visibility.

Member Data Documentation

◆ myObserver

makVrv::DtObserver* makVre::DtWeaponPoseUpdater::myObserver
protected

Pointer to the observer being used to determine weapon pose.


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