@needle-tools/three 0.145.1 → 0.145.2
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.
|
@@ -6,13 +6,14 @@ const POINTING_JOINT = 'index-finger-tip';
|
|
|
6
6
|
|
|
7
7
|
class OculusHandModel extends Object3D {
|
|
8
8
|
|
|
9
|
-
constructor( controller ) {
|
|
9
|
+
constructor( controller, loader ) {
|
|
10
10
|
|
|
11
11
|
super();
|
|
12
12
|
|
|
13
13
|
this.controller = controller;
|
|
14
14
|
this.motionController = null;
|
|
15
15
|
this.envMap = null;
|
|
16
|
+
this.loader = loader;
|
|
16
17
|
|
|
17
18
|
this.mesh = null;
|
|
18
19
|
|
|
@@ -24,7 +25,7 @@ class OculusHandModel extends Object3D {
|
|
|
24
25
|
|
|
25
26
|
this.xrInputSource = xrInputSource;
|
|
26
27
|
|
|
27
|
-
this.motionController = new XRHandMeshModel( this, controller, this.path, xrInputSource.handedness );
|
|
28
|
+
this.motionController = new XRHandMeshModel( this, controller, this.path, xrInputSource.handedness, this.loader );
|
|
28
29
|
|
|
29
30
|
}
|
|
30
31
|
|
|
@@ -4,15 +4,17 @@ const DEFAULT_HAND_PROFILE_PATH = 'https://cdn.jsdelivr.net/npm/@webxr-input-pro
|
|
|
4
4
|
|
|
5
5
|
class XRHandMeshModel {
|
|
6
6
|
|
|
7
|
-
constructor( handModel, controller, path, handedness ) {
|
|
7
|
+
constructor( handModel, controller, path, handedness, loader ) {
|
|
8
8
|
|
|
9
9
|
this.controller = controller;
|
|
10
10
|
this.handModel = handModel;
|
|
11
11
|
|
|
12
12
|
this.bones = [];
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
if (!loader) {
|
|
15
|
+
loader = new GLTFLoader();
|
|
16
|
+
loader.setPath( DEFAULT_HAND_PROFILE_PATH );
|
|
17
|
+
}
|
|
16
18
|
loader.load( `${handedness}.glb`, gltf => {
|
|
17
19
|
|
|
18
20
|
const object = gltf.scene.children[ 0 ];
|