16#ifndef vtkWebXRRenderWindowInteractor_h
17#define vtkWebXRRenderWindowInteractor_h
19#include "vtkRenderingWebXRModule.h"
24VTK_ABI_NAMESPACE_BEGIN
70 double wxyz[4],
double ppos[3],
double wdir[3]);
92 const std::string& path,
bool isAnalog,
const std::function<
void(
vtkEventData*)>&)
override;
110 vtkTypeUInt32 optionalFeatures = 2);
150 if (this->hand != other.
hand)
152 return this->hand < other.
hand;
154 else if (this->button != other.
button)
156 return this->button < other.
button;
160 return this->mode < other.
mode;
a simple class to control print indentation
Allocate and hold a VTK object.
abstract specification for renderers
vtkVRRenderWindowInteractor()
std::function< void(vtkEventData *)> Function
vtkEventDataDeviceInput DeviceInput
vtkCommand::EventIds EventId
static vtkWebXRRenderWindowInteractor * New()
void AddAction(const std::string &path, const std::function< void(vtkEventData *)> &)
Assign an event or std::function to an event path.
bool LoadActions(const std::string &actionFilename)
Load JSON actions file from given path for interactions.
const ActionData * GetActionData(const std::string &actionName)
static void StartXR(SessionMode mode=SessionMode::VR, vtkTypeUInt32 requiredFeatures=1, vtkTypeUInt32 optionalFeatures=2)
Starts and Stops a WebXR Session.
std::map< WebXRInput, ActionData * > ButtonToActionMap
void DoOneEvent(vtkVRRenderWindow *renWin, vtkRenderer *ren) override
Implement the event loop.
void UpdateXRControllers()
Updates WebXR controllers state and invoke corresponding events.
void TerminateApp() override
Stop the XR session and stop the emscripten main loop.
void Initialize() override
Initialize the event handler.
const ActionData * GetActionData(WebXRHandedness hand, WebXRGamepadButtonMapping button, WebXRInputPoseMode mode)
void AddAction(const std::string &path, const vtkCommand::EventIds &)
Assign an event or std::function to an event path.
std::map< std::string, ActionData > ActionMap
void StartEventLoop() override
Start emscripten main loop with an empty function.
~vtkWebXRRenderWindowInteractor() override
void AddAction(const std::string &path, bool isAnalog, const std::function< void(vtkEventData *)> &) override
Assign an event or std::function to an event path.
vtkWebXRRenderWindowInteractor()
static void StopXR()
Starts and Stops a WebXR Session.
void ConvertWebXRPoseToWorldCoordinates(const WebXRRigidTransform &xrPose, double pos[3], double wxyz[4], double ppos[3], double wdir[3])
Retrieve camera's world coordinates from WebXR API's pose.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void AddAction(const std::string &path, const vtkCommand::EventIds &, bool isAnalog) override
Assign an event or std::function to an event path.
void ApplyAction(const ActionData &actionData, vtkEventDataDevice3D *ed)
Invoke event or callback of an action.
WebXR Gamepad see https://www.w3.org/TR/2024/WD-webxr-gamepads-module-1-20240409/#xr-standard-heading...
Minimal WebXR Device API wrapper.
WebXRInputPoseMode
WebXR 'XRSessionMode' enum.
WebXRGamepadButtonMapping
WebXRHandedness
WebXR handedness.
@ WEBXR_SESSION_MODE_INLINE
@ WEBXR_SESSION_MODE_IMMERSIVE_AR
@ WEBXR_SESSION_MODE_IMMERSIVE_VR