VR-Engage  2.2
Loading...
Searching...
No Matches
humanMenuLogic.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file humanMenuLogic.h
7//! \brief Defines DtHumanMenuLogic for managing human-specific menu interactions
8//! \ingroup vreHumanFrontend
9
10#pragma once
11
13
16
17#include <string>
18
19namespace makVre
20{
21//! \brief Forward declaration of the action menu logic class
23
24//! \brief Forward declaration of the human control logic class
26
28{
29//! \ingroup RoleConfigParams
30//! \defgroup HumanMenuLogicRoleParams Human Menu Logic Role Parameters
31//! \roleInherits{PlayerComponentRoleParams}
32//! Configuration Options for humanMenuLogic role.
33//! @{
34
35//! \vreRoleParam{shooteeName,string,"target",humanMenuLogic,Default name for entities to be used as shooting targets.}
36constexpr const char* shooteeName = "shooteeName";
37
38//! \vreRoleParam{taskeeName,string,"shooter",humanMenuLogic,Default name for entities to be assigned tasks.}
39constexpr const char* taskeeName = "taskeeName";
40
41//! \vreRoleParam{waypointName,string,"Waypoint 1",humanMenuLogic,Default name for waypoints in movement tasks.}
42constexpr const char* waypointName = "waypointName";
43
44//! @}
45} // namespace HumanMenuLogicConfig
46
47//! \brief Type identifier constant for DtHumanMenuLogic components
48//!
49//! This constant defines the string identifier used to identify DtHumanMenuLogic
50//! component types within the VR-Engage framework. It is used for component
51//! registration, type checking, and serialization operations.
52constexpr const char* DtHumanMenuLogicType = "DtHumanMenuLogic";
53
54//! \brief Menu logic component for the human role
55//!
56//! DtHumanMenuLogic manages context-sensitive menus and commands for the human
57//! entity, handling interactions with other entities, task selections, and special
58//! actions. It processes menu selections and converts them into appropriate
59//! simulation commands.
61{
62public:
63 //! \brief Default constructor
65
66 //! \brief Virtual destructor
67 virtual ~DtHumanMenuLogic() override;
68
69 //! \brief Initializes the menu logic component
70 //! \param player Pointer to the player station
71 //! \param config Configuration settings for initialization
72 //! \return True if initialization was successful, false otherwise
73 virtual bool initialize(DtPlayerStation* player, DtInitTable& config) override;
74
75 //! \brief Performs post-initialization setup
76 //! \return True if post-initialization was successful, false otherwise
77 virtual bool postInitialize() override;
78
79 //! \brief Updates menu logic for the current frame
80 //! \param dt Delta time since the last frame in seconds
81 virtual void tick(double dt) override;
82
83 //! \brief Cleans up resources when the component is being shut down
84 virtual void shutdown() override;
85
86 //! \brief Returns the component type identifier
87 //! \return String identifier for this component type
88 //!
89 //! Returns the type identifier string for this component, which is used
90 //! by the VR-Engage framework for component identification and management.
91 //! The returned value matches DtHumanMenuLogicType.
92 virtual const char* type() const override;
93
94 //! \brief Handles menu-related messages
95 //! \param msg Pointer to the message being processed
96 //! \return Message processing result
98
99protected:
100 //! \brief Handles entity realized messages
101 //! \param msg Pointer to the message being processed
102 //! \return Message processing result
104
105 //! \brief Handles entity removed messages
106 //! \param msg Pointer to the message being processed
107 //! \return Message processing result
109
110 //! \brief Initializes the list of available sensor views
111 virtual void initSensorViewsList();
112
113 //! \brief Checks if an entity is a sensor-capable aircraft
114 //! \param type Type of the entity to check
115 //! \return True if the entity is a sensor-capable aircraft, false otherwise
116 virtual bool isSensorCapableAircraft(const DtEntityType& type) const;
117
118 //! \brief Tasks an entity to move to the current view location
120
121 //! \brief Tasks an entity to move to the player's location
122 virtual void taskMoveToMyLocation();
123
124 //! \brief Tasks an entity to move to a specific waypoint
125 virtual void taskMoveToWaypoint();
126
127 //! \brief Tasks an entity to fire at a target
128 virtual void taskFireTarget();
129
130 //! \brief Tasks an entity to suppress fire
131 virtual void taskSupressFire();
132
133 //! \brief Tasks an entity to follow the player
134 virtual void taskFollowMe();
135
136 //! \brief Disembarks the player from the current vehicle
137 virtual void disembarkEntity();
138
139 //! \brief Tasks an entity to execute a DI-Guy animated gesture
140 //! \param gestureName Name of the gesture to execute
141 //!
142 //! Names of available gestures can be found in data\Lifeforms\diguy\gestures.cgf.
143 virtual void taskDiGuyGesture(const std::string& gestureName);
144
145 //! \brief Tasks an entity to execute a DI-Guy animated action
146 //! \param actionName Name of the action to execute
147 //!
148 //! Names of available actions can be found in the action table for
149 //! a given DI-Guy character, in data\Lifeforms\diguy.
150 virtual void taskDiGuyAction(const std::string& actionName);
151
152protected:
153 //! \brief Entity ID of the current taskee
154 std::string myTaskee;
155
156 //! \brief Entity ID of the current target
157 std::string myShootee;
158
159 //! \brief Current waypoint identifier
160 std::string myWaypoint;
161
162 //! \brief Pointer to the action menu logic component
164
165 //! \brief Pointer to the human control logic component
167
168 //! \brief Current task location in the world
170};
171
172} // namespace makVre
Component for managing entity interaction menus and their logic.
Definition actionMenuLogic.h:95
Control logic component for the human entity.
Definition humanControlLogic.h:138
virtual void disembarkEntity()
Disembarks the player from the current vehicle.
virtual void taskMoveToWaypoint()
Tasks an entity to move to a specific waypoint.
std::string myWaypoint
Current waypoint identifier.
Definition humanMenuLogic.h:160
DtHumanMenuLogic()
Default constructor.
DtActionMenuLogic * myMenuLogic
Pointer to the action menu logic component.
Definition humanMenuLogic.h:163
virtual bool postInitialize() override
Performs post-initialization setup.
virtual void taskDiGuyAction(const std::string &actionName)
Tasks an entity to execute a DI-Guy animated action.
virtual void taskFireTarget()
Tasks an entity to fire at a target.
virtual bool isSensorCapableAircraft(const DtEntityType &type) const
Checks if an entity is a sensor-capable aircraft.
virtual void taskSupressFire()
Tasks an entity to suppress fire.
std::string myTaskee
Entity ID of the current taskee.
Definition humanMenuLogic.h:154
virtual void taskDiGuyGesture(const std::string &gestureName)
Tasks an entity to execute a DI-Guy animated gesture.
virtual makVre::DtVreMessageResult handleEntityRealized(makVre::DtVreMessage *msg)
Handles entity realized messages.
virtual void tick(double dt) override
Updates menu logic for the current frame.
DtVector myTaskLocation
Current task location in the world.
Definition humanMenuLogic.h:169
virtual void taskFollowMe()
Tasks an entity to follow the player.
std::string myShootee
Entity ID of the current target.
Definition humanMenuLogic.h:157
virtual makVre::DtVreMessageResult handleMenuMessage(makVre::DtVreMessage *msg)
Handles menu-related messages.
virtual const char * type() const override
Returns the component type identifier.
virtual makVre::DtVreMessageResult handleEntityRemoved(makVre::DtVreMessage *msg)
Handles entity removed messages.
virtual void shutdown() override
Cleans up resources when the component is being shut down.
virtual void taskMoveToViewLocation()
Tasks an entity to move to the current view location.
virtual ~DtHumanMenuLogic() override
Virtual destructor.
virtual void taskMoveToMyLocation()
Tasks an entity to move to the player's location.
DtHumanControlLogic * mySimLogic
Pointer to the human control logic component.
Definition humanMenuLogic.h:166
virtual void initSensorViewsList()
Initializes the list of available sensor views.
virtual bool initialize(DtPlayerStation *player, DtInitTable &config) override
Initializes the menu logic component.
Table-based access to Lua state for configuration data.
Definition initializer.h:38
virtual DtPlayerStation & player()
Gets the player station.
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
constexpr const char * taskeeName
Definition humanMenuLogic.h:39
constexpr const char * shooteeName
Definition humanMenuLogic.h:36
constexpr const char * waypointName
Definition humanMenuLogic.h:42
Defines export macros for the Human Frontend library.
#define HUMAN_DLL
Definition export.h:19
Definition humanMenuLogic.h:28
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
constexpr const char * DtHumanMenuLogicType
Type identifier constant for DtHumanMenuLogic components.
Definition humanMenuLogic.h:52
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Defines the DtPlayerComponent base class for VR-Engage role components.
Defines the base class for all VREngage messages.