|
@@ -58347,7 +58347,8 @@ var BABYLON;
|
|
PoseEnabledControllerType[PoseEnabledControllerType["VIVE"] = 0] = "VIVE";
|
|
PoseEnabledControllerType[PoseEnabledControllerType["VIVE"] = 0] = "VIVE";
|
|
PoseEnabledControllerType[PoseEnabledControllerType["OCULUS"] = 1] = "OCULUS";
|
|
PoseEnabledControllerType[PoseEnabledControllerType["OCULUS"] = 1] = "OCULUS";
|
|
PoseEnabledControllerType[PoseEnabledControllerType["WINDOWS"] = 2] = "WINDOWS";
|
|
PoseEnabledControllerType[PoseEnabledControllerType["WINDOWS"] = 2] = "WINDOWS";
|
|
- PoseEnabledControllerType[PoseEnabledControllerType["GENERIC"] = 3] = "GENERIC";
|
|
|
|
|
|
+ PoseEnabledControllerType[PoseEnabledControllerType["GEAR_VR"] = 3] = "GEAR_VR";
|
|
|
|
+ PoseEnabledControllerType[PoseEnabledControllerType["GENERIC"] = 4] = "GENERIC";
|
|
})(PoseEnabledControllerType = BABYLON.PoseEnabledControllerType || (BABYLON.PoseEnabledControllerType = {}));
|
|
})(PoseEnabledControllerType = BABYLON.PoseEnabledControllerType || (BABYLON.PoseEnabledControllerType = {}));
|
|
var PoseEnabledControllerHelper = /** @class */ (function () {
|
|
var PoseEnabledControllerHelper = /** @class */ (function () {
|
|
function PoseEnabledControllerHelper() {
|
|
function PoseEnabledControllerHelper() {
|
|
@@ -58363,6 +58364,9 @@ var BABYLON;
|
|
else if (vrGamepad.id.toLowerCase().indexOf('openvr') !== -1) {
|
|
else if (vrGamepad.id.toLowerCase().indexOf('openvr') !== -1) {
|
|
return new BABYLON.ViveController(vrGamepad);
|
|
return new BABYLON.ViveController(vrGamepad);
|
|
}
|
|
}
|
|
|
|
+ else if (vrGamepad.id.indexOf(BABYLON.GearVRController.GAMEPAD_ID_PREFIX) === 0) {
|
|
|
|
+ return new BABYLON.GearVRController(vrGamepad);
|
|
|
|
+ }
|
|
else {
|
|
else {
|
|
return new BABYLON.GenericController(vrGamepad);
|
|
return new BABYLON.GenericController(vrGamepad);
|
|
}
|
|
}
|
|
@@ -59221,6 +59225,50 @@ var BABYLON;
|
|
//# sourceMappingURL=babylon.windowsMotionController.js.map
|
|
//# sourceMappingURL=babylon.windowsMotionController.js.map
|
|
|
|
|
|
|
|
|
|
|
|
+var BABYLON;
|
|
|
|
+(function (BABYLON) {
|
|
|
|
+ var GearVRController = /** @class */ (function (_super) {
|
|
|
|
+ __extends(GearVRController, _super);
|
|
|
|
+ function GearVRController(vrGamepad) {
|
|
|
|
+ var _this = _super.call(this, vrGamepad) || this;
|
|
|
|
+ _this._buttonIndexToObservableNameMap = [
|
|
|
|
+ 'onTrackpadChangedObservable',
|
|
|
|
+ 'onTriggerStateChangedObservable' // Trigger
|
|
|
|
+ ];
|
|
|
|
+ _this.controllerType = BABYLON.PoseEnabledControllerType.GEAR_VR;
|
|
|
|
+ return _this;
|
|
|
|
+ }
|
|
|
|
+ GearVRController.prototype.initControllerMesh = function (scene, meshLoaded) {
|
|
|
|
+ var _this = this;
|
|
|
|
+ BABYLON.SceneLoader.ImportMesh("", GearVRController.MODEL_BASE_URL, GearVRController.MODEL_FILENAME, scene, function (newMeshes) {
|
|
|
|
+ _this._defaultModel = newMeshes[1];
|
|
|
|
+ _this.attachToMesh(_this._defaultModel);
|
|
|
|
+ if (meshLoaded) {
|
|
|
|
+ meshLoaded(_this._defaultModel);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ GearVRController.prototype.handleButtonChange = function (buttonIdx, state, changes) {
|
|
|
|
+ if (buttonIdx < this._buttonIndexToObservableNameMap.length) {
|
|
|
|
+ var observableName = this._buttonIndexToObservableNameMap[buttonIdx];
|
|
|
|
+ // Only emit events for buttons that we know how to map from index to observable
|
|
|
|
+ var observable = this[observableName];
|
|
|
|
+ if (observable) {
|
|
|
|
+ observable.notifyObservers(state);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ GearVRController.MODEL_BASE_URL = 'https://controllers.babylonjs.com/generic/';
|
|
|
|
+ GearVRController.MODEL_FILENAME = 'generic.babylon';
|
|
|
|
+ GearVRController.GAMEPAD_ID_PREFIX = 'Gear VR'; // id is 'Gear VR Controller'
|
|
|
|
+ return GearVRController;
|
|
|
|
+ }(BABYLON.WebVRController));
|
|
|
|
+ BABYLON.GearVRController = GearVRController;
|
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
|
+
|
|
|
|
+//# sourceMappingURL=babylon.gearVRController.js.map
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|