|
VR-Engage
2.2
|
DtHumanControlLogic manages user inputs and control actions for the human entity, including movement, posture changes, weapon handling, and special actions like using equipment or interacting with the environment. It translates input commands into entity state changes and simulation actions.
#include <humanControlLogic.h>
Classes | |
| struct | PostureRestrictions |
Public Types | |
| using | DtPostureTransition |
| using | DtCompassUnits |
Public Member Functions | |
| DtHumanControlLogic () | |
| virtual | ~DtHumanControlLogic () 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 |
| virtual void | aim (double val) |
| void | setMoveLockTime (double seconds) |
| void | addMoveLockTime (double seconds) |
| virtual void | move (double val) |
| virtual void | strafe (double val) |
| virtual void | pitch (double val, bool mouseInput=false) |
| virtual void | yaw (double val, bool mouseInput=false) |
| virtual void | setPitch (double pitch) |
| virtual void | setYaw (double yaw) |
| virtual void | simulateYaw (double dt) |
| virtual void | simulatePitch (double dt) |
| virtual void | setCurrentPitch (double pitch) |
| virtual void | setCurrentHeading (double yaw) |
| virtual void | gazePitch () |
| virtual void | gazeYaw () |
| virtual HumanPosture | desiredPosture () const |
| virtual void | setPosture (double val, HumanPosture posture, DtPostureTransition postureTransition) |
| virtual void | postureSelect (double val) |
| virtual void | postureUp (double val) |
| virtual void | postureDown (double val) |
| virtual void | standUp (double val) |
| virtual void | goProne (double val) |
| virtual void | kneel (double val) |
| virtual void | toggleBinoculars (double val) |
| virtual void | reload (double val) |
| virtual void | fire (double val) |
| virtual void | freeLook (double val) |
| virtual void | toggleObserverAttachMode (double val) |
| virtual void | setObserverAttachMode (ObserverAttachMode mode) |
| virtual void | sprint (double val) |
| virtual void | walk (double val) |
| virtual void | toggleFlashlight (double val) |
| virtual void | flashlightPitchUp (double val) |
| virtual void | flashlightPitchDown (double val) |
| virtual void | flashlightYawLeft (double val) |
| virtual void | flashlightYawRight (double val) |
| virtual void | firstStageTrigger (double val) |
| virtual void | toggleCompass (double val) |
| virtual void | toggleCompassUnits (double val) |
| virtual void | setCompassUnits (enum DtCompassUnits units) |
| virtual void | toggleNorthReference (double val) |
| virtual void | toggleNVG (double val) |
| virtual void | zoomInToggleBinoculars (double val) |
| virtual void | zoomOutToggleBinoculars (double val) |
| virtual void | toggleWeaponStowed (double val) |
| virtual void | toggleWeaponDown (double val) |
| virtual void | toggleHUD (double val) |
| virtual void | weaponDown () |
| virtual void | weaponStow (bool stow) |
| virtual void | weaponUp () |
| virtual void | cycleWeaponState (double val) |
| virtual void | toggleMissileAttackMode (double val) |
| virtual void | weaponCycleOrDown (bool press) |
| virtual void | nextWeapon (double val) |
| virtual void | selectWeapon (int index) |
| virtual void | manipulateTerrainElement (TerrainElement element, TerrainAction action) |
| virtual void | parachuteLeftToggle (double val) |
| virtual void | parachuteRightToggle (double val) |
| virtual void | parachuteDeploy (double val) |
| virtual void | setLaserCode (int val) |
| virtual void | playDiguyAction (const std::string &diguyAction, double duration=0) |
| virtual void | playDiguyGesture (const std::string diguyGesture) |
| virtual void | sendJoystickCommand (const DtEntityIdentifier &id, const std::string &functionGroup, const std::string &function, double val, bool repeat=false) |
| virtual void | sendJoystickCommand (const std::string &functionGroup, const std::string &function, double val, bool repeat=false) |
| virtual void | reset (float value) override |
| virtual void | resetInPlace (float value) override |
| virtual void | updateDiGuyHandItem () |
| void | zoomInScope (double val) |
| void | zoomOutScope (double val) |
| virtual HumanPosture | postureFromString (const std::string &posture) const |
| virtual std::string | stringForPosture (const HumanPosture posture) const |
Public Member Functions inherited from makVre::DtEntityControlLogic | |
| DtEntityControlLogic () | |
| virtual | ~DtEntityControlLogic () override |
| virtual void | setExtendedData (const std::string &key, const std::string &value, DtEntityIdentifier entity=DtEntityIdentifier::nullId()) |
| virtual bool | isMouseControlEnabled () |
| virtual bool | isMouseControlSupportAllowed () const |
| virtual void | setMouseControlSupportAllowed (bool enable) |
| virtual const std::vector< std::string > & | joystickGroups () const |
| virtual makVre::DtVreMessageResult | handleStateMessages (makVre::DtVreMessage *message) |
| virtual makVre::DtVreMessageResult | handleReset (makVre::DtVreMessage *message) |
| virtual void | toggleMouseControl (float val) |
| virtual void | enableMouseControl (float val) |
| virtual makVre::DtVreMessageResult | handleFocusMessage (makVre::DtVreMessage *message) |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| 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 | |
| bool | isDead () |
| bool | playerCanControl () |
| bool | isAirborne () |
| bool | isAimingLauncher () const |
| virtual void | setMouseControlEnabled (bool enabled) override |
| virtual makVre::DtVreMessageResult | handleSimState (makVre::DtVreMessage *msg) override |
| virtual makVre::DtVreMessageResult | handleViewModeMessage (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handleAppFocusUpdate (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handleSessionPlayState (makVre::DtVreMessage *msg) |
| virtual void | onCurrentStateChanged (std::string state) |
| virtual void | onLauncherIdChanged (makVrv::DtElementID launcherId) |
| virtual HumanPosture | getPostureFromAppearance (const DtEntityType &entityType, unsigned int appearanceBits) |
| virtual Equipment | getCurrentEquipment () |
| virtual double | getHealthFromAppearance () |
| virtual void | initPostureStringMaps () |
| virtual void | mapPostureToString (const HumanPosture posture, const std::string &postureString) |
| virtual void | fireGun () |
| virtual void | fireLauncher () |
| virtual void | throwGrenade () |
| virtual void | setupExternalLauncher () |
| virtual void | teardownExternalLauncher () |
| virtual void | startLasing () |
| virtual void | updateLasingState () |
| virtual void | stopLasing () |
| virtual void | disableFeaturesWhileParachuting () |
| virtual void | updateWeaponReady () |
| virtual void | computeAimingError () |
| virtual void | addRandomAimingError (DtTaitBryan &aimingOrientation) |
| virtual bool | shouldAllowMovement () |
| DtVector32 | walkingVelocity () |
| void | updateMoveLock () |
| bool | isMoving () |
| void | initWeaponIndex () |
| void | setWeaponStowed (bool stowed) |
| void | setWeaponDown (bool down) |
| void | setWeaponState (int state) |
| double | getCurrentAmmo () |
| void | setGazePitch (double pitch) |
| void | setGazeYaw (double yaw) |
| virtual bool | thirdPersonAllowed () |
| void | onWeaponListChanged (const DtAttributeHandle &weaponList) |
| void | onAmmoCountChanged (const DtAttributeHandle &weaponResourceHandle) |
| void | onSprintingChanged (bool sprinting) |
| void | onMovingBackwardChanged (bool movingBackward) |
| void | onWalkingChanged (bool walking) |
| void | onAimingChanged (bool aiming) |
| void | onWeaponIndexChanged (int weaponIndex) |
| void | onPostureChanged (HumanPosture posture) |
| void | onCanMoveChanged (bool canMove) |
| void | onHealthChanged (double health) |
| void | onEquipmentChanged (Equipment equipment) |
| void | onBinocularsChanged (bool usingBinoculars) |
| void | onForwardControlsChanged (bool forwardControls) |
| void | onWeaponStateChanged (int weaponState) |
| void | onDiGuyActionChanged (std::string action) |
| void | showQmlOverlay (const std::string &name) |
| bool | shouldEnableGaze (bool pitch) const |
| bool | handleGazeInput (bool pitch) |
| virtual void | firepowerHealthChangeCallback (int newFirepowerHealthValue) |
| virtual void | fatigueChangeCallback (float newFatigueValue) |
| virtual void | percentOfMaxSpeedChangeCallback (float newPercentOfMaxSpeedValue) |
Protected Member Functions inherited from makVre::DtEntityControlLogic | |
| virtual void | takeControlOfPlayerEntity () |
| virtual void | releaseControlOfPlayerEntity () |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Friends | |
| class | DtHumanVirtualRealityLogic |
Enumeration of posture transition directions.
Enumeration of compass unit types.
| makVre::DtHumanControlLogic::DtHumanControlLogic | ( | ) |
Default constructor.
|
overridevirtual |
Virtual destructor.
|
overridevirtual |
Initializes the human control logic.
| player | Pointer to the player station |
| config | Configuration settings for initialization |
Reimplemented from makVre::DtEntityControlLogic.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization setup.
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Updates control logic for the current frame.
| dt | Delta time since the last frame in seconds |
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Cleans up resources when the component is being shut down.
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Returns the component type identifier.
Reimplemented from makVre::DtEntityControlLogic.
|
virtual |
Handles aim input.
| val | Input value in the range [-1.0, 1.0] |
| void makVre::DtHumanControlLogic::setMoveLockTime | ( | double | seconds | ) |
Set a temporary movement lockout.
Set time in seconds during which player cannot move; set 0 to clear.
| void makVre::DtHumanControlLogic::addMoveLockTime | ( | double | seconds | ) |
Add time to a temporary movement lockout.
Add time in seconds during which player cannot move
|
virtual |
Handles forward/backward movement input.
| val | Input value in the range [-1.0, 1.0], where positive is forward |
|
virtual |
Handles left/right movement input.
| val | Input value in the range [-1.0, 1.0], where positive is right |
|
virtual |
Handles pitch (up/down looking) input.
| val | Input value in the range [-1.0, 1.0], where positive is down |
| mouseInput | Flag indicating if input is from mouse |
Handles pitch input, applies value scaling, and sends pitch joystick command when not gazing.
Referenced by handleGazeInput(), setCurrentPitch(), setGazePitch(), setPitch(), and shouldEnableGaze().
|
virtual |
Handles yaw (left/right looking) input.
| val | Input value in the range [-1.0, 1.0], where positive is right |
| mouseInput | Flag indicating if input is from mouse |
Handles yaw input, applies value scaling, and sends yaw joystick command when not gazing.
Referenced by setCurrentHeading(), setGazeYaw(), and setYaw().
|
virtual |
|
virtual |
|
virtual |
Simulates yaw movement over time.
| dt | Delta time since the last frame in seconds |
|
virtual |
Simulates pitch movement over time.
| dt | Delta time since the last frame in seconds |
|
virtual |
Sets the current pitch angle for VR input.
| pitch | Pitch angle in degrees |
References pitch().
|
virtual |
Sets the current heading angle for VR input.
| yaw | Yaw angle in degrees |
References yaw().
|
virtual |
Turns the entity's head to look up/down.
Updates the gazePitch attribute according to the processed pitch input (myPitch).
|
virtual |
Turns the entity's head to look left/right.
Updates the gazeYaw attribute according to the processed yaw input (myYaw).
|
virtual |
Gets the desired posture for the human entity.
|
virtual |
Sets the entity posture.
| val | Input value, typically 1.0 for activation |
| posture | Target posture to transition to |
| postureTransition | Direction of posture transition |
|
virtual |
Selects a posture based on the current state.
| val | Input value, typically 1.0 for activation |
|
virtual |
Transitions to a more upright posture.
| val | Input value, typically 1.0 for activation |
|
virtual |
Transitions to a more prone posture.
| val | Input value, typically 1.0 for activation |
|
virtual |
Transitions to standing posture.
| val | Input value, typically 1.0 for activation |
|
virtual |
Transitions to prone posture.
| val | Input value, typically 1.0 for activation |
|
virtual |
Transitions to kneeling posture.
| val | Input value, typically 1.0 for activation |
|
virtual |
Toggles binoculars equipment.
| val | Input value, typically 1.0 for activation |
|
virtual |
Initiates weapon reload.
| val | Input value, typically 1.0 for activation |
|
virtual |
Fires the current weapon.
| val | Input value, typically 1.0 for activation |
|
virtual |
Toggles free look mode.
| val | Input value, typically 1.0 for activation |
|
virtual |
Toggles the observer attachment mode.
| val | Input value, typically 1.0 for activation |
|
virtual |
Sets the observer attachment mode directly.
| mode | The observer attachment mode to set |
|
virtual |
Activates sprint movement.
| val | Input value, typically 1.0 for activation |
|
virtual |
Activates walk movement.
| val | Input value, typically 1.0 for activation |
|
virtual |
Toggles flashlight on/off.
| val | Input value, typically 1.0 for activation |
|
virtual |
Adjusts flashlight pitch upward.
| val | Input value, typically 1.0 for activation |
|
virtual |
Adjusts flashlight pitch downward.
| val | Input value, typically 1.0 for activation |
|
virtual |
Adjusts flashlight yaw leftward.
| val | Input value, typically 1.0 for activation |
|
virtual |
Adjusts flashlight yaw rightward.
| val | Input value, typically 1.0 for activation |
|
virtual |
Handles first stage trigger input for weapons.
| val | Input value, typically 1.0 for activation |
|
virtual |
Toggles the compass display.
| val | Input value, typically 1.0 for activation |
Toggles the value of the makVre::DtState attribute "compass".
|
virtual |
Toggles between compass unit types.
| val | Input value, typically 1.0 for activation |
|
virtual |
Sets the compass units directly.
| units | The compass units to use |
|
virtual |
Toggles between true and magnetic north references.
| val | Input value, typically 1.0 for activation |
|
virtual |
Toggles night vision goggles.
| val | Input value, typically 1.0 for activation |
|
virtual |
Zooms in binoculars or toggles binoculars if not active.
| val | Input value, typically 1.0 for activation |
|
virtual |
Zooms out binoculars or toggles binoculars if not active.
| val | Input value, typically 1.0 for activation |
|
virtual |
Toggles weapon stowed state.
| val | Input value, typically 1.0 for activation |
|
virtual |
Toggles weapon down state.
| val | Input value, typically 1.0 for activation |
|
virtual |
Toggles HUD visibility.
| val | Input value, typically 1.0 for activation |
Toggles value of state attribute "showHUD".
|
virtual |
Puts the weapon in down position.
|
virtual |
Stows the current weapon.
| stow | True to stow the weapon, false otherwise |
|
virtual |
Brings the weapon to ready position.
|
virtual |
Cycles through weapon states (ready, down, stowed)
| val | Input value, typically 1.0 for activation |
Toggles current "attackMode" extended state data, representing current attack mode of the launcher, top attack ("top-attack") or direct attack ("direct-attack").
|
virtual |
|
virtual |
Cycles through weapons or puts current weapon down.
| press | True if button is pressed, false if released |
Cycles through available weapons if weapon is already in ready position, or puts the current weapon down if in ready position and not cycling.
|
virtual |
Selects the next weapon in the inventory.
| val | Input value, typically 1.0 for activation |
Cycles to the next available weapon in the entity's inventory.
|
virtual |
Selects a specific weapon by index.
| index | The index of the weapon to select |
Selects a specific weapon from the entity's inventory based on its index.
|
virtual |
Manipulates a terrain element.
| element | The terrain element to manipulate |
| action | The action to perform on the element |
Performs an action on a terrain element, such as opening a door, toggling a light switch, or operating other interactive objects.
|
virtual |
Toggles the left parachute control line.
| val | Input value, typically 1.0 for activation |
Controls the left steering of a parachute when deployed, causing the entity to turn left when in the air.
|
virtual |
Toggles the right parachute control line.
| val | Input value, typically 1.0 for activation |
Controls the right steering of a parachute when deployed, causing the entity to turn right when in the air.
|
virtual |
Deploys the parachute.
| val | Input value, typically 1.0 for activation |
Deploys the entity's parachute when falling, allowing for controlled descent and safe landing.
|
virtual |
Sets the laser designation code.
| val | The four-digit laser code to set |
Sets the laser designation code used for guiding laser-guided munitions. This code must match the code set on the munition for proper guidance.
|
virtual |
Plays a DI-Guy animation action on the entity.
| diguyAction | The name of the DI-Guy action to play |
| duration | The duration of the animation in seconds (0 for default duration) |
Sends a VrfTaskAnimationMessage to the entity, instructing it to play the specified DI-Guy animation action, such as waving, saluting, or other gestures and movements.
|
virtual |
Plays a DI-Guy gesture on the entity.
| diguyGesture | The name of the DI-Guy gesture to play |
Sends a VrfTaskGestureMessage to the entity, instructing it to play the specified DI-Guy gesture, typically used for facial expressions and minor movements.
|
virtual |
Sends a joystick command to a specific entity.
| id | The entity identifier of the target entity |
| functionGroup | The function group of the command |
| function | The specific function to trigger |
| val | The input value for the function |
| repeat | Whether the command should be repeated (default: false) |
Sends a joystick command message to the specified entity, allowing control of its functions via simulated joystick input.
|
virtual |
Sends a joystick command to the controlled entity.
| functionGroup | The function group of the command |
| function | The specific function to trigger |
| val | The input value for the function |
| repeat | Whether the command should be repeated (default: false) |
Sends a joystick command message to the entity controlled by this logic component, allowing control of its functions via simulated joystick input.
|
overridevirtual |
Forwards a joystick command to controlled drones.
Helper comment for the sendJoystickCommand methods, indicating that they can be used to forward commands to drones being controlled by the entity.
Resets the entity to its initial state
| value | Input value, typically 1.0 for activation |
Resets the entity to its initial state, including position, orientation, and equipment. This overrides the base class implementation to handle human-specific reset behavior.
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Resets the entity state without changing position.
| value | Input value, typically 1.0 for activation |
Resets the entity to its initial state but maintains its current position in the world. This is useful for resetting health, equipment, or other attributes without teleporting.
Reimplemented from makVre::DtEntityControlLogic.
|
virtual |
Updates the DI-Guy hand item based on current state.
Updates the item held in the entity's hands based on the current weapon or equipment selection. This affects the visual appearance of the entity.
| void makVre::DtHumanControlLogic::zoomInScope | ( | double | val | ) |
Zooms in the weapon scope or optics.
| val | Input value, typically 1.0 for activation |
Increases the zoom level of the currently equipped weapon's scope or optics, providing a closer view of distant targets.
| void makVre::DtHumanControlLogic::zoomOutScope | ( | double | val | ) |
Zooms out the weapon scope or optics.
| val | Input value, typically 1.0 for activation |
Decreases the zoom level of the currently equipped weapon's scope or optics, providing a wider field of view.
|
virtual |
Converts a posture string to a HumanPosture enum value.
| posture | String representation of the posture |
Converts a string representation of a posture (e.g., "Standing", "Kneeling", "Prone") to the corresponding HumanPosture enumeration value.
|
virtual |
Converts a HumanPosture enum value to a string.
| posture | The HumanPosture enum value to convert |
Converts a HumanPosture enumeration value to its string representation (e.g., "Standing", "Kneeling", "Prone").
|
protected |
Checks if the entity is dead.
Determines whether the entity is currently dead based on its health value and appearance bits. Used to disable certain controls when the entity is dead.
|
protected |
Checks if the player can control the entity.
Determines whether player input should be allowed to control the entity based on the current state, such as health, posture, and other conditions.
|
protected |
Checks if the entity is in the air.
Determines whether the entity is currently in the air, such as when jumping, falling, or parachuting. Affects available controls and animations.
|
protected |
Checks if the entity is aiming a launcher.
Determines whether the entity is currently carrying a shoulder-mounted launcher or using a tripod-mounted launcher. Affects aiming behavior, movement restrictions, and available actions.
|
overrideprotectedvirtual |
Sets whether mouse control is enabled.
| enabled | True to enable mouse control, false to disable it |
Overrides the base class implementation to handle additional setup related to mouse pitch control for human entities.
Reimplemented from makVre::DtEntityControlLogic.
|
overrideprotectedvirtual |
Handles simulation state messages.
| msg | Pointer to the simulation state message |
Processes messages containing updates to the simulation state, such as entity positions, orientations, and other dynamic attributes.
Reimplemented from makVre::DtEntityControlLogic.
|
protectedvirtual |
Handles view mode change messages.
| msg | Pointer to the view mode message |
Processes messages that change the view mode, such as switching between first-person and third-person perspectives.
|
protectedvirtual |
Handles application focus update messages.
| msg | Pointer to the focus update message |
Processes messages about application focus changes. Used to disable walking when the application loses focus, preventing stuck movement when the ALT key release event is missed.
|
protectedvirtual |
Handles session play state messages.
| msg | Pointer to the session play state message |
Processes messages about changes to the simulation play state (running, paused, or stopped) and updates entity controls accordingly.
|
protectedvirtual |
Handles changes to the current state.
| state | The new state string |
Called when the current state changes. Provides faster response than waiting for a message-based notification (see VRE-2775). Updates controls based on the new state.
|
protectedvirtual |
Handles changes to the launcher element ID.
| launcherId | The new launcher element ID |
Called when the "launcherElementId" attribute changes. Calls setupExternalLauncher when a valid launcher ID is set, or teardownExternalLauncher when the ID is cleared. This enables or disables launcher-specific functionality and UI elements.
|
protectedvirtual |
Determines posture from appearance bits.
| entityType | The entity type |
| appearanceBits | The appearance bits from the entity |
Extracts the current posture (standing, kneeling, prone) from the entity's appearance bits, which encode visual state information.
|
protectedvirtual |
Gets the currently equipped item.
Determines what equipment the entity is currently using, such as binoculars, NVGs, or weapons, based on attribute values.
|
protectedvirtual |
Gets the entity's health from appearance bits.
Extracts the current health value from the entity's appearance bits, which include damage and injury state information.
|
protectedvirtual |
Initializes the posture-to-string mapping tables.
Sets up bidirectional mappings between HumanPosture enum values and their string representations. Called during initialization.
|
protectedvirtual |
Maps a posture enum to a string representation.
| posture | The HumanPosture enum value to map |
| postureString | The string representation to associate with the posture |
Adds an entry to the bidirectional mapping tables between posture enum values and their string representations.
|
protectedvirtual |
Fires the currently equipped gun.
Handles the logic for firing a gun-type weapon, including ammunition tracking, recoil effects, and sending the appropriate messages to the simulation to create projectiles and effects.
|
protectedvirtual |
Fires the currently equipped launcher.
Handles the logic for firing a launcher-type weapon, such as rocket launchers or missile systems, including tracking ammunition and sending the appropriate messages to the simulation.
|
protectedvirtual |
Throws a grenade.
Handles the logic for throwing a grenade, including tracking inventory, animation timing, and sending the appropriate messages to the simulation to create the grenade entity.
|
protectedvirtual |
Sets up an external launcher.
Configures the control logic for using an external launcher, such as a tripod-mounted weapon system. Sets up appropriate UI elements, control mappings, and attribute listeners.
|
protectedvirtual |
Tears down an external launcher.
Removes the configuration for an external launcher when the entity stops using it. Cleans up UI elements, control mappings, and attribute listeners.
|
protectedvirtual |
Starts laser designation.
Activates the laser designator for targeting laser-guided munitions. Sets up the necessary attributes and tracking for the laser spot.
|
protectedvirtual |
Updates the laser designation state.
Updates the position and state of the active laser designation spot. Called periodically when laser designation is active.
|
protectedvirtual |
Stops laser designation.
Deactivates the laser designator and cleans up associated resources. Removes the laser spot from the simulation.
|
protectedvirtual |
Disables certain features while parachuting.
Disables features and controls that should not be available while the entity is using a parachute, such as weapon handling or posture changes.
|
protectedvirtual |
Updates the weapon ready state.
Updates the state of the currently equipped weapon based on entity attributes and conditions. Determines whether the weapon should be ready for use or put away.
|
protectedvirtual |
Computes the current aiming error.
Calculates the current aiming error based on factors like posture, movement, fatigue, and weapon type. This error affects weapon accuracy and is used to scale the reticle in the human overlay. Must be updated every frame for accurate visual feedback.
|
protectedvirtual |
Adds a random offset to the input aim orientation.
| aimingOrientation | The aiming orientation to which the error is added |
Takes an aim orientation from the player and adds a random degree of offset between myRequiredAimingErrorPercent and the max error determined by computeAimingError().
|
protectedvirtual |
Determines if movement should be allowed.
Checks various conditions to determine if the entity should be allowed to move, such as health, posture restrictions, and current actions.
|
protected |
Returns the velocity of the player ownship entity.
Velocity is relative to the host if embarked, otherwise i
|
protected |
Updates the move lock state.
Updates the move lock state based on current posture and conditions. Move lock prevents the entity from moving in certain situations.
|
protected |
Checks if the entity is currently moving.
Determines whether the entity is currently in motion based on movement inputs and velocity.
|
protected |
Initializes the weapon index.
Sets up the initial weapon index based on the entity's configuration and available weapons. Called during initialization.
|
protected |
Sets the weapon stowed state.
| stowed | True to stow the weapon, false otherwise |
Updates the weapon stowed state and related attributes. A stowed weapon is put away completely (e.g., on the back).
|
protected |
Sets the weapon down state.
| down | True to put the weapon down, false to bring it up |
Updates the weapon down state and related attributes. A down weapon is lowered but still in hand (e.g., at low ready).
|
protected |
Sets the weapon state directly.
| state | The weapon state value to set |
Sets the weapon state directly to a specific value, bypassing the individual stowed/down state setters.
|
protected |
Gets the current ammunition count.
Retrieves the current ammunition count for the active weapon from the appropriate attribute.
|
protected |
Sets the gaze pitch attribute.
| pitch | The pitch angle in degrees |
Updates the gazePitch attribute, which controls the up/down orientation of the entity's head for looking.
References pitch().
|
protected |
Sets the gaze yaw attribute.
| yaw | The yaw angle in degrees |
Updates the gazeYaw attribute, which controls the left/right orientation of the entity's head for looking.
References yaw().
|
protectedvirtual |
Checks if third-person view is allowed.
Determines if the entity is allowed to switch to third-person view based on configuration settings in human.lua.
|
protected |
Handles changes to the weapon list.
| weaponList | Vector of weapon names available to the entity |
Called when the list of available weapons changes. Updates the weapon selection UI and related controls.
|
protected |
Handles changes to the ammunition count.
| weaponResourceHandle | The new ammunition count |
Called when the ammunition count for the current weapon changes. Updates UI elements and manages weapon state if out of ammunition.
|
protected |
Handles changes to the sprinting state.
| sprinting | True if the entity is sprinting, false otherwise |
Called when the sprinting state changes. Updates movement speed modifiers and related attributes.
|
protected |
Handles changes to the backward movement state.
| movingBackward | True if the entity is moving backward, false otherwise |
Called when the backward movement state changes. Updates movement speed modifiers and other movement-related attributes.
|
protected |
Handles changes to the walking state.
| walking | True if the entity is walking (vs running), false otherwise |
Called when the walking state changes. Updates movement speed modifiers and related attributes.
|
protected |
Handles changes to the aiming state.
| aiming | True if the entity is aiming, false otherwise |
Called when the aiming state changes. Updates movement restrictions, accuracy modifiers, and weapon handling attributes.
|
protected |
Handles changes to the weapon index.
| weaponIndex | The new weapon index |
Called when the selected weapon changes. Updates UI elements, ammunition tracking, and weapon-related attributes.
|
protected |
Handles changes to the posture.
| posture | The new posture |
Called when the entity's posture changes. Updates movement restrictions, accuracy modifiers, and other posture-dependent attributes.
|
protected |
Handles changes to the movement capability.
| canMove | True if the entity can move, false otherwise |
Called when the entity's ability to move changes. Updates movement controls and related UI elements.
|
protected |
Handles changes to the health.
| health | The new health value |
Called when the entity's health changes. Updates UI elements, movement capabilities, and other health-dependent attributes.
|
protected |
Handles changes to the active equipment.
| equipment | The new active equipment |
Called when the entity's active equipment changes. Updates UI elements, control modes, and equipment-dependent attributes.
|
protected |
Handles changes to the binoculars state.
| usingBinoculars | True if binoculars are in use, false otherwise |
Called when the entity's binoculars usage state changes. Updates view settings, input sensitivity, and related UI elements.
|
protected |
Handles changes to the forward controls state.
| forwardControls | True if forward controls are enabled, false otherwise |
Called when the entity's forward controls state changes. Updates control mappings and related UI elements.
|
protected |
Handles changes to the weapon state.
| weaponState | The new weapon state |
Called when the entity's weapon state changes (ready, down, stowed). Updates UI elements, control modes, and weapon-dependent attributes.
|
protected |
Handles changes to the DI-Guy action.
| action | The new DI-Guy action name |
Called when the entity's DI-Guy animation action changes. Updates control restrictions and other animation-dependent attributes.
|
protected |
Shows a QML overlay by name.
| name | Name of the QML overlay to show |
Activates and displays a named QML overlay, such as a weapon scope or other specialized UI element.
References makVre::DtPlayerComponent::name().
|
protected |
Determines if gaze should be enabled.
| pitch | True to check pitch gaze, false to check yaw gaze |
Returns whether pitch/yaw gaze should be enabled according to the entity state (e.g. weapon/launcher state, freelook/climbing enabled state, spectator observer attach mode).
References pitch().
|
protected |
Handles gaze input and updates attributes.
| pitch | True to handle pitch gaze, false to handle yaw gaze |
Checks if gaze should be enabled and sets the useGazePitch/Yaw attribute accordingly. Returns whether the gaze input was handled.
References pitch().
|
protectedvirtual |
Handles changes to the firepower health.
| newFirepowerHealthValue | The new firepower health value |
Called when the entity's firepower health changes. This affects aiming accuracy and weapon handling capabilities.
|
protectedvirtual |
Handles changes to the fatigue level.
| newFatigueValue | The new fatigue value |
Called when the entity's fatigue level changes. This affects movement speed, aiming accuracy, and other performance attributes.
|
protectedvirtual |
Handles changes to the percent of max speed.
| newPercentOfMaxSpeedValue | The new percent of max speed value |
Called when the entity's percent of maximum speed changes. This affects movement capabilities and is modified by fatigue and other factors.
|
friend |
Friend class declaration to allow VR logic access to protected members.
References DtHumanVirtualRealityLogic.
Referenced by DtHumanVirtualRealityLogic.
|
protected |
Current ammunition resource attribute name.
Stores the name of the attribute currently being monitored for ammunition count.
|
protected |
|
protected |
Weapon resource logic component.
Manages weapon resources such as ammunition and available weapons.
|
protected |
|
protected |
Pointer to the associated observer.
Provides access to view-related functionality for the entity.
|
protected |
Human input logic component.
Handles input processing specific to human entities.
|
protected |
Flag for inverting pitch input.
When true, pitch input is inverted (up becomes down and vice versa).
|
protected |
Multiplier for sprint movement speed.
Scales forward movement speed when sprinting forward.
|
protected |
Multiplier for backward sprint movement speed.
Scales backward movement speed when sprinting backward.
|
protected |
Multiplier for running movement speed.
Scales movement speed when running (the default movement mode).
|
protected |
Multiplier for walking movement speed.
Scales movement speed when in walking mode (slower than running).
|
protected |
Multiplier for aiming movement speed.
Scales movement speed when aiming a weapon (typically slower).
|
protected |
Last forward/backward movement input value.
Stores the most recent forward/backward movement input value.
|
protected |
Last left/right strafe input value.
Stores the most recent left/right strafe input value.
|
protected |
Map from posture enum to string representation.
Bidirectional mapping between posture enum values and their string representations.
|
protected |
Map from string representation to posture enum.
Bidirectional mapping between string representations and posture enum values.
|
protected |
Sequence of postures for cycling.
Defines the order in which postures are cycled through when using posture cycling commands.
|
protected |
Map from posture to sequence index.
Maps each posture to its index in the posture sequence for quick lookup.
|
protected |
Map of posture restrictions for each posture.
Defines movement and weapon usage restrictions for each posture type.
|
protected |
Map of animation transition timing for each posture.
Stores the delay times (in seconds) for transitioning into and out of each posture. The first value is the delay when transitioning into the posture, and the second value is the delay when transitioning out of the posture.
|
protected |
Last posture transition direction.
Stores the direction of the last posture transition (up or down).
|
protected |
Expected posture after transition completes.
The posture that the entity is transitioning to or expected to reach.
|
protected |
Desired posture requested by user input.
The posture that was requested through user input, which may differ from the expected posture during transitions.
|
protected |
Last stable posture.
The last fully-established posture before any current transition.
|
protected |
Timeout for posture command processing.
Time remaining (in seconds) before a posture command expires if not completed.
|
protected |
Posture animation wait timer.
Time remaining (in seconds) to wait for the current posture animation to complete.
|
protected |
Timed move lock time remaining.
Time in seconds remaining in temporary movement lockout.
|
protected |
Move lock active flag.
Indicates whether movement is currently locked due to posture constraints or other restrictions.
|
protected |
Target weapon state to transition to.
The weapon state that the entity is transitioning to after any delays.
|
protected |
Flag indicating grenade throw request.
When true, indicates that a grenade throw has been requested and is pending.
|
protected |
Timer for delayed weapon state changes.
Time remaining (in seconds) before a delayed weapon state change occurs.
|
protected |
Joystick input sensitivity multiplier.
Controls the sensitivity of joystick inputs for movement and aiming.
|
protected |
Current fatigue level.
Stores the current fatigue value, which affects aiming accuracy and movement speed. Higher values indicate greater fatigue and worse performance.
|
protected |
Current firepower health value.
Stores the current firepower health value, which affects aiming accuracy. Lower values indicate degraded weapon handling capability.
|
protected |
Current percentage of maximum movement speed.
Represents the current percentage of maximum speed available to the entity. Decreases as fatigue increases, limiting maximum movement speed.
|
protected |
Maximum aiming error in radians.
The maximum half-angle of aiming error in radians. This is typically negative to produce the full spread of possible aiming error.
|
protected |
Current aiming error as a percentage of maximum.
The current aiming error expressed as a percentage of the maximum possible error. Affected by posture, movement, fatigue, and other factors.
|
protected |
Minimum required aiming error percentage.
The minimum error percentage that is always applied to ensure some spread in shots, preventing unrealistically perfect accuracy.
|
protected |
Aiming improvement percentage in prone position.
The percentage by which aiming accuracy improves when in the prone position. This reduces the effective aiming error.
|
protected |
Aiming improvement percentage when aiming.
The percentage by which aiming accuracy improves when using the weapon's aiming capability (e.g., iron sights, optics).
|
protected |
Current entity heading in degrees.
The current heading (yaw) angle of the entity in world space, in degrees.
|
protected |
Current entity pitch in degrees.
The current pitch angle of the entity in world space, in degrees.
|
protected |
Yaw rate in degrees per second.
The rate at which the entity's yaw angle changes when turning, in degrees per second.
|
protected |
Pitch rate in degrees per second.
The rate at which the entity's pitch angle changes when looking up/down, in degrees per second.
|
protected |
Turning rate modifier.
A modifier applied to the turning rate under various conditions.
|
protected |
Current input-driven yaw offset.
The current yaw offset resulting from user input, relative to the entity's base orientation.
|
protected |
Current input-driven pitch offset.
The current pitch offset resulting from user input, relative to the entity's base orientation.
|
protected |
Flag indicating heading initialization.
When true, indicates that the entity's heading has been initialized.
|
protected |
Flag to force orientation update.
When true, forces an update to the entity's orientation even if other conditions would normally prevent it. Temporary solution for VR input (VRE-3178).
|
protected |
Flag for sending gaze angles.
When true, enables sending of gaze angle updates to the entity.
|
protected |
Flag for two-stage fire mode.
When true, indicates that the current weapon uses a two-stage firing process, such as missile launchers with target lock before firing.
|
protected |
Current laser designation target location.
The world position of the current laser designation target point.
|
protected |
Input sensitivity multiplier when using binoculars.
Scales joystick and mouse pitch/yaw inputs while using binoculars. Corresponds to lua configuration variable "binocularsInputMultiplier". Defaults to 0.5 to provide finer control while using binoculars.
|
protected |
Cached observer attach mode before menu state.
Stores the observer attach mode at the time we enter the menu state. Used to restore the observer attach mode upon exiting menu state (while in the menu state, we force third person mode).
|
protected |
Cached compass visibility state before menu state.
Stores whether the compass was visible at the time we enter the menu state. Used to restore the compass visibility when exiting the menu state.
|
protected |
Currently active scope overlay.
The DtQtQuickOverlay scope currently in use. It may or may not be null over the lifetime of a player. For example, with shoulder mounted launchers, there may be a valid pointer when the launcher is raised, but once lowered, the pointer will be set to null again.