Skip to content

Commit

Permalink
XRHandOculusMeshModel: Removed hardcoded fbx folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jul 28, 2020
1 parent 33f1f8f commit 7cb0a77
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/jsm/webxr/XRHandOculusMeshModel.js
Expand Up @@ -12,7 +12,7 @@ class XRHandOculusMeshModel {
const low = options && options.model === "lowpoly" ? "_low" : "";

loader.setPath( path );
loader.load( `fbx/OculusHand_${handedness === "right" ? "R" : "L"}${low}.fbx`, object => {
loader.load( `OculusHand_${handedness === "right" ? "R" : "L"}${low}.fbx`, object => {

this.handModel.add( object );
// Hack because of the scale of the skinnedmesh
Expand Down
2 changes: 1 addition & 1 deletion examples/webxr_vr_handinput.html
Expand Up @@ -101,7 +101,7 @@
scene.add( controller2 );

var controllerModelFactory = new XRControllerModelFactory();
var handModelFactory = new XRHandModelFactory().setPath( "./models/" );
var handModelFactory = new XRHandModelFactory().setPath( "./models/fbx/" );

// Hand 1
controllerGrip1 = renderer.xr.getControllerGrip( 0 );
Expand Down
2 changes: 1 addition & 1 deletion examples/webxr_vr_handinput_profiles.html
Expand Up @@ -103,7 +103,7 @@
scene.add( controller2 );

var controllerModelFactory = new XRControllerModelFactory();
var handModelFactory = new XRHandModelFactory().setPath( "./models/" );
var handModelFactory = new XRHandModelFactory().setPath( "./models/fbx/" );

// Hand 1

Expand Down
2 changes: 1 addition & 1 deletion examples/webxr_vr_handinput_simple.html
Expand Up @@ -91,7 +91,7 @@
scene.add( controller2 );

var controllerModelFactory = new XRControllerModelFactory();
var handModelFactory = new XRHandModelFactory().setPath( "./models/" );
var handModelFactory = new XRHandModelFactory().setPath( "./models/fbx/" );

// Hand 1
controllerGrip1 = renderer.xr.getControllerGrip( 0 );
Expand Down
6 changes: 4 additions & 2 deletions src/renderers/webxr/WebXRController.js
@@ -1,9 +1,9 @@
import { Group } from '../../objects/Group.js';

/**
* @author Mugen87 / https://github.com/Mugen87
*/

import { Group } from '../../objects/Group.js';

function WebXRController() {

this._targetRay = null;
Expand Down Expand Up @@ -142,6 +142,7 @@ Object.assign( WebXRController.prototype, {
if ( inputSource.hand ) {

handPose = true;

for ( let i = 0; i <= window.XRHand.LITTLE_PHALANX_TIP; i ++ ) {

if ( inputSource.hand[ i ] ) {
Expand Down Expand Up @@ -169,6 +170,7 @@ Object.assign( WebXRController.prototype, {

const distanceToPinch = 0.02;
const threshold = 0.005;

if ( hand.inputState.pinching && distance > distanceToPinch + threshold ) {

hand.inputState.pinching = false;
Expand Down

0 comments on commit 7cb0a77

Please sign in to comment.