Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass onLoad callback to XRHandModelFactory and OculusHandModel #28074

Merged
merged 3 commits into from Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/jsm/webxr/OculusHandModel.js
Expand Up @@ -6,14 +6,15 @@ const POINTING_JOINT = 'index-finger-tip';

class OculusHandModel extends Object3D {

constructor( controller, loader = null ) {
constructor( controller, loader = null, onLoad = null ) {

super();

this.controller = controller;
this.motionController = null;
this.envMap = null;
this.loader = loader;
this.onLoad = onLoad;

this.mesh = null;

Expand All @@ -25,7 +26,7 @@ class OculusHandModel extends Object3D {

this.xrInputSource = xrInputSource;

this.motionController = new XRHandMeshModel( this, controller, this.path, xrInputSource.handedness, this.loader );
this.motionController = new XRHandMeshModel( this, controller, this.path, xrInputSource.handedness, this.loader, this.onLoad );

}

Expand Down
6 changes: 4 additions & 2 deletions examples/jsm/webxr/XRHandModelFactory.js
Expand Up @@ -40,9 +40,11 @@ class XRHandModel extends Object3D {

class XRHandModelFactory {

constructor() {
constructor(gltfLoader = null, onLoad = null) {

this.gltfLoader = gltfLoader;
this.path = null;
this.onLoad = onLoad;

}

Expand Down Expand Up @@ -77,7 +79,7 @@ class XRHandModelFactory {

} else if ( profile === 'mesh' ) {

handModel.motionController = new XRHandMeshModel( handModel, controller, this.path, xrInputSource.handedness );
handModel.motionController = new XRHandMeshModel( handModel, controller, this.path, xrInputSource.handedness, this.gltfLoader, this.onLoad );

}

Expand Down