|
@@ -205,7 +205,7 @@ module BABYLON {
|
|
|
|
|
|
protected abstract handleButtonChange(buttonIdx: number, value: ExtendedGamepadButton, changes: GamepadButtonChanges);
|
|
protected abstract handleButtonChange(buttonIdx: number, value: ExtendedGamepadButton, changes: GamepadButtonChanges);
|
|
|
|
|
|
- public abstract initControllerMesh(scene: Scene)
|
|
|
|
|
|
+ public abstract initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void)
|
|
|
|
|
|
private _setButtonValue(newState: ExtendedGamepadButton, currentState: ExtendedGamepadButton, buttonIndex: number) {
|
|
private _setButtonValue(newState: ExtendedGamepadButton, currentState: ExtendedGamepadButton, buttonIndex: number) {
|
|
if (!currentState) {
|
|
if (!currentState) {
|
|
@@ -259,7 +259,7 @@ module BABYLON {
|
|
this.controllerType = PoseEnabledControllerType.OCULUS;
|
|
this.controllerType = PoseEnabledControllerType.OCULUS;
|
|
}
|
|
}
|
|
|
|
|
|
- public initControllerMesh(scene: Scene) {
|
|
|
|
|
|
+ public initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void) {
|
|
let meshName = this.hand === 'right' ? 'RightTouch.babylon' : 'LeftTouch.babylon';
|
|
let meshName = this.hand === 'right' ? 'RightTouch.babylon' : 'LeftTouch.babylon';
|
|
SceneLoader.ImportMesh("", "http://yoda.blob.core.windows.net/models/", meshName, scene, (newMeshes) => {
|
|
SceneLoader.ImportMesh("", "http://yoda.blob.core.windows.net/models/", meshName, scene, (newMeshes) => {
|
|
/*
|
|
/*
|
|
@@ -276,6 +276,9 @@ module BABYLON {
|
|
this._defaultModel = newMeshes[1];
|
|
this._defaultModel = newMeshes[1];
|
|
this._hlButtonA = new BABYLON.HighlightLayer("hlButtonA", scene);
|
|
this._hlButtonA = new BABYLON.HighlightLayer("hlButtonA", scene);
|
|
this._hlButtonB = new BABYLON.HighlightLayer("hlButtonB", scene);
|
|
this._hlButtonB = new BABYLON.HighlightLayer("hlButtonB", scene);
|
|
|
|
+ if (meshLoaded) {
|
|
|
|
+ meshLoaded(this._defaultModel);
|
|
|
|
+ }
|
|
this.attachToMesh(this._defaultModel);
|
|
this.attachToMesh(this._defaultModel);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -393,7 +396,7 @@ module BABYLON {
|
|
this.controllerType = PoseEnabledControllerType.VIVE;
|
|
this.controllerType = PoseEnabledControllerType.VIVE;
|
|
}
|
|
}
|
|
|
|
|
|
- public initControllerMesh(scene: Scene) {
|
|
|
|
|
|
+ public initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void) {
|
|
SceneLoader.ImportMesh("", "http://yoda.blob.core.windows.net/models/", "ViveWand.babylon", scene, (newMeshes) => {
|
|
SceneLoader.ImportMesh("", "http://yoda.blob.core.windows.net/models/", "ViveWand.babylon", scene, (newMeshes) => {
|
|
/*
|
|
/*
|
|
Parent Mesh name: ViveWand
|
|
Parent Mesh name: ViveWand
|
|
@@ -408,6 +411,9 @@ module BABYLON {
|
|
*/
|
|
*/
|
|
this._defaultModel = newMeshes[1];
|
|
this._defaultModel = newMeshes[1];
|
|
this._hlButtonMenu = new BABYLON.HighlightLayer("hlButtonMenu", scene);
|
|
this._hlButtonMenu = new BABYLON.HighlightLayer("hlButtonMenu", scene);
|
|
|
|
+ if (meshLoaded) {
|
|
|
|
+ meshLoaded(this._defaultModel);
|
|
|
|
+ }
|
|
this.attachToMesh(this._defaultModel);
|
|
this.attachToMesh(this._defaultModel);
|
|
});
|
|
});
|
|
}
|
|
}
|