DtObjectProximitySensor extends the base proximity sensor to detect specific objects that come within a configurable detection range. It provides notifications when objects enter or exit the sensor's range, and maintains a list of currently detected objects. The component also supports integration with front-end visualization systems and provides Lua bindings for scripting access.
#include <objectProximitySensor.h>
|
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| |
◆ DtObjectProximitySensor() [1/3]
| makVre::DtObjectProximitySensor::DtObjectProximitySensor |
( |
| ) |
|
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
Referenced by DtObjectProximitySensor(), and operator=().
◆ DtObjectProximitySensor() [2/3]
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtObjectProximitySensor().
◆ DtObjectProximitySensor() [3/3]
| makVre::DtObjectProximitySensor::DtObjectProximitySensor |
( |
const DtString & | name, |
|
|
DtLocalObject * | owner, |
|
|
DtSimulationServices * | simManager, |
|
|
DtComponentDescriptor * | desc = 0, |
|
|
DtReaderWriterRegistry * | parentRegistry = 0 ) |
Constructor.
- Parameters
-
| name | The name of this component |
| owner | The local object that owns this component |
| simManager | The simulation services manager |
| desc | Optional component descriptor with configuration parameters |
| parentRegistry | Optional parent registry for reader/writer functionality |
Creates a new object proximity sensor component with the specified parameters.
◆ ~DtObjectProximitySensor()
| virtual makVre::DtObjectProximitySensor::~DtObjectProximitySensor |
( |
| ) |
|
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the object proximity sensor component, including the sensor monitor.
◆ operator=()
Assignment operator (not implemented)
- Returns
- Reference to this object
Assignment operator is private and not implemented to prevent assignment.
References DtObjectProximitySensor().
◆ type()
| virtual const char * makVre::DtObjectProximitySensor::type |
( |
| ) |
const |
|
overridevirtual |
Gets the type identifier for this component.
- Returns
- String identifying the component type (DtObjectProximitySensorType)
Implements the DtSimComponent::type() method to return the type identifier for this component.
◆ init()
| virtual bool makVre::DtObjectProximitySensor::init |
( |
| ) |
|
|
overridevirtual |
Initializes the component.
- Returns
- True if initialization is successful, false otherwise
Performs component initialization, setting up the sensor monitor and configuring detection parameters based on the component descriptor.
◆ tick()
| virtual void makVre::DtObjectProximitySensor::tick |
( |
| ) |
|
|
overridevirtual |
Updates the sensor state each simulation frame.
Processes sensor detection logic each frame, but only if the simulation is not paused. Detects objects that have entered or exited the sensor's range and updates the sensor monitor accordingly.
◆ disable()
| virtual void makVre::DtObjectProximitySensor::disable |
( |
| ) |
|
|
overridevirtual |
Disables the sensor component.
Overridden to clear out the target list and update the monitor when the sensor is disabled, ensuring the sensor contact list is properly cleared in the front-end visualization.
◆ setIsEnabled()
| virtual void makVre::DtObjectProximitySensor::setIsEnabled |
( |
bool | yesNo | ) |
|
|
overridevirtual |
Sets the enabled state of the sensor component.
- Parameters
-
| yesNo | True to enable the sensor, false to disable it |
Overridden to properly handle the sensor's enabled state, ensuring that the target list and monitor are updated appropriately when the state changes.
◆ creator()
| static DtSimComponent * makVre::DtObjectProximitySensor::creator |
( |
const DtString & | name, |
|
|
DtLocalObject * | owner, |
|
|
DtSimulationServices * | simManager, |
|
|
DtComponentDescriptor * | desc = 0, |
|
|
DtReaderWriterRegistry * | parentRegistry = 0 ) |
|
static |
Factory method to create a new instance of this component.
- Parameters
-
| name | The name for the new component |
| owner | The local object that will own this component |
| simManager | The simulation services manager |
| desc | Optional component descriptor |
| parentRegistry | Optional parent registry for reader/writer functionality |
- Returns
- Pointer to the newly created component
Static factory method used by the component creation system to instantiate new instances of this component type.
◆ createAndInitSensorMonitor()
| virtual bool makVre::DtObjectProximitySensor::createAndInitSensorMonitor |
( |
| ) |
|
|
protectedvirtual |
Creates and initializes the sensor monitor.
- Returns
- True if monitor creation and initialization succeeds, false otherwise
Creates a DtObjectProximitySensorMonitor instance and initializes it, establishing the connection between the sensor and the front-end visualization system.
◆ processObjects()
| virtual bool makVre::DtObjectProximitySensor::processObjects |
( |
| ) |
|
|
protectedvirtual |
Processes detected objects in the sensor's range.
- Returns
- True if the status of any detected objects changed, false otherwise
Performs detection checks for objects within the sensor's range, updating the list of detected objects and notifying the sensor monitor of any changes.
◆ processDynamicTerrainObjects()
| virtual bool makVre::DtObjectProximitySensor::processDynamicTerrainObjects |
( |
std::set< DtUUID > & | contactNames, |
|
|
std::string | searchFor, |
|
|
DtEntityType | sendAsType ) |
|
protectedvirtual |
Processes dynamic terrain objects for detection.
- Parameters
-
| contactNames | Set of UUIDs for contact objects being tracked |
| searchFor | String pattern to search for in dynamic terrain objects |
| sendAsType | Entity type to use when reporting detections |
- Returns
- True if any dynamic terrain objects were detected, false otherwise
Searches for dynamic terrain objects matching the specified pattern and adds them to the sensor's detection list when found within range.
◆ myMonitor
Pointer to the sensor monitor.
The monitor object that handles communication between the sensor and the front-end visualization system. Maintains the list of detected objects and their properties for display.
The documentation for this class was generated from the following file: