babylon.camera.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  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. __.prototype = b.prototype;
  5. d.prototype = new __();
  6. };
  7. var BABYLON;
  8. (function (BABYLON) {
  9. var VRCameraMetrics = (function () {
  10. function VRCameraMetrics() {
  11. this.compensateDistorsion = true;
  12. }
  13. Object.defineProperty(VRCameraMetrics.prototype, "aspectRatio", {
  14. get: function () {
  15. return this.hResolution / (2 * this.vResolution);
  16. },
  17. enumerable: true,
  18. configurable: true
  19. });
  20. Object.defineProperty(VRCameraMetrics.prototype, "aspectRatioFov", {
  21. get: function () {
  22. return (2 * Math.atan((this.postProcessScaleFactor * this.vScreenSize) / (2 * this.eyeToScreenDistance)));
  23. },
  24. enumerable: true,
  25. configurable: true
  26. });
  27. Object.defineProperty(VRCameraMetrics.prototype, "leftHMatrix", {
  28. get: function () {
  29. var meters = (this.hScreenSize / 4) - (this.lensSeparationDistance / 2);
  30. var h = (4 * meters) / this.hScreenSize;
  31. return BABYLON.Matrix.Translation(h, 0, 0);
  32. },
  33. enumerable: true,
  34. configurable: true
  35. });
  36. Object.defineProperty(VRCameraMetrics.prototype, "rightHMatrix", {
  37. get: function () {
  38. var meters = (this.hScreenSize / 4) - (this.lensSeparationDistance / 2);
  39. var h = (4 * meters) / this.hScreenSize;
  40. return BABYLON.Matrix.Translation(-h, 0, 0);
  41. },
  42. enumerable: true,
  43. configurable: true
  44. });
  45. Object.defineProperty(VRCameraMetrics.prototype, "leftPreViewMatrix", {
  46. get: function () {
  47. return BABYLON.Matrix.Translation(0.5 * this.interpupillaryDistance, 0, 0);
  48. },
  49. enumerable: true,
  50. configurable: true
  51. });
  52. Object.defineProperty(VRCameraMetrics.prototype, "rightPreViewMatrix", {
  53. get: function () {
  54. return BABYLON.Matrix.Translation(-0.5 * this.interpupillaryDistance, 0, 0);
  55. },
  56. enumerable: true,
  57. configurable: true
  58. });
  59. VRCameraMetrics.GetDefault = function () {
  60. var result = new VRCameraMetrics();
  61. result.hResolution = 1280;
  62. result.vResolution = 800;
  63. result.hScreenSize = 0.149759993;
  64. result.vScreenSize = 0.0935999975;
  65. result.vScreenCenter = 0.0467999987,
  66. result.eyeToScreenDistance = 0.0410000011;
  67. result.lensSeparationDistance = 0.0635000020;
  68. result.interpupillaryDistance = 0.0640000030;
  69. result.distortionK = [1.0, 0.219999999, 0.239999995, 0.0];
  70. result.chromaAbCorrection = [0.995999992, -0.00400000019, 1.01400006, 0.0];
  71. result.postProcessScaleFactor = 1.714605507808412;
  72. result.lensCenterOffset = 0.151976421;
  73. return result;
  74. };
  75. return VRCameraMetrics;
  76. })();
  77. BABYLON.VRCameraMetrics = VRCameraMetrics;
  78. var Camera = (function (_super) {
  79. __extends(Camera, _super);
  80. function Camera(name, position, scene) {
  81. _super.call(this, name, scene);
  82. this.position = position;
  83. // Members
  84. this.upVector = BABYLON.Vector3.Up();
  85. this.orthoLeft = null;
  86. this.orthoRight = null;
  87. this.orthoBottom = null;
  88. this.orthoTop = null;
  89. this.fov = 0.8;
  90. this.minZ = 1.0;
  91. this.maxZ = 10000.0;
  92. this.inertia = 0.9;
  93. this.mode = Camera.PERSPECTIVE_CAMERA;
  94. this.isIntermediate = false;
  95. this.viewport = new BABYLON.Viewport(0, 0, 1.0, 1.0);
  96. this.layerMask = 0x0FFFFFFF;
  97. this.fovMode = Camera.FOVMODE_VERTICAL_FIXED;
  98. // Subcamera members
  99. this.subCameras = new Array();
  100. this._subCameraMode = Camera.SUB_CAMERA_MODE_NONE;
  101. // Cache
  102. this._computedViewMatrix = BABYLON.Matrix.Identity();
  103. this._projectionMatrix = new BABYLON.Matrix();
  104. this._postProcesses = new Array();
  105. this._postProcessesTakenIndices = [];
  106. this._activeMeshes = new BABYLON.SmartArray(256);
  107. this._globalPosition = BABYLON.Vector3.Zero();
  108. scene.addCamera(this);
  109. if (!scene.activeCamera) {
  110. scene.activeCamera = this;
  111. }
  112. }
  113. Object.defineProperty(Camera, "PERSPECTIVE_CAMERA", {
  114. get: function () {
  115. return Camera._PERSPECTIVE_CAMERA;
  116. },
  117. enumerable: true,
  118. configurable: true
  119. });
  120. Object.defineProperty(Camera, "ORTHOGRAPHIC_CAMERA", {
  121. get: function () {
  122. return Camera._ORTHOGRAPHIC_CAMERA;
  123. },
  124. enumerable: true,
  125. configurable: true
  126. });
  127. Object.defineProperty(Camera, "FOVMODE_VERTICAL_FIXED", {
  128. get: function () {
  129. return Camera._FOVMODE_VERTICAL_FIXED;
  130. },
  131. enumerable: true,
  132. configurable: true
  133. });
  134. Object.defineProperty(Camera, "FOVMODE_HORIZONTAL_FIXED", {
  135. get: function () {
  136. return Camera._FOVMODE_HORIZONTAL_FIXED;
  137. },
  138. enumerable: true,
  139. configurable: true
  140. });
  141. Object.defineProperty(Camera, "SUB_CAMERA_MODE_NONE", {
  142. get: function () {
  143. return Camera._SUB_CAMERA_MODE_NONE;
  144. },
  145. enumerable: true,
  146. configurable: true
  147. });
  148. Object.defineProperty(Camera, "SUB_CAMERA_MODE_ANAGLYPH", {
  149. get: function () {
  150. return Camera._SUB_CAMERA_MODE_ANAGLYPH;
  151. },
  152. enumerable: true,
  153. configurable: true
  154. });
  155. Object.defineProperty(Camera, "SUB_CAMERA_MODE_CROSSEDSIDEBYSIDE_STEREOSCOPIC", {
  156. get: function () {
  157. return Camera._SUB_CAMERA_MODE_CROSSEDSIDEBYSIDE_STEREOSCOPIC;
  158. },
  159. enumerable: true,
  160. configurable: true
  161. });
  162. Object.defineProperty(Camera, "SUB_CAMERA_MODE_OVERUNDER_STEREOSCOPIC", {
  163. get: function () {
  164. return Camera._SUB_CAMERA_MODE_OVERUNDER_STEREOSCOPIC;
  165. },
  166. enumerable: true,
  167. configurable: true
  168. });
  169. Object.defineProperty(Camera, "SUB_CAMERA_MODE_VR", {
  170. get: function () {
  171. return Camera._SUB_CAMERA_MODE_VR;
  172. },
  173. enumerable: true,
  174. configurable: true
  175. });
  176. Object.defineProperty(Camera, "SUB_CAMERAID_A", {
  177. get: function () {
  178. return Camera._SUB_CAMERAID_A;
  179. },
  180. enumerable: true,
  181. configurable: true
  182. });
  183. Object.defineProperty(Camera, "SUB_CAMERAID_B", {
  184. get: function () {
  185. return Camera._SUB_CAMERAID_B;
  186. },
  187. enumerable: true,
  188. configurable: true
  189. });
  190. Object.defineProperty(Camera.prototype, "globalPosition", {
  191. get: function () {
  192. return this._globalPosition;
  193. },
  194. enumerable: true,
  195. configurable: true
  196. });
  197. Camera.prototype.getActiveMeshes = function () {
  198. return this._activeMeshes;
  199. };
  200. Camera.prototype.isActiveMesh = function (mesh) {
  201. return (this._activeMeshes.indexOf(mesh) !== -1);
  202. };
  203. //Cache
  204. Camera.prototype._initCache = function () {
  205. _super.prototype._initCache.call(this);
  206. this._cache.position = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
  207. this._cache.upVector = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
  208. this._cache.mode = undefined;
  209. this._cache.minZ = undefined;
  210. this._cache.maxZ = undefined;
  211. this._cache.fov = undefined;
  212. this._cache.aspectRatio = undefined;
  213. this._cache.orthoLeft = undefined;
  214. this._cache.orthoRight = undefined;
  215. this._cache.orthoBottom = undefined;
  216. this._cache.orthoTop = undefined;
  217. this._cache.renderWidth = undefined;
  218. this._cache.renderHeight = undefined;
  219. };
  220. Camera.prototype._updateCache = function (ignoreParentClass) {
  221. if (!ignoreParentClass) {
  222. _super.prototype._updateCache.call(this);
  223. }
  224. var engine = this.getEngine();
  225. this._cache.position.copyFrom(this.position);
  226. this._cache.upVector.copyFrom(this.upVector);
  227. this._cache.mode = this.mode;
  228. this._cache.minZ = this.minZ;
  229. this._cache.maxZ = this.maxZ;
  230. this._cache.fov = this.fov;
  231. this._cache.aspectRatio = engine.getAspectRatio(this);
  232. this._cache.orthoLeft = this.orthoLeft;
  233. this._cache.orthoRight = this.orthoRight;
  234. this._cache.orthoBottom = this.orthoBottom;
  235. this._cache.orthoTop = this.orthoTop;
  236. this._cache.renderWidth = engine.getRenderWidth();
  237. this._cache.renderHeight = engine.getRenderHeight();
  238. };
  239. Camera.prototype._updateFromScene = function () {
  240. this.updateCache();
  241. this._update();
  242. };
  243. // Synchronized
  244. Camera.prototype._isSynchronized = function () {
  245. return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();
  246. };
  247. Camera.prototype._isSynchronizedViewMatrix = function () {
  248. if (!_super.prototype._isSynchronized.call(this))
  249. return false;
  250. return this._cache.position.equals(this.position)
  251. && this._cache.upVector.equals(this.upVector)
  252. && this.isSynchronizedWithParent();
  253. };
  254. Camera.prototype._isSynchronizedProjectionMatrix = function () {
  255. var check = this._cache.mode === this.mode
  256. && this._cache.minZ === this.minZ
  257. && this._cache.maxZ === this.maxZ;
  258. if (!check) {
  259. return false;
  260. }
  261. var engine = this.getEngine();
  262. if (this.mode === Camera.PERSPECTIVE_CAMERA) {
  263. check = this._cache.fov === this.fov
  264. && this._cache.aspectRatio === engine.getAspectRatio(this);
  265. }
  266. else {
  267. check = this._cache.orthoLeft === this.orthoLeft
  268. && this._cache.orthoRight === this.orthoRight
  269. && this._cache.orthoBottom === this.orthoBottom
  270. && this._cache.orthoTop === this.orthoTop
  271. && this._cache.renderWidth === engine.getRenderWidth()
  272. && this._cache.renderHeight === engine.getRenderHeight();
  273. }
  274. return check;
  275. };
  276. // Controls
  277. Camera.prototype.attachControl = function (element) {
  278. };
  279. Camera.prototype.detachControl = function (element) {
  280. };
  281. Camera.prototype._update = function () {
  282. this._checkInputs();
  283. if (this._subCameraMode !== Camera.SUB_CAMERA_MODE_NONE) {
  284. this._updateSubCameras();
  285. }
  286. };
  287. Camera.prototype._checkInputs = function () {
  288. };
  289. Camera.prototype.attachPostProcess = function (postProcess, insertAt) {
  290. if (insertAt === void 0) { insertAt = null; }
  291. if (!postProcess.isReusable() && this._postProcesses.indexOf(postProcess) > -1) {
  292. BABYLON.Tools.Error("You're trying to reuse a post process not defined as reusable.");
  293. return 0;
  294. }
  295. if (insertAt == null || insertAt < 0) {
  296. this._postProcesses.push(postProcess);
  297. this._postProcessesTakenIndices.push(this._postProcesses.length - 1);
  298. return this._postProcesses.length - 1;
  299. }
  300. var add = 0;
  301. if (this._postProcesses[insertAt]) {
  302. var start = this._postProcesses.length - 1;
  303. for (var i = start; i >= insertAt + 1; --i) {
  304. this._postProcesses[i + 1] = this._postProcesses[i];
  305. }
  306. add = 1;
  307. }
  308. for (i = 0; i < this._postProcessesTakenIndices.length; ++i) {
  309. if (this._postProcessesTakenIndices[i] < insertAt) {
  310. continue;
  311. }
  312. start = this._postProcessesTakenIndices.length - 1;
  313. for (var j = start; j >= i; --j) {
  314. this._postProcessesTakenIndices[j + 1] = this._postProcessesTakenIndices[j] + add;
  315. }
  316. this._postProcessesTakenIndices[i] = insertAt;
  317. break;
  318. }
  319. if (!add && this._postProcessesTakenIndices.indexOf(insertAt) == -1) {
  320. this._postProcessesTakenIndices.push(insertAt);
  321. }
  322. var result = insertAt + add;
  323. this._postProcesses[result] = postProcess;
  324. return result;
  325. };
  326. Camera.prototype.detachPostProcess = function (postProcess, atIndices) {
  327. if (atIndices === void 0) { atIndices = null; }
  328. var result = [];
  329. if (!atIndices) {
  330. var length = this._postProcesses.length;
  331. for (var i = 0; i < length; i++) {
  332. if (this._postProcesses[i] !== postProcess) {
  333. continue;
  334. }
  335. delete this._postProcesses[i];
  336. var index = this._postProcessesTakenIndices.indexOf(i);
  337. this._postProcessesTakenIndices.splice(index, 1);
  338. }
  339. }
  340. else {
  341. atIndices = (atIndices instanceof Array) ? atIndices : [atIndices];
  342. for (i = 0; i < atIndices.length; i++) {
  343. var foundPostProcess = this._postProcesses[atIndices[i]];
  344. if (foundPostProcess !== postProcess) {
  345. result.push(i);
  346. continue;
  347. }
  348. delete this._postProcesses[atIndices[i]];
  349. index = this._postProcessesTakenIndices.indexOf(atIndices[i]);
  350. this._postProcessesTakenIndices.splice(index, 1);
  351. }
  352. }
  353. return result;
  354. };
  355. Camera.prototype.getWorldMatrix = function () {
  356. if (!this._worldMatrix) {
  357. this._worldMatrix = BABYLON.Matrix.Identity();
  358. }
  359. var viewMatrix = this.getViewMatrix();
  360. viewMatrix.invertToRef(this._worldMatrix);
  361. return this._worldMatrix;
  362. };
  363. Camera.prototype._getViewMatrix = function () {
  364. return BABYLON.Matrix.Identity();
  365. };
  366. Camera.prototype.getViewMatrix = function (force) {
  367. this._computedViewMatrix = this._computeViewMatrix(force);
  368. if (!force && this._isSynchronizedViewMatrix()) {
  369. return this._computedViewMatrix;
  370. }
  371. if (!this.parent || !this.parent.getWorldMatrix) {
  372. this._globalPosition.copyFrom(this.position);
  373. }
  374. else {
  375. if (!this._worldMatrix) {
  376. this._worldMatrix = BABYLON.Matrix.Identity();
  377. }
  378. this._computedViewMatrix.invertToRef(this._worldMatrix);
  379. this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._computedViewMatrix);
  380. this._globalPosition.copyFromFloats(this._computedViewMatrix.m[12], this._computedViewMatrix.m[13], this._computedViewMatrix.m[14]);
  381. this._computedViewMatrix.invert();
  382. this._markSyncedWithParent();
  383. }
  384. this._currentRenderId = this.getScene().getRenderId();
  385. return this._computedViewMatrix;
  386. };
  387. Camera.prototype._computeViewMatrix = function (force) {
  388. if (!force && this._isSynchronizedViewMatrix()) {
  389. return this._computedViewMatrix;
  390. }
  391. this._computedViewMatrix = this._getViewMatrix();
  392. this._currentRenderId = this.getScene().getRenderId();
  393. return this._computedViewMatrix;
  394. };
  395. Camera.prototype.getProjectionMatrix = function (force) {
  396. if (!force && this._isSynchronizedProjectionMatrix()) {
  397. return this._projectionMatrix;
  398. }
  399. var engine = this.getEngine();
  400. if (this.mode === Camera.PERSPECTIVE_CAMERA) {
  401. if (this.minZ <= 0) {
  402. this.minZ = 0.1;
  403. }
  404. BABYLON.Matrix.PerspectiveFovLHToRef(this.fov, engine.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode);
  405. return this._projectionMatrix;
  406. }
  407. var halfWidth = engine.getRenderWidth() / 2.0;
  408. var halfHeight = engine.getRenderHeight() / 2.0;
  409. BABYLON.Matrix.OrthoOffCenterLHToRef(this.orthoLeft || -halfWidth, this.orthoRight || halfWidth, this.orthoBottom || -halfHeight, this.orthoTop || halfHeight, this.minZ, this.maxZ, this._projectionMatrix);
  410. return this._projectionMatrix;
  411. };
  412. Camera.prototype.dispose = function () {
  413. // Remove from scene
  414. this.getScene().removeCamera(this);
  415. while (this.subCameras.length > 0) {
  416. this.subCameras.pop().dispose();
  417. }
  418. // Postprocesses
  419. for (var i = 0; i < this._postProcessesTakenIndices.length; ++i) {
  420. this._postProcesses[this._postProcessesTakenIndices[i]].dispose(this);
  421. }
  422. };
  423. // ---- 3D cameras section ----
  424. Camera.prototype.setSubCameraMode = function (mode, halfSpace, metrics) {
  425. if (halfSpace === void 0) { halfSpace = 0; }
  426. while (this.subCameras.length > 0) {
  427. this.subCameras.pop().dispose();
  428. }
  429. this._subCameraMode = mode;
  430. this._subCamHalfSpace = BABYLON.Tools.ToRadians(halfSpace);
  431. var camA = this.getSubCamera(this.name + "_A", true);
  432. var camB = this.getSubCamera(this.name + "_B", false);
  433. var postProcessA;
  434. var postProcessB;
  435. switch (this._subCameraMode) {
  436. case Camera.SUB_CAMERA_MODE_ANAGLYPH:
  437. postProcessA = new BABYLON.PassPostProcess(this.name + "_leftTexture", 1.0, camA);
  438. camA.isIntermediate = true;
  439. postProcessB = new BABYLON.AnaglyphPostProcess(this.name + "_anaglyph", 1.0, camB);
  440. postProcessB.onApply = function (effect) {
  441. effect.setTextureFromPostProcess("leftSampler", postProcessA);
  442. };
  443. break;
  444. case Camera.SUB_CAMERA_MODE_CROSSEDSIDEBYSIDE_STEREOSCOPIC:
  445. case Camera.SUB_CAMERA_MODE_OVERUNDER_STEREOSCOPIC:
  446. var isStereoscopicHoriz = this._subCameraMode === Camera.SUB_CAMERA_MODE_CROSSEDSIDEBYSIDE_STEREOSCOPIC;
  447. postProcessA = new BABYLON.PassPostProcess("passthru", 1.0, camA);
  448. camA.isIntermediate = true;
  449. postProcessB = new BABYLON.StereoscopicInterlacePostProcess("st_interlace", camB, postProcessA, isStereoscopicHoriz);
  450. break;
  451. case Camera.SUB_CAMERA_MODE_VR:
  452. metrics = metrics || VRCameraMetrics.GetDefault();
  453. camA._vrMetrics = metrics;
  454. camA.viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0);
  455. camA._vrWorkMatrix = new BABYLON.Matrix();
  456. camA._vrHMatrix = metrics.leftHMatrix;
  457. camA._vrPreViewMatrix = metrics.leftPreViewMatrix;
  458. camA.getProjectionMatrix = camA._getVRProjectionMatrix;
  459. if (metrics.compensateDistorsion) {
  460. postProcessA = new BABYLON.VRDistortionCorrectionPostProcess("Distortion Compensation Left", camA, false, metrics);
  461. }
  462. camB._vrMetrics = camA._vrMetrics;
  463. camB.viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0);
  464. camB._vrWorkMatrix = new BABYLON.Matrix();
  465. camB._vrHMatrix = metrics.rightHMatrix;
  466. camB._vrPreViewMatrix = metrics.rightPreViewMatrix;
  467. camB.getProjectionMatrix = camB._getVRProjectionMatrix;
  468. if (metrics.compensateDistorsion) {
  469. postProcessB = new BABYLON.VRDistortionCorrectionPostProcess("Distortion Compensation Right", camB, true, metrics);
  470. }
  471. }
  472. if (this._subCameraMode !== Camera.SUB_CAMERA_MODE_NONE) {
  473. this.subCameras.push(camA);
  474. this.subCameras.push(camB);
  475. }
  476. this._update();
  477. };
  478. Camera.prototype._getVRProjectionMatrix = function () {
  479. BABYLON.Matrix.PerspectiveFovLHToRef(this._vrMetrics.aspectRatioFov, this._vrMetrics.aspectRatio, this.minZ, this.maxZ, this._vrWorkMatrix);
  480. this._vrWorkMatrix.multiplyToRef(this._vrHMatrix, this._projectionMatrix);
  481. return this._projectionMatrix;
  482. };
  483. Camera.prototype.setSubCamHalfSpace = function (halfSpace) {
  484. this._subCamHalfSpace = BABYLON.Tools.ToRadians(halfSpace);
  485. };
  486. /**
  487. * May needs to be overridden by children so sub has required properties to be copied
  488. */
  489. Camera.prototype.getSubCamera = function (name, isA) {
  490. return null;
  491. };
  492. /**
  493. * May needs to be overridden by children
  494. */
  495. Camera.prototype._updateSubCameras = function () {
  496. var camA = this.subCameras[Camera.SUB_CAMERAID_A];
  497. var camB = this.subCameras[Camera.SUB_CAMERAID_B];
  498. camA.minZ = camB.minZ = this.minZ;
  499. camA.maxZ = camB.maxZ = this.maxZ;
  500. camA.fov = camB.fov = this.fov;
  501. // only update viewport, when ANAGLYPH
  502. if (this._subCameraMode === Camera.SUB_CAMERA_MODE_ANAGLYPH) {
  503. camA.viewport = camB.viewport = this.viewport;
  504. }
  505. };
  506. // Statics
  507. Camera._PERSPECTIVE_CAMERA = 0;
  508. Camera._ORTHOGRAPHIC_CAMERA = 1;
  509. Camera._FOVMODE_VERTICAL_FIXED = 0;
  510. Camera._FOVMODE_HORIZONTAL_FIXED = 1;
  511. Camera._SUB_CAMERA_MODE_NONE = 0;
  512. Camera._SUB_CAMERA_MODE_ANAGLYPH = 1;
  513. Camera._SUB_CAMERA_MODE_CROSSEDSIDEBYSIDE_STEREOSCOPIC = 2;
  514. Camera._SUB_CAMERA_MODE_OVERUNDER_STEREOSCOPIC = 3;
  515. Camera._SUB_CAMERA_MODE_VR = 4;
  516. Camera._SUB_CAMERAID_A = 0;
  517. Camera._SUB_CAMERAID_B = 1;
  518. return Camera;
  519. })(BABYLON.Node);
  520. BABYLON.Camera = Camera;
  521. })(BABYLON || (BABYLON = {}));
  522. //# sourceMappingURL=babylon.camera.js.map