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

Detailed Description

DtVreLadderClimbingActuator handles the movement of human entities when they are climbing ladders. It manages the entity's position, velocity, and orientation during ladder climbing, ensuring smooth transitions between regular movement and ladder climbing states. The actuator receives movement direction input from control components and updates the entity's state accordingly.

#include <vreLadderClimbingActuator.h>

Inheritance diagram for makVre::DtVreLadderClimbingActuator:
[legend]

Public Member Functions

 DtVreLadderClimbingActuator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreLadderClimbingActuator () override
 
virtual const char * type () const override
 
virtual bool init () override
 
virtual void tick () override
 
virtual bool createPorts () override
 
virtual bool createPortGroups () override
 
- Public Member Functions inherited from makVre::DtVreSimComponent< DtActuatorComponent >
 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 Member Functions

virtual DtVreLadderClimbingPSRcreatePSR ()
 
const char * defaultPSRType () const
 
virtual double ladderClimbingSpeed ()
 
virtual void calculateAndUpdateNewState ()
 
virtual void clampToLadderExtent (const DtLadder &ladder, DtVector &bodyLadderBaseToEntity)
 

Protected Attributes

DtVreLadderClimbingPSRmyProcessState
 
Ports and Port Groups
DtAnalogInputPort * myLadderClimbingMovementDirectionInputPort
 
DtUpdateRepositoryOutputPortGroup * myUpdateRepositoryOutputPortGroup
 

Constructor & Destructor Documentation

◆ DtVreLadderClimbingActuator()

makVre::DtVreLadderClimbingActuator::DtVreLadderClimbingActuator ( 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 ladder climbing actuator component with the specified parameters.

◆ ~DtVreLadderClimbingActuator()

virtual makVre::DtVreLadderClimbingActuator::~DtVreLadderClimbingActuator ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the ladder climbing actuator component, including process state and port groups.

Member Function Documentation

◆ type()

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

Gets the type identifier for this component.

Returns
String identifying the component type (DtVreLadderClimbingActuatorType)

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

◆ init()

virtual bool makVre::DtVreLadderClimbingActuator::init ( )
overridevirtual

Initializes the ladder climbing actuator.

Returns
True if initialization is successful, false otherwise

Performs initial setup of the ladder climbing actuator, including creating the process state repository (PSR) for maintaining climb state. This method is called during component initialization.

◆ tick()

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

Updates the actuator state each simulation frame.

If the entity is in a ladder-climbing state (according to the PSR), computes the movement of the entity on the ladder for this tick and updates the state in myUpdateRepositoryOutputPortGroup. This includes calculating new position, velocity, and orientation values based on the input control direction and ladder geometry.

◆ createPorts()

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

Creates input and output ports for the actuator.

Returns
True if ports are successfully created, false otherwise

Creates the movement control input ports needed for ladder climbing, as well as the update repository output port group for updating the entity's state. These ports allow the actuator to receive movement direction and output position updates.

◆ createPortGroups()

virtual bool makVre::DtVreLadderClimbingActuator::createPortGroups ( )
overridevirtual

Creates input and output port groups for the actuator.

Returns
True if port groups are successfully created, false otherwise

Creates the movement control input port group and the update repository output port group. These port groups organize the input and output ports for proper routing between components.

◆ creator()

static DtSimComponent * makVre::DtVreLadderClimbingActuator::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.

◆ createPSR()

virtual DtVreLadderClimbingPSR * makVre::DtVreLadderClimbingActuator::createPSR ( )
protectedvirtual

Creates the process state repository for the actuator.

Returns
Pointer to the created process state repository

Creates the myProcessState data member and adds it to the process state repository manager. Uses the name and type specified in the component descriptor (if they exist) or appropriate defaults if not specified. This PSR stores the ladder climbing state including which ladder the entity is on and position information.

◆ defaultPSRType()

const char * makVre::DtVreLadderClimbingActuator::defaultPSRType ( ) const
protected

Gets the default process state repository type.

Returns
String identifying the default PSR type

Returns the default process state repository type for ladder climbing, which is used when no type is specified in the component descriptor.

◆ ladderClimbingSpeed()

virtual double makVre::DtVreLadderClimbingActuator::ladderClimbingSpeed ( )
protectedvirtual

Gets the ladder climbing speed for this entity.

Returns
Climbing speed in meters per second

Returns the ladder climbing speed for this entity in meters per second. The speed is based on the value from the descriptor if one exists (i.e., if a descriptor of type DtClimbingLadderActuatorDescriptor has been configured). If no descriptor is available or the speed is not specified, a default value of 0.4 m/s is returned.

◆ calculateAndUpdateNewState()

virtual void makVre::DtVreLadderClimbingActuator::calculateAndUpdateNewState ( )
protectedvirtual

Calculates and updates entity state during ladder climbing.

If the entity is on a ladder, calculates the new position, velocity, orientation, and other state values for the current simulation frame, then sets these values on the output ports. This method handles the actual movement calculations based on input direction and ladder geometry.

◆ clampToLadderExtent()

virtual void makVre::DtVreLadderClimbingActuator::clampToLadderExtent ( const DtLadder & ladder,
DtVector & bodyLadderBaseToEntity )
protectedvirtual

Constrains entity position to the ladder extent.

Parameters
ladderReference to the ladder object
bodyLadderBaseToEntityVector from ladder base to entity in body coordinates

Given a vector in body coordinates, clamps it to fall somewhere along the length of the ladder. This ensures that the entity's x component (in body coordinates) remains between the base and top of the ladder, preventing the entity from climbing beyond the ladder's endpoints.

Member Data Documentation

◆ myProcessState

DtVreLadderClimbingPSR* makVre::DtVreLadderClimbingActuator::myProcessState
protected

Process state repository for ladder climbing state.

Holds state information associated with ladder climbing, including which ladder the entity is currently on, position relative to the ladder, and climbing state. This state persists across simulation ticks and can be saved and restored with scenarios.

◆ myLadderClimbingMovementDirectionInputPort

DtAnalogInputPort* makVre::DtVreLadderClimbingActuator::myLadderClimbingMovementDirectionInputPort
protected

Input port for ladder climbing movement direction.

Receives the desired climbing direction in radians (range: 0 - 2*pi). This direction controls whether the entity climbs up, down, or remains stationary on the ladder. Parent group: movement-control

◆ myUpdateRepositoryOutputPortGroup

DtUpdateRepositoryOutputPortGroup* makVre::DtVreLadderClimbingActuator::myUpdateRepositoryOutputPortGroup
protected

Output port group for updating entity state.

Port group used to set values into the VRF state repository during ladder climbing. This includes position, velocity, orientation, and other state values in local coordinates, which are applied to the entity during simulation.


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