babylon.vrDeviceOrientationCamera.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. var __extends = (this && this.__extends) || function (d, b) {
  2. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  3. function __() { this.constructor = d; }
  4. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5. };
  6. var BABYLON;
  7. (function (BABYLON) {
  8. var VRDeviceOrientationFreeCamera = (function (_super) {
  9. __extends(VRDeviceOrientationFreeCamera, _super);
  10. function VRDeviceOrientationFreeCamera(name, position, scene, compensateDistortion, vrCameraMetrics) {
  11. if (compensateDistortion === void 0) { compensateDistortion = true; }
  12. if (vrCameraMetrics === void 0) { vrCameraMetrics = BABYLON.VRCameraMetrics.GetDefault(); }
  13. _super.call(this, name, position, scene);
  14. vrCameraMetrics.compensateDistortion = compensateDistortion;
  15. this.setCameraRigMode(BABYLON.Camera.RIG_MODE_VR, { vrCameraMetrics: vrCameraMetrics });
  16. }
  17. VRDeviceOrientationFreeCamera.prototype.getTypeName = function () {
  18. return "VRDeviceOrientationFreeCamera";
  19. };
  20. return VRDeviceOrientationFreeCamera;
  21. }(BABYLON.DeviceOrientationCamera));
  22. BABYLON.VRDeviceOrientationFreeCamera = VRDeviceOrientationFreeCamera;
  23. var VRDeviceOrientationArcRotateCamera = (function (_super) {
  24. __extends(VRDeviceOrientationArcRotateCamera, _super);
  25. function VRDeviceOrientationArcRotateCamera(name, alpha, beta, radius, target, scene, compensateDistortion) {
  26. if (compensateDistortion === void 0) { compensateDistortion = true; }
  27. _super.call(this, name, alpha, beta, radius, target, scene);
  28. var metrics = BABYLON.VRCameraMetrics.GetDefault();
  29. metrics.compensateDistortion = compensateDistortion;
  30. this.setCameraRigMode(BABYLON.Camera.RIG_MODE_VR, { vrCameraMetrics: metrics });
  31. this.inputs.addVRDeviceOrientation();
  32. }
  33. VRDeviceOrientationArcRotateCamera.prototype.getTypeName = function () {
  34. return "VRDeviceOrientationArcRotateCamera";
  35. };
  36. return VRDeviceOrientationArcRotateCamera;
  37. }(BABYLON.ArcRotateCamera));
  38. BABYLON.VRDeviceOrientationArcRotateCamera = VRDeviceOrientationArcRotateCamera;
  39. })(BABYLON || (BABYLON = {}));