Skip to content

Commit 907fb0a

Browse files
committed
Updated builds
1 parent e10d36f commit 907fb0a

File tree

3 files changed

+98
-5
lines changed

3 files changed

+98
-5
lines changed

build/three.js

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16144,6 +16144,10 @@
1614416144

1614516145
Group.prototype.isGroup = true;
1614616146

16147+
const _moveEvent = {
16148+
type: 'move'
16149+
};
16150+
1614716151
class WebXRController {
1614816152
constructor() {
1614916153
this._targetRay = null;
@@ -16170,6 +16174,10 @@
1617016174
this._targetRay = new Group();
1617116175
this._targetRay.matrixAutoUpdate = false;
1617216176
this._targetRay.visible = false;
16177+
this._targetRay.hasLinearVelocity = false;
16178+
this._targetRay.linearVelocity = new Vector3();
16179+
this._targetRay.hasAngularVelocity = false;
16180+
this._targetRay.angularVelocity = new Vector3();
1617316181
}
1617416182

1617516183
return this._targetRay;
@@ -16180,6 +16188,10 @@
1618016188
this._grip = new Group();
1618116189
this._grip.matrixAutoUpdate = false;
1618216190
this._grip.visible = false;
16191+
this._grip.hasLinearVelocity = false;
16192+
this._grip.linearVelocity = new Vector3();
16193+
this._grip.hasAngularVelocity = false;
16194+
this._grip.angularVelocity = new Vector3();
1618316195
}
1618416196

1618516197
return this._grip;
@@ -16237,9 +16249,22 @@
1623716249
if (inputPose !== null) {
1623816250
targetRay.matrix.fromArray(inputPose.transform.matrix);
1623916251
targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
16240-
this.dispatchEvent({
16241-
type: 'move'
16242-
});
16252+
16253+
if (inputPose.linearVelocity !== null) {
16254+
targetRay.hasLinearVelocity = true;
16255+
targetRay.linearVelocity.copy(inputPose.linearVelocity);
16256+
} else {
16257+
targetRay.hasLinearVelocity = false;
16258+
}
16259+
16260+
if (inputPose.angularVelocity !== null) {
16261+
targetRay.hasAngularVelocity = true;
16262+
targetRay.angularVelocity.copy(inputPose.angularVelocity);
16263+
} else {
16264+
targetRay.hasAngularVelocity = false;
16265+
}
16266+
16267+
this.dispatchEvent(_moveEvent);
1624316268
}
1624416269
}
1624516270

@@ -16301,6 +16326,20 @@
1630116326
if (gripPose !== null) {
1630216327
grip.matrix.fromArray(gripPose.transform.matrix);
1630316328
grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
16329+
16330+
if (gripPose.linearVelocity !== null) {
16331+
grip.hasLinearVelocity = true;
16332+
grip.linearVelocity.copy(gripPose.linearVelocity);
16333+
} else {
16334+
grip.hasLinearVelocity = false;
16335+
}
16336+
16337+
if (gripPose.angularVelocity !== null) {
16338+
grip.hasAngularVelocity = true;
16339+
grip.angularVelocity.copy(gripPose.angularVelocity);
16340+
} else {
16341+
grip.hasAngularVelocity = false;
16342+
}
1630416343
}
1630516344
}
1630616345
}

build/three.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/three.module.js

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21826,6 +21826,8 @@ class Group extends Object3D {
2182621826

2182721827
Group.prototype.isGroup = true;
2182821828

21829+
const _moveEvent = { type: 'move' };
21830+
2182921831
class WebXRController {
2183021832

2183121833
constructor() {
@@ -21860,6 +21862,10 @@ class WebXRController {
2186021862
this._targetRay = new Group();
2186121863
this._targetRay.matrixAutoUpdate = false;
2186221864
this._targetRay.visible = false;
21865+
this._targetRay.hasLinearVelocity = false;
21866+
this._targetRay.linearVelocity = new Vector3();
21867+
this._targetRay.hasAngularVelocity = false;
21868+
this._targetRay.angularVelocity = new Vector3();
2186321869

2186421870
}
2186521871

@@ -21874,6 +21880,10 @@ class WebXRController {
2187421880
this._grip = new Group();
2187521881
this._grip.matrixAutoUpdate = false;
2187621882
this._grip.visible = false;
21883+
this._grip.hasLinearVelocity = false;
21884+
this._grip.linearVelocity = new Vector3();
21885+
this._grip.hasAngularVelocity = false;
21886+
this._grip.angularVelocity = new Vector3();
2187721887

2187821888
}
2187921889

@@ -21952,7 +21962,29 @@ class WebXRController {
2195221962
targetRay.matrix.fromArray( inputPose.transform.matrix );
2195321963
targetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );
2195421964

21955-
this.dispatchEvent( { type: 'move' } );
21965+
if ( inputPose.linearVelocity !== null ) {
21966+
21967+
targetRay.hasLinearVelocity = true;
21968+
targetRay.linearVelocity.copy( inputPose.linearVelocity );
21969+
21970+
} else {
21971+
21972+
targetRay.hasLinearVelocity = false;
21973+
21974+
}
21975+
21976+
if ( inputPose.angularVelocity !== null ) {
21977+
21978+
targetRay.hasAngularVelocity = true;
21979+
targetRay.angularVelocity.copy( inputPose.angularVelocity );
21980+
21981+
} else {
21982+
21983+
targetRay.hasAngularVelocity = false;
21984+
21985+
}
21986+
21987+
this.dispatchEvent( _moveEvent );
2195621988

2195721989
}
2195821990

@@ -22034,6 +22066,28 @@ class WebXRController {
2203422066
grip.matrix.fromArray( gripPose.transform.matrix );
2203522067
grip.matrix.decompose( grip.position, grip.rotation, grip.scale );
2203622068

22069+
if ( gripPose.linearVelocity !== null ) {
22070+
22071+
grip.hasLinearVelocity = true;
22072+
grip.linearVelocity.copy( gripPose.linearVelocity );
22073+
22074+
} else {
22075+
22076+
grip.hasLinearVelocity = false;
22077+
22078+
}
22079+
22080+
if ( gripPose.angularVelocity !== null ) {
22081+
22082+
grip.hasAngularVelocity = true;
22083+
grip.angularVelocity.copy( gripPose.angularVelocity );
22084+
22085+
} else {
22086+
22087+
grip.hasAngularVelocity = false;
22088+
22089+
}
22090+
2203722091
}
2203822092

2203922093
}

0 commit comments

Comments
 (0)