21#include <vlpi/simulationAddress.h>
22#include <vrfutil/uuid.h>
82 virtual const char*
type()
const override;
86 virtual void tick(
double dt)
override;
174 const DtEntityIdentifier& entityId,
const std::string&
name,
const std::string& value,
bool isBoolean);
Provides a callback mechanism for attribute changes in the VREngage system.
Convenience manager that owns and organises a collection of attribute callbacks.
Definition attributeCallback.h:223
Handle class for safe access to attributes.
Definition attributeHandle.h:30
Type-specific handle class for attributes.
Definition attributeHandle.h:229
DtEntityControlLogic()
Constructor.
Table-based access to Lua state for configuration data.
Definition initializer.h:38
virtual DtPlayerStation & player()
Gets the player station.
virtual const std::string & name()
Gets the component name.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
unsigned long long myPendingTowOwnershipRequestId
Request id for the active tow-target ownership acquire.
Definition towingControlLogic.h:272
DtAttributeHandleType< std::string > myHookTargetMarkingTextAttr
Attribute handle storing the marking text of the current tow hook target entity. Consumed by the towi...
Definition towingControlLogic.h:226
virtual bool transferredTowTargetInSensorContacts() const
Returns true if the transferred tow target is still in tow-hook sensor contacts.
virtual void shutdown() override
Shuts down the component and removes towing callbacks and input handlers.
double myTowOwnershipReleaseDelaySeconds
Delay in seconds after the towed target leaves sensor range before releasing ownership.
Definition towingControlLogic.h:192
double myPendingTowHookTimeout
Seconds remaining while waiting for the acquired target to become hookable and hooked.
Definition towingControlLogic.h:281
double myTowOwnershipAcquireDelaySeconds
Delay in seconds before sending the tow-target ownership acquire request.
Definition towingControlLogic.h:189
TowCandidateSimEngineAttrMap myTowCandidateSimEngineAttrs
Persistent per-contact simEngineAddress handles for fallback tow candidates.
Definition towingControlLogic.h:242
virtual DtVreMessageResult handleOwnershipTransferResponse(DtVreMessage *msg)
Handles ownership-transfer responses for tow-candidate acquires.
bool myTowCandidateNeedsOwnershipTransfer
True when the fallback tow candidate is on another sim backend.
Definition towingControlLogic.h:260
DtAttributeHandleType< bool > myCanTowAttr
Attribute handle tracking live tow-hook availability. Consumed by the towing HUD.
Definition towingControlLogic.h:216
DtTowingControlLogic()
Constructor for DtTowingControlLogic.
virtual void updateTransferredTowReleaseDelayFromSensorContacts()
Starts or cancels the release delay based on whether the transferred target is still in sensor contac...
DtEntityIdentifier myTowCandidateEntityId
Entity identifier of the fallback tow candidate.
Definition towingControlLogic.h:257
std::map< DtUUID, DtEntityType > TowSensorContactsMap
Definition towingControlLogic.h:61
bool myTransferredTowReleaseWaitingForSensorClear
True after unhooking while waiting for the transferred target to leave tow-hook sensor contacts.
Definition towingControlLogic.h:290
DtAttributeHandleType< DtSimulationAddress > myVreBackendAttr
Simulation address of this station's VRE backend.
Definition towingControlLogic.h:211
DtUUID myPendingTowTransferUuid
UUID of the tow target being acquired.
Definition towingControlLogic.h:275
bool myHasTowCandidate
True when a single fallback tow candidate exists.
Definition towingControlLogic.h:251
bool myTowHookCommandSent
True after the hook command has been sent for a transferred target.
Definition towingControlLogic.h:269
DtAttributeHandleType< bool > myHasTowMenuTargetAttr
Attribute handle indicating whether the towing menu should surface an interaction target.
Definition towingControlLogic.h:234
DtInputLogic myTowingInputLogic
Input handler logic for processing towing input device events.
Definition towingControlLogic.h:180
bool myHasTowHook
Configuration flag indicating if this role should expose towing support.
Definition towingControlLogic.h:186
virtual DtSimulationAddress towCandidateSimEngine(const DtUUID &candidateUuid) const
Returns the tracked sim-engine address for a fallback tow candidate.
DtAttributeCallbackManager myTowCandidateAttributeCallbacks
Callback manager for tracked tow-candidate simEngineAddress attributes.
Definition towingControlLogic.h:245
DtAttributeHandleType< bool > myHookedAttr
Attribute handle tracking whether the ownship is already hooked. Consumed by the towing HUD.
Definition towingControlLogic.h:221
std::string myMainJoystickGroup
Main joystick function group name from configuration.
Definition towingControlLogic.h:183
virtual void onHookTargetUuidChanged(const std::string &hookTargetUuid)
Callback for changes to the hook target UUID.
virtual DtVreMessageResult handleMenuMessage(DtVreMessage *msg)
Handles towing-related action-menu messages.
virtual void onTowSensorContactsChanged(const TowSensorContactsMap &sensorContacts)
Callback for changes to the tow-hook sensor contact map.
virtual bool shouldUseTowCandidatePrepMode() const
Returns true when towing should stay in prep-only mode.
virtual void sendJoystickMessage(const std::string &function, double val, double delay=0)
Sends a joystick message to the simulation.
virtual void updateTowMenuTargetState()
Refreshes whether the towing menu has a visible interaction target.
virtual void clearTowOwnershipTransferState()
Clears pending towing ownership-transfer state.
virtual void onVreBackendChanged(const DtSimulationAddress &vreBackendAddress)
Callback for changes to the local VRE backend address.
bool myTowOwnershipTransferWaitingForHook
True after acquire success while waiting for the normal hook target to appear.
Definition towingControlLogic.h:266
double myTowHookHandoffTimeoutSeconds
Timeout in seconds to wait for the tow hook to engage after transfer succeeds.
Definition towingControlLogic.h:195
virtual void updateTowCandidateState()
Refreshes fallback tow-candidate state from the tow-hook sensor contact map.
DtEntityIdentifier myTransferredTowTargetEntityId
Entity identifier of the transferred tow target while it is being towed.
Definition towingControlLogic.h:287
virtual const char * type() const override
Returns the component type identifier.
DtUUID myTowCandidateUuid
UUID of the fallback tow candidate.
Definition towingControlLogic.h:254
virtual void updateTransferredTowTargetRelease(double dt)
Releases the transferred tow target after it leaves sensor range and the delay expires.
virtual void onTowCandidateSimEngineAddressChanged(const DtAttributeHandle &attr)
Callback for tracked tow-candidate sim-engine updates.
virtual bool initialize(DtPlayerStation *player, DtInitTable &config) override
Initializes the towing control logic from Lua configuration.
virtual void releaseTransferredTowTarget()
Releases the transferred tow target after towing stops.
virtual void startTowOwnershipTransfer()
Starts ownership transfer for the current fallback tow candidate.
DtUUID myTransferredTowTargetUuid
UUID of the transferred tow target while it is being towed.
Definition towingControlLogic.h:284
virtual void tick(double dt) override
Updates pending tow-transfer handoff state.
virtual void updateTowCandidateSimEngineAttrs(const TowSensorContactsMap &sensorContacts)
Synchronizes persistent simEngineAddress handles for the current contact set.
virtual void updateHookActionLabel()
Refreshes the dynamic towing action-menu label.
virtual ~DtTowingControlLogic() override
Virtual destructor for DtTowingControlLogic.
DtAttributeHandleType< bool > myHookedSourceAttr
Source attribute handle tracking whether the ownship is already hooked. Reads the extended-state alia...
Definition towingControlLogic.h:199
DtAttributeHandleType< std::string > myHookTargetUuidSourceAttr
Source attribute handle storing the authoritative same-backend hook target UUID. Reads the extended-s...
Definition towingControlLogic.h:203
virtual void releasePendingTowTransferTarget()
Releases an acquired tow target that could not be hooked.
DtAttributeHandleType< TowSensorContactsMap > mySensorContactsAttr
Sensor contacts used to discover nearby tow targets.
Definition towingControlLogic.h:207
bool myTowOwnershipTransferInProgress
True while a tow-target ownership acquire is in flight.
Definition towingControlLogic.h:263
virtual void setHook(double val)
Controls the towing hook.
bool myHasHookTarget
True when there is a valid authoritative tow hook target entity.
Definition towingControlLogic.h:248
virtual void tryAutoHookAfterTransfer()
Attempts to hand off to the normal Vortex hook path after acquire success.
std::map< DtUUID, DtAttributeHandleType< DtSimulationAddress > > TowCandidateSimEngineAttrMap
Definition towingControlLogic.h:62
virtual void onHookedChanged(bool hooked)
Callback for changes to local hooked state.
DtEntityIdentifier myPendingTowTransferEntityId
Entity identifier of the tow target being acquired.
Definition towingControlLogic.h:278
virtual void queueTowTargetStateProperty(const DtEntityIdentifier &entityId, const std::string &name, const std::string &value, bool isBoolean)
Queues a set-state-property request for a tow target entity.
double myTransferredTowReleaseDelay
Seconds remaining before releasing the transferred tow target after it leaves sensor contacts.
Definition towingControlLogic.h:293
DtAttributeHandleType< std::string > myHookActionLabelAttr
Attribute handle storing the dynamic label for the towing action-menu item. Consumed by the towing ac...
Definition towingControlLogic.h:239
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Defines the logic for controlling entities in VR-Engage.
constexpr auto ownershipReleaseDelaySeconds
Definition towingControlLogic.h:44
constexpr auto ownershipAcquireDelaySeconds
Definition towingControlLogic.h:41
constexpr auto hookHandoffTimeoutSeconds
Definition towingControlLogic.h:47
constexpr auto hasTowHook
Definition towingControlLogic.h:38
Defines export/import macros for the vreCommonComponents library.
#define VRECOMMONCOMPONENTS_DLL
DLL export/import macro for the vreCommonComponents library.
Definition export.h:28
Definition towingControlLogic.h:30
!
Definition glsVreMessageUtil.h:50
constexpr auto DtTowingControlLogicType
Type identifier for DtTowingControlLogic component.
Definition towingControlLogic.h:52
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33