|
VR-Engage
2.3
|
The DtTowingControlLogic provides towing-related frontend behavior including hook input handling, tow-target state attributes, and tow-hook sensor contact subscriptions.
#include <towingControlLogic.h>
Public Member Functions | |
| DtTowingControlLogic () | |
| virtual | ~DtTowingControlLogic () override |
| virtual bool | initialize (DtPlayerStation *player, DtInitTable &config) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
| virtual void | tick (double dt) override |
| virtual void | setHook (double val) |
| virtual void | sendJoystickMessage (const std::string &function, double val, double delay=0) |
| virtual DtVreMessageResult | handleMenuMessage (DtVreMessage *msg) |
| virtual DtVreMessageResult | handleOwnershipTransferResponse (DtVreMessage *msg) |
Public Member Functions inherited from makVre::DtEntityControlLogic | |
| DtEntityControlLogic () | |
| virtual | ~DtEntityControlLogic () override |
| virtual bool | postInitialize () override |
| virtual void | setMouseControlEnabled (bool enabled) |
| virtual bool | isMouseControlEnabled () |
| virtual bool | isMouseControlSupportAllowed () const |
| virtual void | setMouseControlSupportAllowed (bool enable) |
| virtual const std::vector< std::string > & | joystickGroups () const |
| virtual void | sendJoystickCommand (const DtEntityIdentifier &id, const std::string &functionGroup, const std::string &function, double val, bool repeat=false) |
| virtual makVre::DtVreMessageResult | handleSimState (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handleReset (makVre::DtVreMessage *message) |
| virtual makVre::DtVreMessageResult | handleCreationStatus (makVre::DtVreMessage *message) |
| virtual void | reset (float val) |
| virtual void | resetInPlace (float val) |
| 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 () |
| bool | componentReady () const |
| void | setComponentReady (bool ready) |
| virtual DtInitTickStatus | finalizeInitTick (double dt) |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
| virtual const DtAttributeHandle & | ownshipState () const |
| virtual void | setExtendedData (const std::string &key, const std::string &value, DtEntityIdentifier entity=DtEntityIdentifier::nullId()) |
Protected Member Functions | |
| virtual void | onHookTargetUuidChanged (const std::string &hookTargetUuid) |
| virtual void | onTowSensorContactsChanged (const TowSensorContactsMap &sensorContacts) |
| virtual void | onHookedChanged (bool hooked) |
| virtual void | onVreBackendChanged (const DtSimulationAddress &vreBackendAddress) |
| virtual void | onTowCandidateSimEngineAddressChanged (const DtAttributeHandle &attr) |
| virtual void | updateTowCandidateSimEngineAttrs (const TowSensorContactsMap &sensorContacts) |
| virtual void | updateTowCandidateState () |
| virtual void | updateTowMenuTargetState () |
| virtual bool | shouldUseTowCandidatePrepMode () const |
| virtual void | startTowOwnershipTransfer () |
| virtual void | clearTowOwnershipTransferState () |
| virtual void | releasePendingTowTransferTarget () |
| virtual void | releaseTransferredTowTarget () |
| virtual void | updateTransferredTowTargetRelease (double dt) |
| virtual void | updateTransferredTowReleaseDelayFromSensorContacts () |
| virtual bool | transferredTowTargetInSensorContacts () const |
| virtual void | tryAutoHookAfterTransfer () |
| virtual DtSimulationAddress | towCandidateSimEngine (const DtUUID &candidateUuid) const |
| virtual void | queueTowTargetStateProperty (const DtEntityIdentifier &entityId, const std::string &name, const std::string &value, bool isBoolean) |
| virtual void | updateHookActionLabel () |
Protected Member Functions inherited from makVre::DtEntityControlLogic | |
| bool | requiresControl () const |
| bool | isAirborne () const |
| void | showNotification (const QString &text, double duration) |
| virtual void | takeControlOfPlayerEntity () |
| virtual void | releaseControlOfPlayerEntity () |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Private Types | |
| using | TowSensorContactsMap = std::map<DtUUID, DtEntityType> |
| using | TowCandidateSimEngineAttrMap = std::map<DtUUID, DtAttributeHandleType<DtSimulationAddress>> |
|
private |
|
private |
| makVre::DtTowingControlLogic::DtTowingControlLogic | ( | ) |
Constructor for DtTowingControlLogic.
|
overridevirtual |
Virtual destructor for DtTowingControlLogic.
|
overridevirtual |
Initializes the towing control logic from Lua configuration.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing initialization parameters |
Reimplemented from makVre::DtEntityControlLogic.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Shuts down the component and removes towing callbacks and input handlers.
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Returns the component type identifier.
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Updates pending tow-transfer handoff state.
| dt | Time in seconds since the previous update |
Reimplemented from makVre::DtEntityControlLogic.
|
virtual |
Controls the towing hook.
| val | The input value, typically toggling hook engagement |
|
virtual |
Sends a joystick message to the simulation.
| function | The function name to include in the message |
| val | The function value to include in the message |
| delay | Optional delay before sending the message |
|
virtual |
Handles towing-related action-menu messages.
| msg | The message to process |
|
virtual |
Handles ownership-transfer responses for tow-candidate acquires.
| msg | The response message to process |
|
protectedvirtual |
Callback for changes to the hook target UUID.
| hookTargetUuid | The UUID of the potential hook target |
|
protectedvirtual |
Callback for changes to the tow-hook sensor contact map.
| sensorContacts | The current set of tow-hook sensor contacts |
|
protectedvirtual |
Callback for changes to local hooked state.
| hooked | True when the ownship is currently hooked |
|
protectedvirtual |
Callback for changes to the local VRE backend address.
| vreBackendAddress | Current VRE backend sim address |
|
protectedvirtual |
Callback for tracked tow-candidate sim-engine updates.
| attr | The simEngineAddress attribute handle that changed |
|
protectedvirtual |
Synchronizes persistent simEngineAddress handles for the current contact set.
| sensorContacts | The current tow-hook sensor contacts |
|
protectedvirtual |
Refreshes fallback tow-candidate state from the tow-hook sensor contact map.
|
protectedvirtual |
Refreshes whether the towing menu has a visible interaction target.
|
protectedvirtual |
Returns true when towing should stay in prep-only mode.
Prep-only mode is used when we have exactly one tow sensor candidate but no authoritative same-backend hook target yet.
|
protectedvirtual |
Starts ownership transfer for the current fallback tow candidate.
|
protectedvirtual |
Clears pending towing ownership-transfer state.
|
protectedvirtual |
Releases an acquired tow target that could not be hooked.
|
protectedvirtual |
Releases the transferred tow target after towing stops.
|
protectedvirtual |
Releases the transferred tow target after it leaves sensor range and the delay expires.
|
protectedvirtual |
Starts or cancels the release delay based on whether the transferred target is still in sensor contacts.
|
protectedvirtual |
Returns true if the transferred tow target is still in tow-hook sensor contacts.
|
protectedvirtual |
Attempts to hand off to the normal Vortex hook path after acquire success.
|
protectedvirtual |
Returns the tracked sim-engine address for a fallback tow candidate.
|
protectedvirtual |
Queues a set-state-property request for a tow target entity.
References makVre::DtPlayerComponent::name().
|
protectedvirtual |
Refreshes the dynamic towing action-menu label.
|
protected |
Input handler logic for processing towing input device events.
|
protected |
Main joystick function group name from configuration.
|
protected |
Configuration flag indicating if this role should expose towing support.
|
protected |
Delay in seconds before sending the tow-target ownership acquire request.
|
protected |
Delay in seconds after the towed target leaves sensor range before releasing ownership.
|
protected |
Timeout in seconds to wait for the tow hook to engage after transfer succeeds.
|
protected |
Source attribute handle tracking whether the ownship is already hooked. Reads the extended-state alias produced by DtExtendedStateLogic.
|
protected |
Source attribute handle storing the authoritative same-backend hook target UUID. Reads the extended-state alias produced by DtExtendedStateLogic.
|
protected |
Sensor contacts used to discover nearby tow targets.
| Attribute Store Key | sensors.tow-hook-sensor.contacts |
|---|
|
protected |
Simulation address of this station's VRE backend.
| Attribute Store Key | vreBackendStatus.SimAddress |
|---|
|
protected |
Attribute handle tracking live tow-hook availability. Consumed by the towing HUD.
| Attribute Store Key | towing.can-tow |
|---|
|
protected |
Attribute handle tracking whether the ownship is already hooked. Consumed by the towing HUD.
| Attribute Store Key | towing.hooked |
|---|
|
protected |
Attribute handle storing the marking text of the current tow hook target entity. Consumed by the towing HUD.
| Attribute Store Key | towing.hook-target-marking-text |
|---|
|
protected |
Attribute handle indicating whether the towing menu should surface an interaction target.
This remains true during ownership transfer so the action menu does not disappear while the tow target is temporarily unavailable as a normal hook target. Consumed by the towing action menu.
| Attribute Store Key | towing.hasTowMenuTarget |
|---|
|
protected |
Attribute handle storing the dynamic label for the towing action-menu item. Consumed by the towing action menu.
| Attribute Store Key | towing.hookActionLabel |
|---|
|
protected |
Persistent per-contact simEngineAddress handles for fallback tow candidates.
|
protected |
Callback manager for tracked tow-candidate simEngineAddress attributes.
|
protected |
True when there is a valid authoritative tow hook target entity.
|
protected |
True when a single fallback tow candidate exists.
|
protected |
UUID of the fallback tow candidate.
|
protected |
Entity identifier of the fallback tow candidate.
|
protected |
True when the fallback tow candidate is on another sim backend.
|
protected |
True while a tow-target ownership acquire is in flight.
|
protected |
True after acquire success while waiting for the normal hook target to appear.
|
protected |
True after the hook command has been sent for a transferred target.
|
protected |
Request id for the active tow-target ownership acquire.
|
protected |
UUID of the tow target being acquired.
|
protected |
Entity identifier of the tow target being acquired.
|
protected |
Seconds remaining while waiting for the acquired target to become hookable and hooked.
|
protected |
UUID of the transferred tow target while it is being towed.
|
protected |
Entity identifier of the transferred tow target while it is being towed.
|
protected |
True after unhooking while waiting for the transferred target to leave tow-hook sensor contacts.
|
protected |
Seconds remaining before releasing the transferred tow target after it leaves sensor contacts.