|
@@ -42,12 +42,23 @@ XRHandModel.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
var XRHandModelFactory = ( function () {
|
|
var XRHandModelFactory = ( function () {
|
|
|
|
|
|
- function XRHandModelFactory() {}
|
|
|
|
|
|
+ function XRHandModelFactory() {
|
|
|
|
+
|
|
|
|
+ this.path = '';
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
XRHandModelFactory.prototype = {
|
|
XRHandModelFactory.prototype = {
|
|
|
|
|
|
constructor: XRHandModelFactory,
|
|
constructor: XRHandModelFactory,
|
|
|
|
|
|
|
|
+ setPath: function ( path ) {
|
|
|
|
+
|
|
|
|
+ this.path = path;
|
|
|
|
+ return this;
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
createHandModel: function ( controller, profile, options ) {
|
|
createHandModel: function ( controller, profile, options ) {
|
|
|
|
|
|
const handModel = new XRHandModel( controller );
|
|
const handModel = new XRHandModel( controller );
|
|
@@ -65,15 +76,15 @@ var XRHandModelFactory = ( function () {
|
|
// @todo Detect profile if not provided
|
|
// @todo Detect profile if not provided
|
|
if ( profile === undefined || profile === "spheres" ) {
|
|
if ( profile === undefined || profile === "spheres" ) {
|
|
|
|
|
|
- handModel.motionController = new XRHandPrimitiveModel( handModel, controller, xrInputSource.handedness, { primitive: "sphere" } );
|
|
|
|
|
|
+ handModel.motionController = new XRHandPrimitiveModel( handModel, controller, this.path, xrInputSource.handedness, { primitive: "sphere" } );
|
|
|
|
|
|
} else if ( profile === "boxes" ) {
|
|
} else if ( profile === "boxes" ) {
|
|
|
|
|
|
- handModel.motionController = new XRHandPrimitiveModel( handModel, controller, xrInputSource.handedness, { primitive: "box" } );
|
|
|
|
|
|
+ handModel.motionController = new XRHandPrimitiveModel( handModel, controller, this.path, xrInputSource.handedness, { primitive: "box" } );
|
|
|
|
|
|
} else if ( profile === "oculus" ) {
|
|
} else if ( profile === "oculus" ) {
|
|
|
|
|
|
- handModel.motionController = new XRHandOculusMeshModel( handModel, controller, xrInputSource.handedness, options );
|
|
|
|
|
|
+ handModel.motionController = new XRHandOculusMeshModel( handModel, controller, this.path, xrInputSource.handedness, options );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|