@kitware/vtk.js 22.0.0 → 22.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -119,7 +119,7 @@ declare function buildFromRadian(): Transform;
|
|
|
119
119
|
* @example
|
|
120
120
|
* ```js
|
|
121
121
|
* let point = [2,5,12];
|
|
122
|
-
* vtkMatrixBuilder.
|
|
122
|
+
* vtkMatrixBuilder.buildFromDegree().translate(1,0,2).rotateZ(45).apply(point);
|
|
123
123
|
* ```
|
|
124
124
|
*
|
|
125
125
|
* The vtkMatrixBuilder class has two functions, `vtkMatrixBuilder.buildFromDegree()` and
|
|
@@ -381,7 +381,7 @@ function vtkRenderWindowInteractor(publicAPI, model) {
|
|
|
381
381
|
publicAPI.updateXRGamepads = function (xrSession, xrFrame, xrRefSpace) {
|
|
382
382
|
// watch for when buttons change state and fire events
|
|
383
383
|
xrSession.inputSources.forEach(function (inputSource) {
|
|
384
|
-
var
|
|
384
|
+
var gripPose = inputSource.gripSpace == null ? null : xrFrame.getPose(inputSource.gripSpace, xrRefSpace);
|
|
385
385
|
var gp = inputSource.gamepad;
|
|
386
386
|
var hand = inputSource.handedness;
|
|
387
387
|
|
|
@@ -402,11 +402,11 @@ function vtkRenderWindowInteractor(publicAPI, model) {
|
|
|
402
402
|
model.lastGamepadValues[gp.index][hand].buttons[b] = false;
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
-
if (model.lastGamepadValues[gp.index][hand].buttons[b] !== gp.buttons[b].pressed) {
|
|
405
|
+
if (model.lastGamepadValues[gp.index][hand].buttons[b] !== gp.buttons[b].pressed && gripPose != null) {
|
|
406
406
|
publicAPI.button3DEvent({
|
|
407
407
|
gamepad: gp,
|
|
408
|
-
position:
|
|
409
|
-
orientation:
|
|
408
|
+
position: gripPose.transform.position,
|
|
409
|
+
orientation: gripPose.transform.orientation,
|
|
410
410
|
pressed: gp.buttons[b].pressed,
|
|
411
411
|
device: inputSource.handedness === 'left' ? Device.LeftController : Device.RightController,
|
|
412
412
|
input: deviceInputMap[gp.mapping] && deviceInputMap[gp.mapping][b] ? deviceInputMap[gp.mapping][b] : Input.Trigger
|
|
@@ -414,11 +414,11 @@ function vtkRenderWindowInteractor(publicAPI, model) {
|
|
|
414
414
|
model.lastGamepadValues[gp.index][hand].buttons[b] = gp.buttons[b].pressed;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
if (model.lastGamepadValues[gp.index][hand].buttons[b]) {
|
|
417
|
+
if (model.lastGamepadValues[gp.index][hand].buttons[b] && gripPose != null) {
|
|
418
418
|
publicAPI.move3DEvent({
|
|
419
419
|
gamepad: gp,
|
|
420
|
-
position:
|
|
421
|
-
orientation:
|
|
420
|
+
position: gripPose.transform.position,
|
|
421
|
+
orientation: gripPose.transform.orientation,
|
|
422
422
|
device: inputSource.handedness === 'left' ? Device.LeftController : Device.RightController
|
|
423
423
|
});
|
|
424
424
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitware/vtk.js",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.1",
|
|
4
4
|
"description": "Visualization Toolkit for the Web",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"3d",
|
|
@@ -115,7 +115,6 @@
|
|
|
115
115
|
"semantic-release": "18.0.1",
|
|
116
116
|
"string-replace-loader": "3.1.0",
|
|
117
117
|
"style-loader": "3.3.1",
|
|
118
|
-
"tap-markdown": "1.2.1",
|
|
119
118
|
"tap-spec": "5.0.0",
|
|
120
119
|
"tape": "5.4.0",
|
|
121
120
|
"tape-catch": "1.0.6",
|