VR-Engage  2.2
Loading...
Searching...
No Matches
vreSuppressionActuator.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreSuppressionActuator.h
7//! \ingroup vreVrfmodel
8//! \brief Actuator for modeling entity suppression due to nearby detonations
9//!
10//! This file defines the DtVreSuppressionActuator class which is responsible
11//! for calculating and setting the suppression level for an entity based on
12//! nearby detonations. It provides a simple suppression model that registers
13//! callbacks with the detonation manager to be notified of relevant events.
14
15#pragma once
16
17#include "vreVrfmodel/export.h"
19
20#include <vrfmodel/suppressionActuator.h>
21
22namespace makVre
23{
24//! \brief Type identifier for the VRE suppression actuator component
25const char DtVreSuppressionActuatorType[] = "vre-suppression-actuator";
26
27//! \brief Actuator for modeling entity suppression due to nearby detonations
28//!
29//! DtVreSuppressionActuator extends the base suppression actuator to provide
30//! VR-Engage specific functionality for calculating and applying suppression
31//! effects to entities based on nearby detonations. The component registers callbacks
32//! with the DtDetonationManager to be notified of relevant detonations, and then
33//! calculates appropriate suppression levels based on distance and munition type.
34//!
35//! Suppression effects can impact entity behavior and performance, simulating
36//! the psychological and physiological effects of nearby weapon impacts.
37//!
38//! Uses Descriptor Type: DtSuppressionComponentDescriptor
39class VREVRFMODEL_DLL DtVreSuppressionActuator : public DtVreSimComponent<DtSuppressionActuator>
40{
41public:
42 //! \brief Constructor
43 //! \param name The name of this component
44 //! \param owner The local object that owns this component
45 //! \param simManager The simulation services manager
46 //! \param desc Component descriptor with configuration parameters
47 //! \param parentRegistry Optional parent registry for reader/writer functionality
48 //!
49 //! Creates a new suppression actuator component with the specified parameters.
50 //! Initializes the suppression state and registers with the detonation manager.
51 DtVreSuppressionActuator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
52 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
53
54 //! \brief Gets the type identifier for this component
55 //! \return String identifying the component type (DtVreSuppressionActuatorType)
56 //!
57 //! Implements the DtSimComponent::type() method to return the
58 //! type identifier for this component.
59 virtual const char* type() const override;
60
61 //! \brief Processes a detonation to determine its suppression effect on the entity
62 //! \param detonationContext Context information about the detonation event
63 //! \return True if the detonation was successfully processed, false otherwise
64 //!
65 //! When a detonation context is received from the detonation manager,
66 //! it is processed to determine the appropriate suppression effect on the entity.
67 //! The calculation uses the distance to the detonation along with information
68 //! in the damage model to determine the insult from the detonation. If this is zero,
69 //! then it computes the distance to the munition trajectory to possibly
70 //! determine an additional insult.
71 //!
72 //! \note If this returns false, then the detonation could not be processed
73 //! for some reason, such as missing information or invalid parameters.
74 virtual bool processDetonationInsult(const DtDetonationContext& detonationContext) override;
75
76 //! \brief Updates the suppression state each simulation frame
77 //!
78 //! Determines how the suppression effects may be wearing off over time.
79 //! Suppression levels gradually decrease according to a configured decay rate,
80 //! simulating the entity's recovery from the psychological effects of nearby
81 //! detonations.
82 virtual void tick() override;
83
84 //! \brief Factory method to create a new instance of this component
85 //! \param name The name for the new component
86 //! \param owner The local object that will own this component
87 //! \param simManager The simulation services manager
88 //! \param desc Optional component descriptor
89 //! \param parentRegistry Optional parent registry for reader/writer functionality
90 //! \return Pointer to the newly created component
91 //!
92 //! Static factory method used by the component creation system to instantiate
93 //! new instances of this component type.
94 static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
95 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
96};
97
98} // namespace makVre
DtVreSimComponent(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Definition vreSimComponent.h:54
DtVreSuppressionActuator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Constructor.
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.
virtual void tick() override
Updates the suppression state each simulation frame.
virtual const char * type() const override
Gets the type identifier for this component.
virtual bool processDetonationInsult(const DtDetonationContext &detonationContext) override
Processes a detonation to determine its suppression effect on the entity.
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 DtVreSuppressionActuatorType[]
Type identifier for the VRE suppression actuator component.
Definition vreSuppressionActuator.h:25
Base template class for VR-Engage simulation components.