28class DtVirtualRealityDriver;
29class DtSubmitOverlayCallback;
35class DtVirtualRealityEventProcessor;
102 virtual void tick(
double dt)
override;
110 virtual const char*
type()
const override;
Defines a class that encapsulates the state of a VR controller.
Defines the base class for VR controller event management.
A class that simulates a directional pad from analog inputs.
Definition virtualDpad.h:22
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Base class for all role components in VR-Engage.
Definition playerComponent.h:78
virtual DtPlayerStation & player()
Gets the player station.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
virtual void tick(double dt) override
Called every frame to update the VR state.
virtual const char * type() const override
Returns the type identifier for this component.
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the virtual reality logic component.
makVrv::DtVirtualRealityDriver * myVrDriver
Pointer to the VR driver for hardware interaction.
Definition virtualRealityLogic.h:203
ControllerIdentifier myRightHandId
Identifier for the right hand controller.
Definition virtualRealityLogic.h:233
bool myRightHanded
Flag indicating if the player uses right hand as dominant.
Definition virtualRealityLogic.h:221
int myFramesSinceMenu
Counter for frames elapsed since menu interaction.
Definition virtualRealityLogic.h:236
makVrv::DtVirtualRealityEventManager::ControllerStateMap ControllerStateMap
Type alias for a map of controller IDs to controller state pointers.
Definition virtualRealityLogic.h:66
bool myVrWasEnabled
Flag indicating if VR was enabled before entering a menu.
Definition virtualRealityLogic.h:218
virtual void shutdown() override
Shuts down the virtual reality logic component.
virtual void stopVr()
Stops VR mode.
virtual void resetHeadPos()
Resets the HMD head position tracking.
makVrv::DtSubmitOverlayCallback * myVrOverlay
Callback for submitting overlay graphics to VR display.
Definition virtualRealityLogic.h:212
makVrv::DtVirtualRealityControllerState::ControllerId ControllerId
Type alias for controller identifier values.
Definition virtualRealityLogic.h:72
makVrv::DtVirtualRealityControllerState::DtVector2f DtVector2f
Type alias for 2D vector used in controller inputs.
Definition virtualRealityLogic.h:75
bool myDidHaveHandMotion
Flag tracking if hand motion was detected in the current frame.
Definition virtualRealityLogic.h:224
virtual void startVr()
Starts VR mode.
int myLastMainChannelRenderOrder
Cached render order for the main channel to restore when exiting VR.
Definition virtualRealityLogic.h:245
DtVirtualRealityLogic()
Constructor for DtVirtualRealityLogic.
makVrv::DtVirtualRealityControllerState ControllerState
Type alias for virtual reality controller state.
Definition virtualRealityLogic.h:78
virtual makVre::DtVreMessageResult handleToggleMixedReality(makVre::DtVreMessage *msg)
Handles toggle mixed reality message.
virtual makVre::DtVreMessageResult handleEnterPlayerState(makVre::DtVreMessage *msg)
Handles player entering a state.
virtual void processControllerStates(const ControllerStateMap &controllers)
Processes the current state of all tracked VR controllers.
virtual void handleResetHeadPosInput(int val)
Input handler for resetting head position.
ControllerIdentifier myHeadId
Identifier for the HMD controller.
Definition virtualRealityLogic.h:227
virtual makVre::DtVreMessageResult handleExitPlayerState(makVre::DtVreMessage *msg)
Handles player exiting a state.
makVrv::DtVirtualRealityControllerState::Bitfield Bitfield
Type alias for controller type bitfield values.
Definition virtualRealityLogic.h:69
virtual makVre::DtVreMessageResult handleResetVrHeadPos(makVre::DtVreMessage *msg)
Handles reset VR head position message.
ControllerIdentifier myLeftHandId
Identifier for the left hand controller.
Definition virtualRealityLogic.h:230
DtVirtualDpad myVirtualDpad
Virtual D-pad for converting analog input to digital directions.
Definition virtualRealityLogic.h:239
DtInputLogic myInputLogic
Input logic for mapping actions to VR functions.
Definition virtualRealityLogic.h:242
DtVirtualRealityEventProcessor * myEventProcessor
Processor for VR controller events.
Definition virtualRealityLogic.h:206
DtActionMenuLogic * myMenuLogic
Menu logic component for handling VR menu interactions.
Definition virtualRealityLogic.h:209
bool myVrEnabled
Flag indicating if VR is currently enabled.
Definition virtualRealityLogic.h:215
virtual const ControllerState * findController(ControllerIdentifier &identifier, const ControllerStateMap &controllers)
Finds a controller in the controller state map.
virtual ~DtVirtualRealityLogic() override
Virtual destructor for DtVirtualRealityLogic.
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Encapsulates the complete state of a virtual reality controller.
Definition DtVirtualRealityControllerState.h:35
DtVector2< float32 > DtVector2f
Type used for 2D vector values.
Definition DtVirtualRealityControllerState.h:52
unsigned long long Bitfield
Type used for bit flags throughout the class.
Definition DtVirtualRealityControllerState.h:41
unsigned int ControllerId
Type used for controller identification.
Definition DtVirtualRealityControllerState.h:46
std::map< unsigned int, DtVirtualRealityControllerState * > ControllerStateMap
Map type that associates controller IDs with their state objects.
Definition DtVirtualRealityEventManager.h:60
constexpr const char * rightHanded
Definition virtualRealityLogic.h:47
Defines export/import macros for the vreCommonComponents library.
#define VRECOMMONCOMPONENTS_DLL
DLL export/import macro for the vreCommonComponents library.
Definition export.h:28
Definition virtualRealityLogic.h:39
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
constexpr const char * DtVirtualRealityLogicType
Type identifier for DtVirtualRealityLogic component.
Definition virtualRealityLogic.h:53
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Definition appLauncherComponent.h:28
Defines the DtPlayerComponent base class for VR-Engage role components.
Structure for identifying and tracking VR controllers.
Definition virtualRealityLogic.h:136
ControllerIdentifier(Bitfield type)
Constructor that initializes with a controller type.
Definition virtualRealityLogic.h:139
Bitfield controllerType
Type of the controller (HMD, left hand, right hand)
Definition virtualRealityLogic.h:146
ControllerId controllerId
Unique identifier for the controller instance.
Definition virtualRealityLogic.h:149
Provides a virtual directional pad implementation.
Defines the base class for all VREngage messages.