VR-Engage  2.3
Loading...
Searching...
No Matches
actionMenuLogic.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file actionMenuLogic.h
7//! \brief Defines the action menu management and logic for VR-Engage
8//!
9//! This file contains the DtActionMenuLogic class which manages the interaction
10//! menus for entities in the simulation. It controls the visibility and behavior
11//! of action menus, processes entity interactions, and handles user selections.
12//! The class manages both static action menus and context-sensitive quick menus
13//! that appear when the player approaches interactive objects.
14
15#pragma once
16
20
25
28
31
32#include <matrix/vlVector.h>
33
34namespace makVre
35{
36
38{
39//! \ingroup RoleConfigParams
40//! \defgroup ActionMenuLogicRoleParams Action Menu Logic Role Parameters
41//! \roleInherits{PlayerComponentRoleParams}
42//! Configuration Options for action menu logic component.
43//! @{
44
45//! \vreRoleParam{entityQuickMenus,table,{},actionMenuLogic,Configuration table defining quick menus for different entity types and interaction contexts.}
46constexpr const char* entityQuickMenus = "entityQuickMenus";
47
48//! \vreRoleParam{slotProximityAngleWeight,double,varies,actionMenuLogic,Weight factor for angle consideration in slot proximity calculations.}
49constexpr const char* slotProximityAngleWeight = "slotProximityAngleWeight";
50
51//! \vreRoleParam{slotProximityFov,double,varies,actionMenuLogic,Field of view angle in degrees for slot proximity detection.}
52constexpr const char* slotProximityFov = "slotProximityFov";
53
54//! \vreRoleParam{slotProximityMaxDistance,double,varies,actionMenuLogic,Maximum distance in meters for slot proximity detection.}
55constexpr const char* slotProximityMaxDistance = "slotProximityMaxDistance";
56
57//! \vreRoleParam{slotProximityOverlapDist,double,varies,actionMenuLogic,Distance threshold for handling overlapping slot proximity zones.}
58constexpr const char* slotProximityOverlapDist = "slotProximityOverlapDist";
59
60//! \vreRoleParam{slotProximityRearMaxDist,double,varies,actionMenuLogic,Maximum distance for rear-facing slot proximity detection.}
61constexpr const char* slotProximityRearMaxDist = "slotProximityRearMaxDist";
62
63//! \vreRoleParam{slotProximityZScale,double,varies,actionMenuLogic,Z-axis scaling factor for slot proximity calculations.}
64constexpr const char* slotProximityZScale = "slotProximityZScale";
65
66//! @}
67} // namespace ActionMenuLogicConfig
68
69} // namespace makVre
70
71namespace makVrv
72{
73class DtSceneObject;
74}
75
76namespace makVre
77{
78class DtActionJoystickControl;
79class DtActionMenuEventProcessor;
80class DtMenuManager;
81
82//! \brief Type identifier constant for DtActionMenuLogic components
83//!
84//! This constant defines the string identifier used to identify DtActionMenuLogic
85//! component types within the VR-Engage framework. It is used for component
86//! registration, type checking, and serialization operations.
87constexpr const char* DtActionMenuLogicType = "DtActionMenuLogic";
88
89//! \brief Component for managing entity interaction menus and their logic
90//!
91//! DtActionMenuLogic is responsible for handling all user interaction menus
92//! in VR-Engage. It manages both static menus (like the main action menu) and
93//! context-sensitive quick menus that appear when the player approaches interactive
94//! objects like vehicles for embarkation, control stations, or other entities with
95//! interaction points.
96//!
97//! The class processes entity proximity, evaluates interaction conditions, and
98//! provides the appropriate menu options based on the current context. It also
99//! handles menu selections and dispatches the appropriate actions in response.
101{
102public:
103 //! \brief Constructor
104 //!
105 //! Creates a new action menu logic component with default state.
107
108 //! \brief Virtual destructor
109 //!
110 //! Ensures proper cleanup of derived action menu logic classes.
111 virtual ~DtActionMenuLogic() override;
112
113 //! \brief Gets the menu manager instance
114 //! \return Pointer to the menu manager
115 //!
116 //! Provides access to the menu manager that controls all menus for this
117 //! player station instance. The menu manager handles the creation, organization,
118 //! and display of menus.
120
121 //! \brief Initializes the action menu logic
122 //! \param player Pointer to the owning player station
123 //! \param config Configuration data for initialization
124 //! \return True if initialization succeeded, false otherwise
125 //!
126 //! Sets up the action menu system based on the provided configuration.
127 //! This includes loading menu definitions, setting up input handlers,
128 //! and initializing the menu manager.
129 virtual bool initialize(DtPlayerStation* player, DtInitTable& config) override;
130
131 //! \brief Performs post-initialization setup
132 //! \return True if post-initialization succeeded, false otherwise
133 //!
134 //! Completes setup tasks that need to occur after basic initialization,
135 //! such as connecting to message handlers and setting up callbacks.
136 virtual bool postInitialize() override;
137
138 //! \brief Updates the menu system
139 //! \param dt Time interval since the last tick in seconds
140 //!
141 //! Called once per frame to update the menu system. This includes checking
142 //! for proximity to interaction points, updating menu visibility, and
143 //! processing any pending menu actions.
144 virtual void tick(double dt) override;
145
146 //! \brief Shuts down the action menu system
147 //!
148 //! Performs cleanup when the action menu system is no longer needed.
149 //! This includes disconnecting from message handlers, removing input
150 //! handlers, and destroying menu resources.
151 virtual void shutdown() override;
152
153 //! \brief Returns the component type identifier
154 //! \return String identifier for this component type
155 //!
156 //! Returns the type identifier string for this component, which is used
157 //! by the VR-Engage framework for component identification and management.
158 //! The returned value matches DtActionMenuLogicType.
159 virtual const char* type() const override;
160
161 //! \brief Handles changes in player embarkation state
162 //! \param embarked True if the player is now embarked, false if disembarked
163 //!
164 //! Called when the player's embarkation state changes. This affects the
165 //! available menu options, as different actions are available depending on
166 //! whether the player is on foot or in a vehicle.
167 virtual void handleEmbarkedChanged(bool embarked);
168
169 //! \brief Handles changes in player aiming state
170 //! \param aiming True if the player is now aiming, false otherwise
171 //!
172 //! Called when the player's aiming state changes. This may affect menu
173 //! visibility and available options, as some menus may be disabled while aiming.
174 virtual void handleAimingChanged(bool aiming);
175
176 //! \brief Handles changes in player health
177 //! \param health New health value
178 //!
179 //! Called when the player's health changes. This may affect available menu
180 //! options, such as enabling medical actions when health is low.
181 virtual void handleHealthChanged(double health);
182
183 //! \brief Applies SupportsVreSlots state for the current quick-menu entity
184 //! \param supportsVreSlots True if the current entity supports VRE slots
185 //!
186 //! Updates slot support state and refreshes quick menu visibility.
187 //! Used by sync logic when current entity state data is evaluated.
188 virtual void handleSupportsVreSlotsChanged(bool supportsVreSlots);
189
190 //! \brief Handles changes in deployed objects list
191 //! \param deployableObjects Map of deployed object identifiers to entity data
192 //!
193 //! Called when the list of player-deployed objects (like sensors, markers, etc.)
194 //! changes. This affects the available menu options for interacting with
195 //! deployed objects.
197 makVre::DeployableObjectStateMap deployableObjects);
198
199 //! \brief Shows a specific menu
200 //! \param name Name of the menu to show (defaults to "Action" for main menu)
201 //! \param type Type of menu display (static or dynamic/contextual)
202 //! \param selection Initial selection to make in the menu
203 //!
204 //! Displays the specified menu to the user. The menu type determines how it
205 //! behaves - static menus remain open until explicitly closed, while dynamic
206 //! menus may close automatically after selection or when context changes.
207 virtual void showMenu(const std::string& name = "Action",
208 MenuSetStateMessage::Type type = MenuSetStateMessage::Type_STATIC, const std::string& selection = "");
209
210 //! \brief Hides a specific menu
211 //! \param name Name of the menu to hide
212 //!
213 //! Hides the specified menu if it is currently visible.
214 virtual void hideMenu(const std::string& name);
215
216 //! \brief Hides the currently active quick menu
217 //!
218 //! Hides any context-sensitive quick menu that is currently visible.
219 //! Quick menus appear when the player approaches interactive objects.
220 virtual void hideQuickMenu();
221
222 //! \brief Toggles the main action menu
223 //! \param val Input value (typically 1.0 for full toggle)
224 //!
225 //! Toggles the visibility of the main action menu. If it's currently
226 //! visible, it will be hidden; if hidden, it will be shown. The value
227 //! parameter supports analog inputs like joysticks.
228 virtual void toggleActionMenu(float val = 1);
229
230 //! \brief Gets the entity ID associated with the current quick menu
231 //! \return Entity identifier for the current quick menu target
232 //!
233 //! Returns the identifier of the entity that the current quick menu
234 //! is associated with (e.g., a vehicle the player is interacting with).
235 //! Returns an empty identifier if no quick menu is active.
236 virtual DtEntityIdentifier currentQuickMenuEntityId();
237
238protected:
239 //! \brief Updates the current action object
240 //! \param entityId Identifier of the entity to set as the current action object
241 //! \param entityType Type of the entity
242 //! \param marking Entity marking or name
243 //!
244 //! Sets the specified entity as the current action object, which affects
245 //! the available menu options and context-sensitive actions.
246 virtual void updateActionObject(
247 const DtEntityIdentifier& entityId, const DtEntityType& entityType, const std::string& marking);
248
249 //! \brief Checks if menu display conditions are met
250 //! \return True if conditions for displaying menus are satisfied
251 //!
252 //! Evaluates the current state to determine if menus should be displayed.
253 //! This considers factors like player posture, health, and context.
255
256 //! \brief Updates quick menu visibility based on current state
257 //!
258 //! Determines whether context-sensitive quick menus should be shown or hidden
259 //! based on proximity to interactive objects and other conditions.
261
262 //! \brief Checks if action points in an entity's embarkation message are actionable
263 //! \param msg The embarkation information message to evaluate
264 //! \return True if any action points are actionable, false otherwise
265 //!
266 //! Examines embarkation information to determine if any action points
267 //! (like entry points, control stations, etc.) are within interactive range.
269
270 //! \brief Processes action points for a slotted entity
271 //! \param msg Embarkation information message containing action point data
272 //! \return True if action points were successfully processed
273 //!
274 //! Analyzes and processes action points for slotted entities (like vehicles
275 //! with multiple seats/positions), determining which are actionable and
276 //! should appear in menus.
278
279 //! \brief Finds the coordinate transformations needed for action point processing
280 //! \param obj Scene object representing the entity with action points
281 //! \param ownPos Output parameter for player's position
282 //! \param objPos Output parameter for object's position
283 //! \param worldToOwnRot Output parameter for world-to-player rotation matrix
284 //! \param objToWorldRot Output parameter for object-to-world rotation matrix
285 //! \return True if transforms were successfully computed
286 //!
287 //! Calculates the positions and rotation matrices needed to transform action points
288 //! from object space to world space for distance and angle calculations.
289 virtual bool findTransformsForSlotPointProcessing(const makVrv::DtSceneObject* obj, DtVector& ownPos,
290 DtVector& objPos, DtDcm& worldToOwnRot, DtDcm& objToWorldRot) const;
291
292 //! \brief Identifies actionable points based on proximity and orientation
293 //! \param ownPos Player's position
294 //! \param objPos Object's position
295 //! \param worldToOwnRot World-to-player rotation matrix
296 //! \param objToWorldRot Object-to-world rotation matrix
297 //! \param actionPoints List of action points to evaluate
298 //! \return True if any actionable points were found
299 //!
300 //! Analyzes each action point to determine if it's within actionable range
301 //! and orientation relative to the player, scoring them for priority.
302 virtual bool findActionablePoints(const DtVector& ownPos, const DtVector& objPos, const DtDcm& worldToOwnRot,
303 const DtDcm& objToWorldRot, const std::vector<EntityEmbarkationInformationMessage::ActionPoint>& actionPoints);
304
305 //! \brief Scores an action point for actionability
306 //! \param vecToPoint Vector from player to action point
307 //! \param maxDist Maximum distance for actionability
308 //! \param retScore Output parameter for the computed score
309 //! \return True if the action point is within actionable range
310 //!
311 //! Computes a score for an action point based on distance and orientation
312 //! relative to the player. Higher scores indicate more easily accessible points.
313 virtual bool scoreActionPoint(DtVector vecToPoint, double maxDist, double& retScore);
314
315 //! \brief Modifies a vector to an action point before scoring
316 //! \param vecToPoint Vector to modify
317 //!
318 //! Applies adjustments to the vector from player to action point before
319 //! scoring, such as scaling components or normalizing.
320 virtual void modifyActionPointVectorBeforeScore(DtVector& vecToPoint);
321
322 //! \brief Combines dot product and distance scores
323 //! \param dotScore Score based on dot product (angle)
324 //! \param distScore Score based on distance
325 //! \return Combined score
326 //!
327 //! Combines the orientation and distance scores into a single value
328 //! representing the overall accessibility of an action point.
329 virtual double combineDotAndDistScore(double dotScore, double distScore);
330
331 //! \brief Handles sensor update messages
332 //! \param message Pointer to the sensor update message
333 //! \return Message handling result
334 //!
335 //! Processes sensor update messages that may affect menu options
336 //! for sensor-related actions.
338
339 //! \brief Handles embarkation information messages
340 //! \param msg Pointer to the embarkation information message
341 //! \return Message handling result
342 //!
343 //! Processes embarkation information that describes interaction points
344 //! for entities like vehicles, which affects quick menu availability.
346
347 //! \brief Handles menu state messages
348 //! \param msg Pointer to the menu message
349 //! \return Message handling result
350 //!
351 //! Processes messages related to menu state changes, such as requests
352 //! to show or hide specific menus.
354
355 //! \brief Handles menu action messages
356 //! \param msg Pointer to the menu action message
357 //! \return Message handling result
358 //!
359 //! Processes action messages generated when a user selects an option
360 //! from a menu, executing the corresponding action.
362
363 //! \brief Updates the selected deployable object's menu attributes.
364 //!
365 //! Sets the menuDeployable name and derives its state attributes from the
366 //! current deployable-objects player attribute.
367 //!
368 //! \param object Name of the deployable object to select.
369 virtual void updateMenuDeployableAttributes(const std::string& object);
370
371 //! \brief Handles entity discovery messages
372 //! \param msg Pointer to the entity discovered message
373 //! \return Message handling result
374 //!
375 //! Processes notifications about newly discovered entities that
376 //! may be candidates for interaction menus.
378
379 //! \brief Handles entity removal messages
380 //! \param msg Pointer to the entity removed message
381 //! \return Message handling result
382 //!
383 //! Processes notifications about entities being removed from the
384 //! simulation, cleaning up any associated menu resources.
386
387 //! \brief Handles responses to entity type queries
388 //! \param msg Pointer to the response message
389 //! \return Message handling result
390 //!
391 //! Processes responses to queries about entities of specific types,
392 //! which may affect available menu options for type-specific actions.
394
395 //! \brief Handles session play state changes
396 //! \param msg Pointer to the session play state message
397 //! \return Message handling result
398 //!
399 //! Processes notifications about simulation session state changes
400 //! (e.g., paused, playing, stopped), which may affect menu availability.
402
403 //! \brief Checks if an entity ID corresponds to a deployed object
404 //! \param entityId The entity identifier to check
405 //! \return True if the entity is a deployable object, false otherwise
406 //!
407 //! Determines whether the specified entity is one of the player's
408 //! deployable objects (like sensors, markers, etc.).
409 virtual bool entityIdIsDeployableObject(const DtEntityIdentifier& entityId);
410
411 //! \brief Checks if the player has a ground vehicle license
412 //! \return True if the player has a ground vehicle license, false otherwise
413 //!
414 //! Checks state attribute "GroundVehicleEnabled" to determine if player has a ground vehicle license.
415 virtual bool groundVehicleIsEnabled() const;
416
417 //! \brief Checks if a vehicle has an implicit driver
418 //! \param vehicleId Identifier of the vehicle to check
419 //! \return True if the vehicle has an implicit driver, false otherwise
420 //!
421 //! Checks if given vehicle has an implicit driver (a visual-only model of a driver occupant).
422 virtual bool vehicleHasImplicitDriver(const DtEntityIdentifier& vehicleId) const;
423
424 //! \brief Input logic handler for menu interactions
425 //!
426 //! Manages input mapping and handling for menu navigation and selection.
428
429 //! \brief Configuration table for quick menus
431
432 //! \brief Name of the currently active quick menu
434
435 //! \brief Entity ID associated with the current quick menu
436 DtEntityIdentifier myCurrentQuickMenuEntityId;
437
438 //! \brief Entity type of the current quick menu target
440
441 //! \brief Flag indicating if the current entity is a host entity
443
444 //! \brief Flag indicating if the current entity supports VRE slots
446
447 //! \brief Last received embarkation information message
448 //!
449 //! Stores the most recent embarkation information for slot processing,
450 //! containing action points and slot details for interactive entities.
452
453 //! \brief Timer for quick menu slot proximity checks
454 //!
455 //! Controls how frequently slot proximity is checked for quick menu updates.
457
458 //! \brief Maximum distance for slot proximity detection
459 //!
460 //! The maximum distance at which slots/action points are considered actionable.
462
463 //! \brief Scaling factor for vertical (Z) distance in proximity calculations
464 //!
465 //! Adjusts the importance of vertical distance in determining proximity to action points.
467
468 //! \brief Weight given to angle in proximity calculations
469 //!
470 //! Determines how heavily the angle between player and action point affects actionability.
472
473 //! \brief Field of view angle for forward-facing action points
474 //!
475 //! The angle (in radians) defining the forward field of view within which
476 //! action points are more easily actionable.
478
479 //! \brief Maximum distance for rear-facing action points
480 //!
481 //! The maximum distance at which action points behind the player are actionable.
483
484 //! \brief Distance overlap tolerance for action points
485 //!
486 //! The distance by which action point ranges can overlap before prioritization occurs.
488
489 //! \brief Map of actionable points and their priority scores
490 //!
491 //! Maps action point identifiers to their calculated priority scores.
492 std::map<std::string, int> myActionablePointsMap;
493
494 //! \brief Last notification or hint displayed to the user
495 //!
496 //! Stores the text of the last note shown to avoid duplicate notifications.
497 std::string myLastNote;
498
499 //! \brief Location of the current task objective
500 //!
501 //! Stores the position of the current objective or task target.
503
504 //! \brief Flag to toggle debug menu visibility
505 //!
506 //! Controls whether debug menus are shown for development and testing.
508
509 //! \brief Type definition for waypoint maps
510 //!
511 //! Maps waypoint identifiers to waypoint information.
512 using WaypointMap = std::map<std::string, std::string>;
513
514 //! \brief Type definition for route maps
515 //!
516 //! Maps route identifiers to route information.
517 using RouteMap = std::map<std::string, std::string>;
518
519 //! \brief Type definition for bullseye maps
520 //!
521 //! Maps bullseye identifiers to bullseye information.
522 //! Used to show VRF Bullseye list in VRE pilot Set Bullseye menu.
523 using BullseyeMap = std::map<std::string, std::string>;
524
525 //! \brief Handle for ownship embarked state.
526 //! \vreAttrKey{ownship.embarked}
528
529 //! \brief Handle for ownship embarked host identifier.
530 //! \vreAttrKey{ownship.embarked.host}
532
533 //! \brief Handle for ownship embarked host entity type.
534 //! \vreAttrKey{ownship.embarked.hostType}
536
537 //! \brief Handle for ownship embarked slot name.
538 //! \vreAttrKey{ownship.embarked.embarkedInSlot}
540
541 //! \brief Handle for ownship health state.
542 //! \vreAttrKey{health}
544
545 //! \brief Handle for aiming state.
546 //! \vreAttrKey{aiming}
548
549 //! \brief Handle for sitting state.
550 //! \vreAttrKey{sitting}
552
553 //! \brief Handle indicating whether a quick menu is available.
554 //! \vreAttrKey{hasQuickMenu}
556
557 //! \brief Handle indicating whether the selected entity is owned by the player.
558 //! \vreAttrKey{ownsEntity}
560
561 //! \brief Handle indicating that VRE slots are unavailable for the selected entity.
562 //! \vreAttrKey{noVreSlotSupport}
564
565 //! \brief Handle indicating that VRE slots are unavailable for the selected entity.
566 //! \vreAttrKey{SupportsVreSlots}
568
569 //! \brief Handle for currently actionable point identifiers.
570 //! \vreAttrKey{actionablePoints}
572
573 //! \brief Handle indicating whether the host is walkable.
574 //! \vreAttrKey{hostWalkable}
576
577 //! \brief Handle for current observer attach mode.
578 //! \vreAttrKey{observerAttachMode}
580
581 //! \brief Handle for the selected host marking string.
582 //! \vreAttrKey{hostMarking}
584
585 //! \brief Handle for waypoint map data used by menus.
586 //! \vreAttrKey{waypoints}
588
589 //! \brief Handle for route map data used by menus.
590 //! \vreAttrKey{routes}
592
593 //! \brief Handle for bullseye map data used by menus.
594 //! \vreAttrKey{bullseyes}
596
597 //! \brief Handle root for deployable menu state attributes.
598 //! \vreAttrKey{menuDeployable}
600
601};
602
603} // namespace makVre
Provides handle classes for safe access to attributes.
virtual bool findTransformsForSlotPointProcessing(const makVrv::DtSceneObject *obj, DtVector &ownPos, DtVector &objPos, DtDcm &worldToOwnRot, DtDcm &objToWorldRot) const
Finds the coordinate transformations needed for action point processing.
virtual DtVreMessageResult handleEntityDiscovered(DtVreMessage *msg)
Handles entity discovery messages.
DtAttributeHandleType< bool > myHasQuickMenuAttr
Handle indicating whether a quick menu is available.
Definition actionMenuLogic.h:555
std::map< std::string, std::string > BullseyeMap
Type definition for bullseye maps.
Definition actionMenuLogic.h:523
double mySlotProximityOverlapDist
Distance overlap tolerance for action points.
Definition actionMenuLogic.h:487
virtual bool scoreActionPoint(DtVector vecToPoint, double maxDist, double &retScore)
Scores an action point for actionability.
DtAttributeHandleType< bool > mySupportsVreSlotsAttr
Handle indicating that VRE slots are unavailable for the selected entity.
Definition actionMenuLogic.h:567
DtAttributeHandleType< bool > myNoVreSlotSupportAttr
Handle indicating that VRE slots are unavailable for the selected entity.
Definition actionMenuLogic.h:563
virtual void showMenu(const std::string &name="Action", MenuSetStateMessage::Type type=MenuSetStateMessage::Type_STATIC, const std::string &selection="")
Shows a specific menu.
double mySlotProximityRearMaxDist
Maximum distance for rear-facing action points.
Definition actionMenuLogic.h:482
virtual ~DtActionMenuLogic() override
Virtual destructor.
DtInputLogic myInputLogic
Input logic handler for menu interactions.
Definition actionMenuLogic.h:427
virtual DtVreMessageResult handleEntityEmbarkationInformationMessage(DtVreMessage *msg)
Handles embarkation information messages.
DtAttributeHandleType< std::string > myHostMarkingAttr
Handle for the selected host marking string.
Definition actionMenuLogic.h:583
DtAttributeHandleType< std::string > myOwnshipEmbarkedInSlotAttr
Handle for ownship embarked slot name.
Definition actionMenuLogic.h:539
bool myCurrentEntityIsHost
Flag indicating if the current entity is a host entity.
Definition actionMenuLogic.h:442
virtual void hideMenu(const std::string &name)
Hides a specific menu.
double mySlotProximityZScale
Scaling factor for vertical (Z) distance in proximity calculations.
Definition actionMenuLogic.h:466
virtual void handleDeployableObjectsChanged(makVre::DeployableObjectStateMap deployableObjects)
Handles changes in deployed objects list.
virtual bool vehicleHasImplicitDriver(const DtEntityIdentifier &vehicleId) const
Checks if a vehicle has an implicit driver.
bool myCurrentEntitySupportsVreSlots
Flag indicating if the current entity supports VRE slots.
Definition actionMenuLogic.h:445
DtAttributeHandle myMenuDeployableAttr
Handle root for deployable menu state attributes.
Definition actionMenuLogic.h:599
virtual bool checkMenuDisplayConditionsMet()
Checks if menu display conditions are met.
std::map< std::string, int > myActionablePointsMap
Map of actionable points and their priority scores.
Definition actionMenuLogic.h:492
std::map< std::string, std::string > WaypointMap
Type definition for waypoint maps.
Definition actionMenuLogic.h:512
virtual const char * type() const override
Returns the component type identifier.
virtual DtVreMessageResult handleSessionPlayState(DtVreMessage *msg)
Handles session play state changes.
virtual double combineDotAndDistScore(double dotScore, double distScore)
Combines dot product and distance scores.
DtAttributeHandleType< WaypointMap > myWaypointsAttr
Handle for waypoint map data used by menus.
Definition actionMenuLogic.h:587
std::map< std::string, std::string > RouteMap
Type definition for route maps.
Definition actionMenuLogic.h:517
DtEntityIdentifier myCurrentQuickMenuEntityId
Entity ID associated with the current quick menu.
Definition actionMenuLogic.h:436
virtual DtMenuManager * getMenuManager() const
Gets the menu manager instance.
virtual DtEntityIdentifier currentQuickMenuEntityId()
Gets the entity ID associated with the current quick menu.
virtual void handleAimingChanged(bool aiming)
Handles changes in player aiming state.
virtual void modifyActionPointVectorBeforeScore(DtVector &vecToPoint)
Modifies a vector to an action point before scoring.
DtAttributeHandleType< DtEntityType > myOwnshipEmbarkedHostTypeAttr
Handle for ownship embarked host entity type.
Definition actionMenuLogic.h:535
DtAttributeHandleType< bool > myHostWalkableAttr
Handle indicating whether the host is walkable.
Definition actionMenuLogic.h:575
DtAttributeHandleType< RouteMap > myRoutesAttr
Handle for route map data used by menus.
Definition actionMenuLogic.h:591
virtual void handleSupportsVreSlotsChanged(bool supportsVreSlots)
Applies SupportsVreSlots state for the current quick-menu entity.
DtAttributeHandleType< bool > myAimingAttr
Handle for aiming state.
Definition actionMenuLogic.h:547
DtAttributeHandleType< double > myHealthAttr
Handle for ownship health state.
Definition actionMenuLogic.h:543
double mySlotProximityFov
Field of view angle for forward-facing action points.
Definition actionMenuLogic.h:477
virtual bool findActionablePoints(const DtVector &ownPos, const DtVector &objPos, const DtDcm &worldToOwnRot, const DtDcm &objToWorldRot, const std::vector< EntityEmbarkationInformationMessage::ActionPoint > &actionPoints)
Identifies actionable points based on proximity and orientation.
DtAttributeHandleType< ObserverAttachMode > myObserverAttachModeAttr
Handle for current observer attach mode.
Definition actionMenuLogic.h:579
DtAttributeHandleType< DtEntityIdentifier > myOwnshipEmbarkedHostAttr
Handle for ownship embarked host identifier.
Definition actionMenuLogic.h:531
DtAttributeHandleType< bool > mySittingAttr
Handle for sitting state.
Definition actionMenuLogic.h:551
virtual void updateMenuDeployableAttributes(const std::string &object)
Updates the selected deployable object's menu attributes.
std::string myLastNote
Last notification or hint displayed to the user.
Definition actionMenuLogic.h:497
virtual DtVreMessageResult handleSensorUpdate(DtVreMessage *message)
Handles sensor update messages.
virtual DtVreMessageResult handleEntityRemoved(DtVreMessage *msg)
Handles entity removal messages.
double mySlotProximityAngleWeight
Weight given to angle in proximity calculations.
Definition actionMenuLogic.h:471
DtAttributeHandleType< BullseyeMap > myBullseyesAttr
Handle for bullseye map data used by menus.
Definition actionMenuLogic.h:595
virtual bool initialize(DtPlayerStation *player, DtInitTable &config) override
Initializes the action menu logic.
bool myDebugMenuToggle
Flag to toggle debug menu visibility.
Definition actionMenuLogic.h:507
virtual DtVreMessageResult handleMenuAction(DtVreMessage *msg)
Handles menu action messages.
EntityEmbarkationInformationMessage myLastSlotDataMessage
Last received embarkation information message.
Definition actionMenuLogic.h:451
virtual DtVreMessageResult handleMenuMessage(DtVreMessage *msg)
Handles menu state messages.
DtActionMenuLogic()
Constructor.
double myQuickMenuSlotTickTimer
Timer for quick menu slot proximity checks.
Definition actionMenuLogic.h:456
virtual void handleHealthChanged(double health)
Handles changes in player health.
virtual bool postInitialize() override
Performs post-initialization setup.
virtual DtVreMessageResult handleRequestEntitiesByTypeResponse(DtVreMessage *msg)
Handles responses to entity type queries.
std::string myCurrentQuickMenu
Name of the currently active quick menu.
Definition actionMenuLogic.h:433
DtAttributeHandleType< bool > myOwnshipEmbarkedAttr
Handle for ownship embarked state.
Definition actionMenuLogic.h:527
virtual void shutdown() override
Shuts down the action menu system.
double mySlotProximityMaxDistance
Maximum distance for slot proximity detection.
Definition actionMenuLogic.h:461
virtual bool entityIdIsDeployableObject(const DtEntityIdentifier &entityId)
Checks if an entity ID corresponds to a deployed object.
virtual void updateActionObject(const DtEntityIdentifier &entityId, const DtEntityType &entityType, const std::string &marking)
Updates the current action object.
virtual bool processSlotActionPoints(const EntityEmbarkationInformationMessage &msg)
Processes action points for a slotted entity.
virtual void updateQuickMenuVisibility()
Updates quick menu visibility based on current state.
virtual void hideQuickMenu()
Hides the currently active quick menu.
DtEntityType myCurrentQuickMenuEntityType
Entity type of the current quick menu target.
Definition actionMenuLogic.h:439
virtual bool groundVehicleIsEnabled() const
Checks if the player has a ground vehicle license.
DtAttributeHandleType< std::vector< std::string > > myActionablePointsAttr
Handle for currently actionable point identifiers.
Definition actionMenuLogic.h:571
virtual void toggleActionMenu(float val=1)
Toggles the main action menu.
DtAttributeHandleType< bool > myOwnsEntityAttr
Handle indicating whether the selected entity is owned by the player.
Definition actionMenuLogic.h:559
virtual void tick(double dt) override
Updates the menu system.
virtual bool checkActionPointListActionable(const EntityEmbarkationInformationMessage &msg)
Checks if action points in an entity's embarkation message are actionable.
virtual void handleEmbarkedChanged(bool embarked)
Handles changes in player embarkation state.
DtInitTable myQuickMenuTable
Configuration table for quick menus.
Definition actionMenuLogic.h:430
DtVector myTaskLocation
Location of the current task objective.
Definition actionMenuLogic.h:502
Handle class for safe access to attributes.
Definition attributeHandle.h:30
Type-specific handle class for attributes.
Definition attributeHandle.h:229
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Class for managing input configuration and handling in VR-Engage.
Definition inputLogic.h:39
Central manager for all menus in VR-Engage.
Definition actionMenuManager.h:111
virtual DtPlayerStation & player()
Gets the player station.
virtual const std::string & name()
Gets the component name.
DtPlayerComponent()
Constructor.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Contains embarkation information for an entity.
Definition EntityEmbarkationInformation.h:35
Type
Type enumeration.
Definition menuSetState.h:44
@ Type_STATIC
Definition menuSetState.h:45
constexpr const char * slotProximityMaxDistance
Definition actionMenuLogic.h:55
constexpr const char * slotProximityFov
Definition actionMenuLogic.h:52
constexpr const char * slotProximityOverlapDist
Definition actionMenuLogic.h:58
constexpr const char * slotProximityRearMaxDist
Definition actionMenuLogic.h:61
constexpr const char * slotProximityAngleWeight
Definition actionMenuLogic.h:49
constexpr const char * slotProximityZScale
Definition actionMenuLogic.h:64
constexpr const char * entityQuickMenus
Definition actionMenuLogic.h:46
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Defines the DtInputLogic class for handling input in VR-Engage.
Definition actionMenuLogic.h:38
!
Definition glsVreMessageUtil.h:50
std::map< std::string, DeployableObject > DeployableObjectStateMap
Definition deployableObjectsTypes.h:29
constexpr const char * DtActionMenuLogicType
Type identifier constant for DtActionMenuLogic components.
Definition actionMenuLogic.h:87
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Definition appLauncherComponent.h:28
Defines the DtPlayerComponent base class for VR-Engage role components.
Common enumeration definitions used throughout the VREngage system.