VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtVreHumanFollowController Class Reference

Detailed Description

DtVreHumanFollowController models the behavior of human entities when following other entities. During each simulation frame, the destination to which the entity moves is dynamically recalculated to be in the proper position with respect to the followed entity. This allows humans to maintain formation, follow leaders, or maintain specific offset positions relative to other entities.

Uses Descriptor Type: DtHumanFollowControllerDescriptor

#include <vreHumanFollowController.h>

Inheritance diagram for makVre::DtVreHumanFollowController:
[legend]

Public Member Functions

 DtVreHumanFollowController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreHumanFollowController () override
 
virtual const char * type () const override
 
virtual void tick () override
 
virtual bool createPorts () override
 
- Public Member Functions inherited from makVre::DtVreSimComponent< DtHumanFollowController >
 DtVreSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreSimComponent ()
 
bool isPlayerControlled (const std::string &role="") const
 
DtString entitySystemName () const
 

Static Public Member Functions

static DtSimComponent * creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 

Protected Attributes

DtStringOutputPort * myFollowTargetOutputPort
 
int myDisembarkSubtaskId
 

Private Member Functions

 DtVreHumanFollowController (const DtVreHumanFollowController &orig)
 
const DtVreHumanFollowControlleroperator= (const DtVreHumanFollowController &orig)
 

Constructor & Destructor Documentation

◆ DtVreHumanFollowController() [1/2]

makVre::DtVreHumanFollowController::DtVreHumanFollowController ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )

Constructor.

Parameters
nameThe name of this component
ownerThe local object that owns this component
simManagerThe simulation services manager
descComponent descriptor with configuration parameters
parentRegistryOptional parent registry for reader/writer functionality

Creates a new human follow controller component with the specified parameters.

Referenced by DtVreHumanFollowController(), and operator=().

◆ ~DtVreHumanFollowController()

virtual makVre::DtVreHumanFollowController::~DtVreHumanFollowController ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the human follow controller component.

◆ DtVreHumanFollowController() [2/2]

makVre::DtVreHumanFollowController::DtVreHumanFollowController ( const DtVreHumanFollowController & orig)
private

Copy constructor (not implemented)

Copy constructor is private and not implemented to prevent copy construction.

References DtVreHumanFollowController().

Member Function Documentation

◆ type()

virtual const char * makVre::DtVreHumanFollowController::type ( ) const
overridevirtual

Gets the type identifier for this component.

Returns
String identifying the component type (DtVreHumanFollowControllerType)

Implements the DtSimComponent::type() method to return the type identifier for this component.

◆ tick()

virtual void makVre::DtVreHumanFollowController::tick ( )
overridevirtual

Updates the controller state each simulation frame.

Updates the output port with the current follow target from the PSR (Process State Repository). During each simulation frame, this method recalculates the destination position relative to the followed entity and updates the entity's movement accordingly.

◆ createPorts()

virtual bool makVre::DtVreHumanFollowController::createPorts ( )
overridevirtual

Creates the input and output ports for the controller.

Returns
True if ports are successfully created, false otherwise

Creates additional port for the follow target point. This port is used to output the current target entity being followed, allowing other components to access this information.

◆ creator()

static DtSimComponent * makVre::DtVreHumanFollowController::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
nameThe name for the new component
ownerThe local object that will own this component
simManagerThe simulation services manager
descOptional component descriptor
parentRegistryOptional 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.

◆ operator=()

const DtVreHumanFollowController & makVre::DtVreHumanFollowController::operator= ( const DtVreHumanFollowController & orig)
private

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtVreHumanFollowController().

Member Data Documentation

◆ myFollowTargetOutputPort

DtStringOutputPort* makVre::DtVreHumanFollowController::myFollowTargetOutputPort
protected

Output port for the current follow target entity name.

This port outputs the name of the entity currently being followed. Other components can connect to this port to receive updates when the follow target changes.

◆ myDisembarkSubtaskId

int makVre::DtVreHumanFollowController::myDisembarkSubtaskId
protected

ID for the disembark subtask.

Stores the subtask ID used for disembarkation operations when a followed entity is being disembarked from another entity.


The documentation for this class was generated from the following file: