|
VR-Engage
2.2
|
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>
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 DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () 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 |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtWeaponPoseUpdater::DtWeaponPoseUpdater | ( | ) |
Constructor for DtWeaponPoseUpdater.
Initializes the component with default values
|
overridevirtual |
Virtual destructor for DtWeaponPoseUpdater.
|
overridevirtual |
Initializes the weapon pose updater component.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing component settings |
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().
|
overridevirtual |
Called every frame to update component state.
| dt | Delta 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.
|
overridevirtual |
Shuts down the weapon pose updater component.
Disconnects from the renderer's post-update signal
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the type identifier for this component.
Implements makVre::DtPlayerComponent.
|
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.
|
protected |
Pointer to the observer being used to determine weapon pose.