VTK  9.7.1
vtkWebXRUtilities.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
10 #ifndef vtkWebXRUtilities_h
11 #define vtkWebXRUtilities_h
12 
13 #include "vtkEventData.h"
14 #include "vtkMatrix4x4.h"
15 #include "vtkWebXR.h"
16 
17 VTK_ABI_NAMESPACE_BEGIN
19 {
20 
21 //----------------------------------------------------------------------------
22 // transpose of VTK standard
23 inline void SetMatrixFromWebXRMatrix(vtkMatrix4x4* result, const double* webXRMatrix)
24 {
25  result->SetData(webXRMatrix);
26  result->Transpose();
27  result->Modified();
28 }
29 
30 //------------------------------------------------------------------------------
32 {
33  switch (button)
34  {
36  {
38  }
40  {
42  }
44  {
46  }
48  {
50  }
51  case WEBXR_BUTTON_1:
52  case WEBXR_BUTTON_2:
53  case WEBXR_BUTTON_3:
54  case WEBXR_BUTTON_4:
55  {
57  }
58  default:
59  {
61  }
62  }
63 }
64 
65 //------------------------------------------------------------------------------
67 {
68  switch (hand)
69  {
71  {
73  }
75  {
77  }
79  default:
80  {
82  }
83  }
84 }
85 
86 } // namespace vtkWebXRUtilities
87 
88 VTK_ABI_NAMESPACE_END
89 #endif
90 // VTK-HeaderTest-Exclude: vtkWebXRUtilities.h
void SetData(const double data[16])
Copies data into the matrix.
Definition: vtkMatrix4x4.h:227
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:31
vtkEventDataDeviceInput
Definition: vtkEventData.h:28
void SetMatrixFromWebXRMatrix(vtkMatrix4x4 *result, const double *webXRMatrix)
Minimal WebXR Device API wrapper.
WebXRHandedness
WebXR handedness.
Definition: vtkWebXR.h:44
virtual void Modified()
Update the modification time for this object.
vtkEventDataDevice
platform-independent event data structures
Definition: vtkEventData.h:14
static void Transpose(const vtkMatrix4x4 *in, vtkMatrix4x4 *out)
Transpose the matrix and put it into out.
Definition: vtkMatrix4x4.h:120
vtkEventDataDeviceInput GetInputFromWebXRButton(WebXRGamepadButtonMapping button)
WebXRGamepadButtonMapping
Definition: vtkWebXR.h:114
vtkEventDataDevice GetDeviceFromWebXRHand(WebXRHandedness hand)