Browse Source

Add low poly version of oculus hand

Fernando Serrano 5 years ago
parent
commit
331ceba498

+ 3 - 2
examples/jsm/webxr/XRHandOculusMeshModel.js

@@ -2,13 +2,14 @@ import { FBXLoader } from "../loaders/FBXLoader.js";
 
 
 class XRHandOculusMeshModel {
 class XRHandOculusMeshModel {
 
 
-	constructor( controller, handedness ) {
+	constructor( controller, handedness, options ) {
 
 
 		this.controller = controller;
 		this.controller = controller;
 		this.bones = [];
 		this.bones = [];
 		var loader = new FBXLoader();
 		var loader = new FBXLoader();
+		const low = options && options.model === "lowpoly" ? "_low" : "";
 
 
-		loader.load( `/examples/models/fbx/OculusHand_${handedness === "right" ? "R" : "L"}.fbx`, object => {
+		loader.load( `/examples/models/fbx/OculusHand_${handedness === "right" ? "R" : "L"}${low}.fbx`, object => {
 
 
 			this.controller.add( object );
 			this.controller.add( object );
 			object.scale.setScalar( 0.01 );
 			object.scale.setScalar( 0.01 );

BIN
examples/models/fbx/OculusHand_L_low.fbx


BIN
examples/models/fbx/OculusHand_R_low.fbx


+ 2 - 2
examples/webxr_vr_handinput_mesh.html

@@ -102,7 +102,7 @@
 				scene.add( controllerGrip1 );
 				scene.add( controllerGrip1 );
 
 
 				hand1 = renderer.xr.getHand( 0 );
 				hand1 = renderer.xr.getHand( 0 );
-				hand1.add( handModelFactory.createHandModel( hand1 ) );
+				hand1.add( handModelFactory.createHandModel( hand1, "oculus", { model: "lowpoly" } ) );
 				scene.add( hand1 );
 				scene.add( hand1 );
 
 
 				// Hand 2
 				// Hand 2
@@ -112,7 +112,7 @@
 				scene.add( controllerGrip2 );
 				scene.add( controllerGrip2 );
 
 
 				hand2 = renderer.xr.getHand( 1 );
 				hand2 = renderer.xr.getHand( 1 );
-				hand2.add( handModelFactory.createHandModel( hand2, "spheres" ) );
+				hand2.add( handModelFactory.createHandModel( hand2, "oculus" ) );
 				scene.add( hand2 );
 				scene.add( hand2 );
 
 
 				//
 				//