VR-Engage  2.2
Loading...
Searching...
No Matches
vreHumanMovementActuator.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreHumanMovementActuator.h
7//! \ingroup vreVrfmodel
8//! \brief Actuator for human entity movement
9//!
10//! This file defines the DtVreHumanMovementActuator class which handles movement
11//! for human entities. It manages speed, orientation, terrain interactions, fatigue,
12//! and collision detection for natural human movement in the simulation.
13
14#pragma once
15
16#include "vreVrfmodel/export.h"
18
19#include <vrfmodel/humanMovementActuator.h>
20#include <vrfobjcore/compositePredicate.h>
21
22class DtAnalogOutputPort;
23
24namespace makVre
25{
27
28//! \brief Type identifier for the VRE human movement actuator component
29const char DtVreHumanMovementActuatorType[] = "vre-human-movement-actuator";
30
31//! \brief Actuator for human entity movement
32//!
33//! DtVreHumanMovementActuator handles movement for human entities in the simulation.
34//! It moves the entity at the requested speed (clamped by the maximum speed limit)
35//! and direction, with appropriate terrain interaction and collision detection.
36//! The actuator also models fatigue effects, health impacts on mobility, and terrain
37//! suitability for different postures.
38//!
39//! The implementation includes realistic limitations based on terrain slope, soil type,
40//! entity health status, and obstacles. It also handles special cases like ladder climbing
41//! and entity embarkation.
42//!
43//! Uses Descriptor Type: DtVreHumanMovementActuatorDescriptor
44class VREVRFMODEL_DLL DtVreHumanMovementActuator : public DtVreSimComponent<DtHumanMovementActuator>
45{
46private:
47 //! \brief Assignment operator (not implemented)
48 //! \return Reference to this object
49 //!
50 //! Assignment operator is private and not implemented to prevent assignment.
52 //! \brief Copy constructor (not implemented)
53 //!
54 //! Copy constructor is private and not implemented to prevent
55 //! copy construction.
57
58public:
59 //! \brief Constructor
60 //! \param name The name of this component
61 //! \param owner The local object that owns this component
62 //! \param simManager The simulation services manager
63 //! \param desc Component descriptor with configuration parameters
64 //! \param parentRegistry Optional parent registry for reader/writer functionality
65 //!
66 //! Creates a new human movement actuator component with the specified parameters.
67 DtVreHumanMovementActuator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
68 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
69
70 //! \brief Virtual destructor
71 //!
72 //! Cleans up resources used by the human movement actuator component.
73 virtual ~DtVreHumanMovementActuator() override;
74
75 //! \brief Gets the type identifier for this component
76 //! \return String identifying the component type (DtVreHumanMovementActuatorType)
77 //!
78 //! Implements the DtSimComponent::type() method to return the
79 //! type identifier for this component.
80 virtual const char* type() const override;
81
82 //! \brief Initializes the human movement actuator
83 //! \return True if initialization is successful, false otherwise
84 //!
85 //! Looks up and caches health-related state properties including "MobilityHealth",
86 //! "FirepowerHealth", "OverallHealth", and "Fatigue". These properties are used
87 //! to modulate movement capabilities based on entity status.
88 virtual bool init() override;
89
90 //! \brief Updates the actuator state each simulation frame
91 //!
92 //! Processes movement for the human entity during each simulation frame.
93 //! This includes calculating appropriate speed based on health status,
94 //! terrain conditions, and fatigue. Overridden to set the maximum speed
95 //! to 9.0 m/s for better user experience in first-person mode.
96 virtual void tick() override;
97
98 //! \brief Factory method to create a new instance of this component
99 //! \param name The name for the new component
100 //! \param owner The local object that will own this component
101 //! \param simManager The simulation services manager
102 //! \param desc Optional component descriptor
103 //! \param parentRegistry Optional parent registry for reader/writer functionality
104 //! \return Pointer to the newly created component
105 //!
106 //! Static factory method used by the component creation system to instantiate
107 //! new instances of this component type.
108 static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
109 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
110
111 //! \brief Callback for entity restoration events
112 //! \param msg The message containing restoration information
113 //! \param usrData User data pointer, typically pointing to the instance of this class
114 //!
115 //! Static callback function invoked when an entity is restored (e.g., after being damaged).
116 //! This function calls the instance's setRestored() method to reinitialize health properties.
117 static void setRestoredCallback(DtSimMessage* msg, void* usrData);
118
119 //! \brief Enumeration of different fatigue modification rates
120 //!
121 //! Defines different rates at which fatigue can be modified based on
122 //! activity level and recovery. These rates are configured in the human.sysdef file.
123 //! The decrease amounts are for recovery when resting or moving slowly.
124 //! The increase amounts are for when the human is exerting and becoming tired.
126 {
127 FatigueEffect_None, //!< No change in fatigue
128 FatigueEffect_DecreaseLow, //!< Slow fatigue recovery
129 FatigueEffect_DecreaseMedium, //!< Medium fatigue recovery
130 FatigueEffect_DecreaseHigh, //!< Fast fatigue recovery
131 FatigueEffect_IncreaseLow, //!< Slow fatigue increase
132 FatigueEffect_IncreaseMedium, //!< Medium fatigue increase
133 FatigueEffect_IncreaseHigh, //!< Fast fatigue increase
134 };
135
136 //! \brief Checks if this entity can block other entities' movement
137 //! \param object Pointer to the object to check against
138 //! \return True if this entity can block the movement of the given object
139 //!
140 //! Determines whether this entity should be considered a physical obstacle
141 //! that can block the movement of other entities in the simulation.
142 virtual bool canBlockMovement(const DtSimObject* object) const;
143
144protected:
145 //! \brief Restricts posture based on terrain conditions
146 //! \param desiredPosture The posture the entity wants to adopt
147 //! \return The static posture closest to the desired posture that is allowed on the current terrain
148 //!
149 //! Determines if the desired posture is appropriate for the current terrain.
150 //! For example, standing upright on a steep hill is not allowed, so the
151 //! return would be prone. This ensures realistic posture constraints based
152 //! on environmental conditions.
153 virtual DtLifeformStaticPosture restrictPostureForTerrain(DtLifeformStaticPosture desiredPosture) override;
154
155 //! \brief Checks if entity can embark onto another entity at the given position
156 //! \param localPosition The local position to check for embarkation opportunities
157 //! \return True if there is an entity at the specified position that can be embarked upon
158 //!
159 //! Checks if there are any entities at the given location that can be moved onto
160 //! for embarkation. If such entities exist, checks if the current entity intersects
161 //! with them, which would allow embarkation.
162 virtual bool checkIfMoveOntoEmbarked(const DtVector& localPosition) override;
163 //! \brief Performs embarkation check against specific objects
164 //! \param localPosition The local position to check for embarkation opportunities
165 //! \param hit Output parameter that will contain the hit object if one is found
166 //! \param additionalIgnore List of object UUIDs to ignore during the check
167 //! \return True if there is an object at the specified position that can be embarked upon
168 //!
169 //! Implementation method that performs the detailed embarkation check against
170 //! specific objects. It allows for additional objects to be ignored in the check
171 //! and returns the hit object through an output parameter.
173 const DtVector& localPosition, const DtSimObject*& hit, const std::list<DtUUID>& additionalIgnore);
174
175 //! \brief Sets the radio receiver for simulation messages
176 //! \param radio Pointer to the simulation radio for message communication
177 //!
178 //! Overrides the base class implementation to register interest in the
179 //! set restored message. This allows the component to receive notifications
180 //! when the entity is restored after being damaged.
181 virtual void setRadio(DtSimRadio* radio) override;
182
183 //! \brief Handles entity restoration after damage
184 //!
185 //! Overridden to look up myMobilityHealth and other health-related state properties again.
186 //! State properties are reset when an entity is damaged and then restored, so this
187 //! method re-caches the necessary properties to ensure correct health-based movement
188 //! modulation after restoration.
189 virtual void setRestored();
190
191 //! \brief Modulates the desired speed based on environmental factors
192 //! \param[out] newDesiredSpeed Output parameter that will contain the modulated desired speed
193 //! \param[out] newMaxSpeed Output parameter that will contain the modulated maximum speed
194 //! \param[in] desiredSpeed The current desired speed of the human
195 //!
196 //! Calculates the current maximum speed based on terrain pitch, soil type, and
197 //! capabilities of the entity. Modifies both the desired speed and maximum speed
198 //! to account for these environmental factors.
199 //!
200 //! \note Any modifications to the desiredSpeed parameter in this function must also be
201 //! applied to newMaxSpeed. This is needed so that the percentage of maximum
202 //! speed can be computed correctly.
203 virtual void modulateDesiredSpeed(double& newDesiredSpeed, double& newMaxSpeed, double desiredSpeed);
204
205 //! \brief Determines if terrain collision checks should be performed
206 //! \return True if terrain collision checks should be performed, false otherwise
207 //!
208 //! Always returns true if the entity is player-controlled, ensuring that
209 //! player-controlled entities always check for terrain collisions. For non-player
210 //! entities, delegates to the base class implementation.
211 virtual bool checkForTerrainCollisions() const override;
212
213 //! \brief Checks if movement is blocked by terrain features
214 //! \param oldLocalPosition The current position of the entity
215 //! \param newLocalProjectedLocation The desired new position (modified if blocked)
216 //! \param heightFraction Optional fraction of entity height to use for collision check
217 //! \return True if movement is blocked by terrain, false otherwise
218 //!
219 //! Checks for terrain polygons between the specified old and new positions.
220 //! If blocking terrain is found, the newLocalProjectedLocation parameter is
221 //! modified to position the entity just before the collision would occur.
223 const DtVector& oldLocalPosition, DtVector& newLocalProjectedLocation, double heightFraction = -1.0) override;
224
225 //! \brief Checks if movement is blocked by other entities
226 //! \param oldLocalPosition The current position of the entity
227 //! \param newLocalProjectedLocation The desired new position (modified if blocked)
228 //! \return True if movement is blocked by another entity, false otherwise
229 //!
230 //! Checks for other entities between the specified old and new positions.
231 //! If blocking entities are found, the newLocalProjectedLocation parameter is
232 //! modified to position the entity just before the collision would occur.
233 virtual bool checkBlockedByEntities(const DtVector& oldLocalPosition, DtVector& newLocalProjectedLocation) override;
234
235 //! \brief Determines if entity collision checks should be performed
236 //! \return True if entity collision checks should be performed, false otherwise
237 //!
238 //! Overridden to return false when non-player-controlled and embarked on air objects.
239 //! This special case allows entities to disembark past other lifeforms on aircraft
240 //! like the Chinook helicopter, preventing entities from getting stuck during disembarkation.
241 virtual bool checkForEntityCollisions() const override;
242
243 //! \brief Determines if a specific object can be ignored for collision detection
244 //! \param hitObject The object to check for collision ignorability
245 //! \return True if the object can be safely ignored, false otherwise
246 //!
247 //! Returns true if the given object can be safely ignored for collisions. This includes
248 //! the entity that the current entity is embarked on, and tactical ladders (which need
249 //! to be approachable for climbing, handled by a different movement actuator).
250 //! Returns false for all other objects. This method is called by checkForEntityCollision().
251 virtual bool canIgnoreCollisionWith(const DtSimObject& hitObject) const;
252
253 //! \brief Calculates new orientation and position for the entity
254 //! \param newLocalProjectedLocation The target projected location for the entity
255 //! \param newHeading The new heading direction
256 //! \param newFacingOrientation The new facing orientation
257 //! \param newLocalOrientation Output parameter for the calculated orientation
258 //! \param newLocalDirectionOfMovement Output parameter for the calculated movement direction
259 //! \param newLocalPosition Output parameter for the calculated position
260 //!
261 //! Calculates the new orientation and position for the entity based on the
262 //! projected location and heading information. This method handles the proper
263 //! calculation of orientation matrices and position vectors for entity movement.
264 virtual void calculateOrientationAndPosition(const DtVector& newLocalProjectedLocation, double newHeading,
265 double newFacingOrientation, DtDcm& newLocalOrientation, DtDcm& newLocalDirectionOfMovement,
266 DtVector& newLocalPosition) override;
267
268 //! \brief Calculates a movement chord considering entity bounding volume
269 //! \param oldLocalPosition The current position of the entity
270 //! \param newLocalProjectedLocation The desired new position
271 //! \param intersectionVec Output parameter for the vector between positions in local coordinates
272 //! \param bvCenterStartFromOldPos Output parameter for the vector from old position to chord start
273 //! \return The calculated movement chord
274 //!
275 //! Calculates a movement vector based on the two input positions, using the bounding volume
276 //! of the entity. The resulting vector is not directly between the positions, but rather
277 //! offset to the front face of the bounding volume. This method helps determine the
278 //! actual movement path considering the entity's physical dimensions.
279 virtual DtChord movementChord(const DtVector& oldLocalPosition,
280 const DtVector& newLocalProjectedLocation,
281 DtVector& intersectionVec,
282 DtVector& bvCenterStartFromOldPos) override;
283
284 //! \brief Calculates a movement chord at a specific height fraction
285 //! \param oldLocalPosition The current position of the entity
286 //! \param newLocalProjectedLocation The desired new position
287 //! \param heightFraction The fraction of entity height to use for chord calculation
288 //! \param intersectionVec Output parameter for the vector between positions in local coordinates
289 //! \param offsetFromOldPosition Output parameter for the vector from old position to chord start
290 //! \return The calculated movement chord
291 //!
292 //! Similar to movementChord, but rather than using the bounding volume center to define
293 //! the height of the chord, this method uses a specified fraction of the entity height.
294 //! This allows for more precise collision detection at different heights of the entity.
295 virtual DtChord movementChordAtHeight(const DtVector& oldLocalPosition,
296 const DtVector& newLocalProjectedLocation,
297 double heightFraction,
298 DtVector& intersectionVec,
299 DtVector& offsetFromOldPosition) override;
300
301 //! \brief Initializes the Above Ground Level (AGL) port
302 //! \return True if the AGL port was successfully initialized, false otherwise
303 //!
304 //! Overridden to use closestIntersection instead of terrainHeight when determining
305 //! the entity's height above ground. This is because terrainHeight doesn't take into
306 //! account geometry from feature replacement, which can lead to inaccurate height
307 //! calculations in areas with complex terrain features.
308 virtual bool initializeAglPort() override;
309
310 //! \brief Determines if and how fatigue should change based on movement
311 //! \param[out] fatigueEffect Output parameter that will contain the type of fatigue change
312 //! \param desiredSpeed The speed after health effects have modified the original desired speed
313 //! \param maxSpeed The maximum speed after health effects have modified the original max speed
314 //! \return True if fatigue should change, false otherwise
315 //!
316 //! Evaluates current movement conditions to determine if fatigue should change, and
317 //! if so, what type of change should occur. The desiredSpeed and maxSpeed parameters
318 //! reflect speeds after health effects have already been applied. These values must
319 //! remain relative to each other so a percentage can be calculated to determine
320 //! if the human is running or walking. If the return value is true, fatigue should
321 //! increase or decrease based on the value of the fatigueEffect parameter.
322 virtual bool shouldFatigueChange(FatigueEffect& fatigueEffect, double desiredSpeed, double maxSpeed) const;
323
324 //! \brief Computes the increase in fatigue based on movement speed
325 //! \param fatigueEffect The type of fatigue change to apply
326 //! \param currentTopSpeed The current computed speed for the entity
327 //! \param maxSpeed The fastest speed this entity can move
328 //! \return The new fatigue value
329 //!
330 //! Calculates the increase in fatigue based on the entity's movement speed relative
331 //! to its maximum speed. Fatigue is used to realistically modify the speed at which
332 //! an entity can move over time. The fatigue rate is calibrated based on movement at
333 //! maximum speed, with reduced fatigue effects for lower speeds. The function returns
334 //! the new fatigue value after applying the appropriate increase based on the specified
335 //! fatigueEffect and the entity's movement parameters.
336 virtual double computeFatigueIncrease(FatigueEffect fatigueEffect, double currentTopSpeed, double maxSpeed) const;
337
338 //! \brief Computes the decrease in fatigue during recovery
339 //! \param fatigueEffect The type of fatigue recovery to apply
340 //! \return The new fatigue value after recovery
341 //!
342 //! Calculates the decrease in fatigue when the entity is resting or moving slowly.
343 //! The rate of recovery depends on the specified fatigueEffect parameter, which
344 //! determines how quickly the entity recovers from fatigue. This function is typically
345 //! called when the entity is stationary or moving at low speeds.
346 virtual double computeFatigueDecrease(FatigueEffect fatigueEffect) const;
347
348 //! \brief Computes speed modifications based on all health effects
349 //! \param[out] newDesiredSpeed Output parameter for the new desired speed after health effects
350 //! \param[out] newMaxSpeed Output parameter for the new maximum speed after health effects
351 //! \param desiredSpeed The input desired speed after terrain factors
352 //! \param maxSpeed The input maximum speed before fatigue effects
353 //!
354 //! Computes modifications to both desired and maximum speed based on all factors
355 //! that affect entity performance: overall health, mobility health, and accumulated
356 //! fatigue. Both output speed values are modified proportionally to maintain their
357 //! relationship, ensuring that percentage calculations (like determining if the entity
358 //! is running or walking) remain valid. The input desiredSpeed parameter already
359 //! accounts for terrain type and slope effects.
361 double& newDesiredSpeed, double& newMaxSpeed, double desiredSpeed, double maxSpeed) const;
362
363 //! \brief Determines if movement should be allowed based on injury state
364 //! \return True if movement should be allowed, false otherwise
365 //!
366 //! Evaluates whether the entity should be allowed to move based on its injury state.
367 //! When a human entity is severely injured and on the ground, it should not be able
368 //! to crawl or rotate. This method enforces realistic movement limitations for
369 //! injured entities.
370 virtual bool shouldAllowMovement();
371
372 //! \brief Updates the entity's fatigue level
373 //! \param fatigueEffect How fatigue should increase/decrease and by how much
374 //! \param newDesiredSpeed The speed after damage model and fatigue effects
375 //! \param newMaxSpeed The maximum speed after damage model and fatigue effects
376 //!
377 //! Updates the entity's fatigue level based on the specified fatigueEffect and
378 //! current movement parameters. The newDesiredSpeed and newMaxSpeed parameters
379 //! reflect speeds after both damage model and existing fatigue effects have been
380 //! applied. These parameters are used to determine the percentage of maximum speed
381 //! the entity is moving at, which affects how quickly fatigue changes.
382 virtual void updateFatigue(FatigueEffect fatigueEffect, double newDesiredSpeed, double newMaxSpeed) const;
383
384protected:
385 //! \brief Callback for terrain change notifications
386 //! \param terrainChangeInfo Information about the terrain change
387 //! \param usr User data pointer, typically pointing to the instance of this class
388 //!
389 //! Static callback function invoked when terrain changes occur in the simulation.
390 //! This allows the movement actuator to respond to changes in the terrain that
391 //! might affect movement capabilities, such as new obstacles or changes in
392 //! terrain slope or soil type.
393 static void vreTerrainChangeNotification(const DtTerrainChangeNotificationInfo& terrainChangeInfo, void* usr);
394
395 //! \brief Processes terrain change notifications
396 //! \param terrainChangeInfo Information about the terrain change
397 //!
398 //! Instance method that processes terrain change notifications received through
399 //! the static callback. This method analyzes the terrain changes and updates
400 //! the movement capabilities accordingly, such as adjusting available postures
401 //! or movement speeds based on new terrain conditions.
402 void processVreTerrainChangeNotification(const DtTerrainChangeNotificationInfo& terrainChangeInfo);
403
404protected:
405 //! \brief Pointer to the human movement actuator descriptor
406 //!
407 //! Contains the configuration parameters for this human movement actuator.
409
410 //! \brief Desired velocity vector for the entity
411 //!
412 //! Stores the current desired velocity vector for the entity, which is
413 //! used to determine movement direction and speed.
415
416 //! \brief Entity's mobility health value
417 //!
418 //! References the entity's mobility health state property, which affects
419 //! movement speed and capabilities.
421
422 //! \brief Entity's fatigue value
423 //!
424 //! References the entity's fatigue state property, which represents
425 //! accumulated exertion and affects movement speed.
426 DtRwReal* myFatigue;
427
428 //! \brief Entity's percentage of maximum speed
429 //!
430 //! References the state property that tracks what percentage of maximum
431 //! speed the entity is currently moving at.
433
434 //! \brief Entity's firepower health value
435 //!
436 //! References the entity's firepower health state property, which affects
437 //! weapon capabilities but may also influence overall movement.
439
440 //! \brief Entity's overall health value
441 //!
442 //! References the entity's overall health state property, which provides
443 //! a general indication of the entity's condition.
445
446 //! \brief Predicate for movement blocking object types
447 //!
448 //! Composite predicate that defines which types of objects should
449 //! be checked for movement blocking during collision detection.
451};
452
453} // namespace makVre
Human movement actuator descriptor with fatigue modeling for VREngage.
Definition vreHumanMovementActuatorDescriptor.h:33
DtRwInt * myMobilityHealth
Entity's mobility health value.
Definition vreHumanMovementActuator.h:420
virtual bool shouldFatigueChange(FatigueEffect &fatigueEffect, double desiredSpeed, double maxSpeed) const
Determines if and how fatigue should change based on movement.
virtual void tick() override
Updates the actuator state each simulation frame.
virtual bool canBlockMovement(const DtSimObject *object) const
Checks if this entity can block other entities' movement.
virtual void modulateDesiredSpeed(double &newDesiredSpeed, double &newMaxSpeed, double desiredSpeed)
Modulates the desired speed based on environmental factors.
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Factory method to create a new instance of this component.
static void setRestoredCallback(DtSimMessage *msg, void *usrData)
Callback for entity restoration events.
virtual double computeFatigueDecrease(FatigueEffect fatigueEffect) const
Computes the decrease in fatigue during recovery.
virtual bool checkForEntityCollisions() const override
Determines if entity collision checks should be performed.
virtual bool canIgnoreCollisionWith(const DtSimObject &hitObject) const
Determines if a specific object can be ignored for collision detection.
DtRwInt * myOverallHealth
Entity's overall health value.
Definition vreHumanMovementActuator.h:444
virtual DtChord movementChordAtHeight(const DtVector &oldLocalPosition, const DtVector &newLocalProjectedLocation, double heightFraction, DtVector &intersectionVec, DtVector &offsetFromOldPosition) override
Calculates a movement chord at a specific height fraction.
DtVreHumanMovementActuatorDescriptor * myVreHumanMovementDescriptor
Pointer to the human movement actuator descriptor.
Definition vreHumanMovementActuator.h:408
virtual ~DtVreHumanMovementActuator() override
Virtual destructor.
bool vrfObjectCheckIfMoveOntoEmbarked(const DtVector &localPosition, const DtSimObject *&hit, const std::list< DtUUID > &additionalIgnore)
Performs embarkation check against specific objects.
void processVreTerrainChangeNotification(const DtTerrainChangeNotificationInfo &terrainChangeInfo)
Processes terrain change notifications.
DtVreHumanMovementActuator & operator=(const DtVreHumanMovementActuator &orig)
Assignment operator (not implemented)
virtual void setRestored()
Handles entity restoration after damage.
virtual DtLifeformStaticPosture restrictPostureForTerrain(DtLifeformStaticPosture desiredPosture) override
Restricts posture based on terrain conditions.
virtual double computeFatigueIncrease(FatigueEffect fatigueEffect, double currentTopSpeed, double maxSpeed) const
Computes the increase in fatigue based on movement speed.
virtual bool checkForTerrainCollisions() const override
Determines if terrain collision checks should be performed.
virtual void computeAllHealthEffectsOnSpeed(double &newDesiredSpeed, double &newMaxSpeed, double desiredSpeed, double maxSpeed) const
Computes speed modifications based on all health effects.
virtual DtChord movementChord(const DtVector &oldLocalPosition, const DtVector &newLocalProjectedLocation, DtVector &intersectionVec, DtVector &bvCenterStartFromOldPos) override
Calculates a movement chord considering entity bounding volume.
DtVreHumanMovementActuator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Constructor.
DtVreHumanMovementActuator(const DtVreHumanMovementActuator &orig)
Copy constructor (not implemented)
static void vreTerrainChangeNotification(const DtTerrainChangeNotificationInfo &terrainChangeInfo, void *usr)
Callback for terrain change notifications.
DtRwReal * myPercentOfMaxSpeed
Entity's percentage of maximum speed.
Definition vreHumanMovementActuator.h:432
virtual bool init() override
Initializes the human movement actuator.
FatigueEffect
Enumeration of different fatigue modification rates.
Definition vreHumanMovementActuator.h:126
@ FatigueEffect_DecreaseHigh
Fast fatigue recovery.
Definition vreHumanMovementActuator.h:130
@ FatigueEffect_IncreaseHigh
Fast fatigue increase.
Definition vreHumanMovementActuator.h:133
@ FatigueEffect_None
No change in fatigue.
Definition vreHumanMovementActuator.h:127
@ FatigueEffect_IncreaseMedium
Medium fatigue increase.
Definition vreHumanMovementActuator.h:132
@ FatigueEffect_DecreaseLow
Slow fatigue recovery.
Definition vreHumanMovementActuator.h:128
@ FatigueEffect_IncreaseLow
Slow fatigue increase.
Definition vreHumanMovementActuator.h:131
@ FatigueEffect_DecreaseMedium
Medium fatigue recovery.
Definition vreHumanMovementActuator.h:129
DtRwInt * myFirepowerHealth
Entity's firepower health value.
Definition vreHumanMovementActuator.h:438
virtual void calculateOrientationAndPosition(const DtVector &newLocalProjectedLocation, double newHeading, double newFacingOrientation, DtDcm &newLocalOrientation, DtDcm &newLocalDirectionOfMovement, DtVector &newLocalPosition) override
Calculates new orientation and position for the entity.
virtual bool initializeAglPort() override
Initializes the Above Ground Level (AGL) port.
virtual bool checkIfMoveOntoEmbarked(const DtVector &localPosition) override
Checks if entity can embark onto another entity at the given position.
DtRwReal * myFatigue
Entity's fatigue value.
Definition vreHumanMovementActuator.h:426
DtVector myDesiredVelocity
Desired velocity vector for the entity.
Definition vreHumanMovementActuator.h:414
virtual void updateFatigue(FatigueEffect fatigueEffect, double newDesiredSpeed, double newMaxSpeed) const
Updates the entity's fatigue level.
virtual const char * type() const override
Gets the type identifier for this component.
virtual bool checkBlockedByTerrain(const DtVector &oldLocalPosition, DtVector &newLocalProjectedLocation, double heightFraction=-1.0) override
Checks if movement is blocked by terrain features.
virtual bool shouldAllowMovement()
Determines if movement should be allowed based on injury state.
virtual void setRadio(DtSimRadio *radio) override
Sets the radio receiver for simulation messages.
DtCompositePredicate myObjectsToCheckForMovementBlock
Predicate for movement blocking object types.
Definition vreHumanMovementActuator.h:450
virtual bool checkBlockedByEntities(const DtVector &oldLocalPosition, DtVector &newLocalProjectedLocation) override
Checks if movement is blocked by other entities.
DtVreSimComponent(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Definition vreSimComponent.h:54
Defines export macros for the vreVrfmodel library.
#define VREVRFMODEL_DLL
Definition export.h:22
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
const char DtVreHumanMovementActuatorType[]
Type identifier for the VRE human movement actuator component.
Definition vreHumanMovementActuator.h:29
Base template class for VR-Engage simulation components.