|
VR-Engage
2.2
|
The primary function of this class is management of first person arms and gun model. This class owns the first person model agent and first person mimic model updater, and is responsible for selecting the appropriate first person model depending on active gun and/or equipment, hiding or showing the model based on 1st/3rd person view mode or other condition such as death, (re)positioning model relative to camera based on posture, and setting aiming and firing state of first person model when necessary. This class also manages overlay effects such as sniper rifle sights and blood overlay effects that indicate when and from where the player is taking hits.
#include <humanRenderUpdater.h>
Classes | |
| struct | HitEffectInfo |
Public Member Functions | |
| DtHumanRenderUpdater () | |
| virtual | ~DtHumanRenderUpdater () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
| void | showFirstPerson () |
| void | hideFirstPerson () |
| void | showThirdPerson () |
| void | setThirdPersonVisible (bool visible) |
| void | setFirstPersonModelOffset (DtVector translation, DtTaitBryan rotation=DtTaitBryan()) |
| bool | findFirstPersonModelOffset (HumanPosture posture, bool aiming, bool usingVr, DtVector *translation=nullptr, DtTaitBryan *rotation=nullptr) |
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 Types | |
| using | HitEffectEnum |
| using | HitEffectState |
|
protected |
Enumeration of hit effect positions.
Used to track the timers for each hit effect location
|
protected |
Enumeration of hit effect states.
These states are necessary to have interruptible hit effects
| makVre::DtHumanRenderUpdater::DtHumanRenderUpdater | ( | ) |
Default constructor.
|
overridevirtual |
Virtual destructor.
|
overridevirtual |
Initializes the render updater component.
| player | Pointer to the player station |
| config | Configuration settings for initialization |
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Updates rendering elements for the current frame.
| dt | Delta time since the last frame in seconds |
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Cleans up resources when the component is being shut down.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the component type identifier.
Returns the type identifier string for this component, which is used by the VR-Engage framework for component identification and management. The returned value matches DtHumanRenderUpdaterType.
Implements makVre::DtPlayerComponent.
| void makVre::DtHumanRenderUpdater::showFirstPerson | ( | ) |
Shows the first-person model.
| void makVre::DtHumanRenderUpdater::hideFirstPerson | ( | ) |
Hides the first-person model.
| void makVre::DtHumanRenderUpdater::showThirdPerson | ( | ) |
Shows the third-person model.
| void makVre::DtHumanRenderUpdater::setThirdPersonVisible | ( | bool | visible | ) |
Sets the visibility of the third-person model.
| visible | True to show the model, false to hide it |
| void makVre::DtHumanRenderUpdater::setFirstPersonModelOffset | ( | DtVector | translation, |
| DtTaitBryan | rotation = DtTaitBryan() ) |
Sets the offset of the first-person model.
| translation | Translation offset vector |
| rotation | Rotation offset in Tait-Bryan angles |
| bool makVre::DtHumanRenderUpdater::findFirstPersonModelOffset | ( | HumanPosture | posture, |
| bool | aiming, | ||
| bool | usingVr, | ||
| DtVector * | translation = nullptr, | ||
| DtTaitBryan * | rotation = nullptr ) |
Finds the appropriate first-person model offset for the given state.
| posture | Current human posture |
| aiming | True if the player is currently aiming |
| usingVr | True if VR mode is active |
| translation | [out] Pointer to receive the translation offset, can be nullptr |
| rotation | [out] Pointer to receive the rotation offset, can be nullptr |
|
protected |
Initializes render objects like models and effects.
|
protected |
Clears any active scene selections.
|
protected |
Configures dead reckoning and movement smoothing.
|
protected |
Updates blood sight (damage) overlay effects.
|
protected |
Updates the first-person model state and position.
| dt | Delta time since the last frame in seconds |
|
protected |
Updates the third-person model state and position.
| dt | Delta time since the last frame in seconds |
|
protected |
Updates aiming-related visual effects.
|
protected |
Updates equipment-related visual effects.
|
protected |
Updates health-related visual effects.
Updates the effect that shows when the human's damage state is slight or moderate
|
protected |
Updates hit-related visual effects.
| dt | Delta time since the last frame in seconds |
Updates the hit effect when the human is hit by a munition. It shows effects on the right, left, or all corners of the GUI.
|
protectedvirtual |
Starts a hit effect timer.
| hitEffect | The hit effect type to start |
|
protectedvirtual |
Stops a hit effect timer.
| hitEffect | The hit effect type to stop |
|
protectedvirtual |
Handles fire messages.
| msg | Pointer to the message being processed |
|
protectedvirtual |
Handles detonation location messages.
| msg | Pointer to the message being processed |
|
protected |
Handles changes in player health.
| val | New health value |
|
protected |
Looks up the dead reckoning updater for a scene object.
| myDisSceneObject | Pointer to the scene object |
References myDisSceneObject.
|
protectedvirtual |
Handles scene object deletion notifications.
| id | Unique ID of the scene object being deleted |
|
protected |
Finds the appropriate first-person model definition.
| gun | Current weapon identifier |
| appearance | Current appearance identifier |
|
protected |
Finds the DI-Guy character for the player.
|
protected |
Duration of hit effects in seconds.
|
protected |
Minimum health value for health effect visibility.
The minimum health that the health effect will change. Don't want the screen to go completely opaque
|
protected |
Maximum health value for health effect visibility.
The maximum health that the health effect will change
|
protected |
Maximum opacity value for health effects.
|
protected |
Mapping between weapons and model definitions.
|
protected |
Configuration table for first-person models.
|
protected |
Agent managing the first-person character model.
|
protected |
Agent managing the first-person scene object.
|
protected |
Agent managing first-person model updates.
|
protected |
Agent managing orientation updates.
|
protected |
Main scene object for the player entity.
Referenced by lookupDeadReckonUpdater().
|
protected |
Current weapon identifier.
|
protected |
Current appearance identifier.
|
protected |
Flag indicating if first-person view is currently shown.
|
protected |
Current posture of the arms model.
|
protected |
Flag indicating if weapon is in the down position.
|
protected |
Last known aiming state.
|
protected |
Flag indicating if render objects have been initialized.
|
protected |
Flag indicating if first-person objects have been initialized.
|
protected |
Pointer to the main rendering channel.
|
protected |
Time when the sight effect should end.
|
protected |
Last known equipment state.
|
protected |
Delay before switching models in seconds.
|
protected |
Delay before showing models in seconds.
|
protected |
Current pitch angle of the arms model.
|
protected |
Additional pitch angle for arc aiming.
|
protected |
Pitch offset for the first-person model.
|
protected |
Heading (yaw) offset for the first-person model.
|
protected |
Flag indicating if VR mode is active.
|
protected |
Flag indicating whether to hide the first-person player model while aiming (not applicable in VR)
|
protected |
Tracks whether first-person model was visible before entering aiming mode.
|
protected |
Collection of hit effects and their information.
Timer used to control the hit effect which appears in the corners of the GUI