22#include <vrfobjcore/controllerComponent.h>
24#include <vrfmodel/joystickControllerInterface.h>
27class DtSimulationServices;
28class DtJoyDeviceControllerDescriptor;
30class DtHumanMovementControlOutputPortGroup;
31class DtHumanStateRepository;
32class DtBooleanOutputPort;
33class DtIntegerOutputPort;
34class DtAnalogOutputPort;
35class DtSetDataRequest;
55 public DtJoystickControllerInterface
67 DtComponentDescriptor* desc, DtReaderWriterRegistry* parentRegistry = 0);
79 virtual const char*
type()
const override;
93 virtual bool init()
override;
112 static DtSimComponent*
creator(
const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
113 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
144 const DtString& functionGroup,
const DtString& function,
double value,
bool repeat)
override;
202 const DtVector& localPosition,
const DtVector& ladderAccessPoint,
double radiusSquared);
212 const DtLadder& ladder, DtVector& ladderAccessPoint, DtVector& ladderTerrainAccessPoint);
269 virtual void snapToLadder(
const DtVector& ladderAccessPoint,
const DtVector& offset,
double heading);
DtLadderLocator * myLadderLocator
Helper class for locating ladders.
Definition humanLadderClimbingController.h:317
virtual void stowWeapon()
Instructs the entity to stow its weapon.
virtual void snapToLadder(const DtVector &ladderAccessPoint, const DtVector &offset, double heading)
Snaps the entity to a ladder position.
virtual void enableLadderClimbingAnimation()
Enables ladder climbing animation.
virtual void joystickDisconnected() override
Handles joystick disconnection event.
virtual const char * type() const override
Gets the type identifier for this component.
virtual bool facingLadder(const DtLadder &ladder, const DtVector &ladderAccessPoint)
Checks if the entity is facing a ladder.
virtual void setEntityLocation(const DtVector &localPosition)
Sets the entity's position.
static double theLeavingAtLadderPointDistanceSqr
Squared distance threshold when leaving ladders.
Definition humanLadderClimbingController.h:347
static double theApproachingAtLadderPointDistanceSqr
Squared distance threshold when approaching ladders.
Definition humanLadderClimbingController.h:339
virtual bool atLadderExitPoint(const DtLadder &ladder, DtVector &ladderAccessPoint, DtVector &ladderTerrainAccessPoint)
Checks if the entity is at a ladder exit point.
static double theTimeItTakesToGetOnOffLadderAtTop
Time required to get on/off a ladder at the top.
Definition humanLadderClimbingController.h:360
virtual void tick() override
Updates the controller state each simulation frame.
virtual bool init() override
Initializes the component.
static double theHalfLadderLengthSquared
Squared half-length of a typical ladder.
Definition humanLadderClimbingController.h:374
static double theFacingHalfAzimuthAngle
Half-angle for determining if entity is facing a location.
Definition humanLadderClimbingController.h:354
static double theLadderSearchRadius
Search radius for finding nearby ladders.
Definition humanLadderClimbingController.h:324
DtHumanLadderClimbingController()
Default constructor (not implemented)
double myMaxLadderClimbingSpeed
Maximum speed when climbing ladders.
Definition humanLadderClimbingController.h:311
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 tickLadderMovementControl()
Updates ladder movement control each simulation frame.
virtual void sendDataRequest(DtSetDataRequest *setRequest)
Sends a data request to update entity state.
DtHumanLadderClimbingController(const DtHumanLadderClimbingController &orig)
Copy constructor (not implemented)
virtual void disableLadderClimbingAnimation()
Disables ladder climbing animation.
DtVreLadderClimbingPSR * myProcessState
Pointer to the ladder climbing process state repository.
Definition humanLadderClimbingController.h:304
virtual bool initLadderMovementControl()
Initializes ladder movement control.
DtHumanLadderClimbingController(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry=0)
Constructor.
virtual void setEntityHeading(double heading)
Sets the entity's heading/orientation.
static double theOnLadderAtLadderPointDistanceSqr
Squared distance threshold for being on a ladder.
Definition humanLadderClimbingController.h:331
double myForward
Current forward/backward movement input value.
Definition humanLadderClimbingController.h:296
virtual void setNearestLadderAndGetOnLadderPoint(const DtLadder &ladder, const DtVector &ladderAccessPoint)
Sets the nearest ladder information and updates access point.
virtual void calcAndSetPortValues(const DtString &functionGroup, const DtString &function, double value, bool repeat) override
Processes joystick input and updates output ports.
virtual ~DtHumanLadderClimbingController() override
Virtual destructor.
static double theStandoffDistanceFromLadder
Distance to maintain between entity and ladder.
Definition humanLadderClimbingController.h:367
virtual void lookupAndCacheProcessSR()
Retrieves and caches the ladder climbing process state repository.
DtHumanLadderClimbingController & operator=(const DtHumanLadderClimbingController &orig)
Assignment operator (not implemented)
DtAnalogOutputPort * myLadderClimbingMovementDirectionPort
Output port for ladder climbing movement direction.
Definition humanLadderClimbingController.h:288
virtual bool atLadder(DtLadder &ladder, DtVector &accessPoint)
Checks if the entity is at a ladder position.
virtual bool createPorts() override
Creates input and output ports for this component.
virtual DtVector localStandoffFromLadder(const DtLadder &ladder) const
Calculates the local standoff vector from a ladder.
virtual bool atLadderAccessPoint(const DtVector &localPosition, const DtVector &ladderAccessPoint, double radiusSquared)
Checks if the entity is at a specific ladder access point.
virtual bool postAddComponentsInit() override
Performs initialization after all entity components are created.
virtual void joystickConnected() override
Handles joystick connection event.
Helper class that represents a climbable ladder in simulations.
Definition ladder.h:35
Helper class for finding ladders and their access points in simulations.
Definition ladderLocator.h:36
Process state repository for ladder climbing components.
Definition vreLadderClimbingPSR.h:61
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 DtHumanLadderClimbingControllerType[]
Type identifier for the human ladder climbing controller component.
Definition humanLadderClimbingController.h:43
Ladder climbing process state repository for VREngage.
Base template class for VR-Engage simulation components.