targetCamera.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. import { __decorate } from "../tslib.es6.js";
  2. import { serialize, serializeAsVector3, serializeAsMeshReference } from "../Misc/decorators.js";
  3. import { Camera } from "./camera.js";
  4. import { Quaternion, Matrix, Vector3, Vector2, TmpVectors } from "../Maths/math.vector.js";
  5. import { Epsilon } from "../Maths/math.constants.js";
  6. import { Axis } from "../Maths/math.axis.js";
  7. import { Node } from "../node.js";
  8. Node.AddNodeConstructor("TargetCamera", (name, scene) => {
  9. return () => new TargetCamera(name, Vector3.Zero(), scene);
  10. });
  11. /**
  12. * A target camera takes a mesh or position as a target and continues to look at it while it moves.
  13. * This is the base of the follow, arc rotate cameras and Free camera
  14. * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
  15. */
  16. export class TargetCamera extends Camera {
  17. /**
  18. * Instantiates a target camera that takes a mesh or position as a target and continues to look at it while it moves.
  19. * This is the base of the follow, arc rotate cameras and Free camera
  20. * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
  21. * @param name Defines the name of the camera in the scene
  22. * @param position Defines the start position of the camera in the scene
  23. * @param scene Defines the scene the camera belongs to
  24. * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
  25. */
  26. constructor(name, position, scene, setActiveOnSceneIfNoneActive = true) {
  27. super(name, position, scene, setActiveOnSceneIfNoneActive);
  28. this._tmpUpVector = Vector3.Zero();
  29. this._tmpTargetVector = Vector3.Zero();
  30. /**
  31. * Define the current direction the camera is moving to
  32. */
  33. this.cameraDirection = new Vector3(0, 0, 0);
  34. /**
  35. * Define the current rotation the camera is rotating to
  36. */
  37. this.cameraRotation = new Vector2(0, 0);
  38. /** Gets or sets a boolean indicating that the scaling of the parent hierarchy will not be taken in account by the camera */
  39. this.ignoreParentScaling = false;
  40. /**
  41. * When set, the up vector of the camera will be updated by the rotation of the camera
  42. */
  43. this.updateUpVectorFromRotation = false;
  44. this._tmpQuaternion = new Quaternion();
  45. /**
  46. * Define the current rotation of the camera
  47. */
  48. this.rotation = new Vector3(0, 0, 0);
  49. /**
  50. * Define the current speed of the camera
  51. */
  52. this.speed = 2.0;
  53. /**
  54. * Add constraint to the camera to prevent it to move freely in all directions and
  55. * around all axis.
  56. */
  57. this.noRotationConstraint = false;
  58. /**
  59. * Reverses mouselook direction to 'natural' panning as opposed to traditional direct
  60. * panning
  61. */
  62. this.invertRotation = false;
  63. /**
  64. * Speed multiplier for inverse camera panning
  65. */
  66. this.inverseRotationSpeed = 0.2;
  67. /**
  68. * Define the current target of the camera as an object or a position.
  69. * Please note that locking a target will disable panning.
  70. */
  71. this.lockedTarget = null;
  72. /** @internal */
  73. this._currentTarget = Vector3.Zero();
  74. /** @internal */
  75. this._initialFocalDistance = 1;
  76. /** @internal */
  77. this._viewMatrix = Matrix.Zero();
  78. /** @internal */
  79. this._camMatrix = Matrix.Zero();
  80. /** @internal */
  81. this._cameraTransformMatrix = Matrix.Zero();
  82. /** @internal */
  83. this._cameraRotationMatrix = Matrix.Zero();
  84. /** @internal */
  85. this._referencePoint = new Vector3(0, 0, 1);
  86. /** @internal */
  87. this._transformedReferencePoint = Vector3.Zero();
  88. this._deferredPositionUpdate = new Vector3();
  89. this._deferredRotationQuaternionUpdate = new Quaternion();
  90. this._deferredRotationUpdate = new Vector3();
  91. this._deferredUpdated = false;
  92. this._deferOnly = false;
  93. this._defaultUp = Vector3.Up();
  94. this._cachedRotationZ = 0;
  95. this._cachedQuaternionRotationZ = 0;
  96. }
  97. /**
  98. * Gets the position in front of the camera at a given distance.
  99. * @param distance The distance from the camera we want the position to be
  100. * @returns the position
  101. */
  102. getFrontPosition(distance) {
  103. this.getWorldMatrix();
  104. const direction = this.getTarget().subtract(this.position);
  105. direction.normalize();
  106. direction.scaleInPlace(distance);
  107. return this.globalPosition.add(direction);
  108. }
  109. /** @internal */
  110. _getLockedTargetPosition() {
  111. if (!this.lockedTarget) {
  112. return null;
  113. }
  114. if (this.lockedTarget.absolutePosition) {
  115. const lockedTarget = this.lockedTarget;
  116. const m = lockedTarget.computeWorldMatrix();
  117. // in some cases the absolute position resets externally, but doesn't update since the matrix is cached.
  118. m.getTranslationToRef(lockedTarget.absolutePosition);
  119. }
  120. return this.lockedTarget.absolutePosition || this.lockedTarget;
  121. }
  122. /**
  123. * Store current camera state of the camera (fov, position, rotation, etc..)
  124. * @returns the camera
  125. */
  126. storeState() {
  127. this._storedPosition = this.position.clone();
  128. this._storedRotation = this.rotation.clone();
  129. if (this.rotationQuaternion) {
  130. this._storedRotationQuaternion = this.rotationQuaternion.clone();
  131. }
  132. return super.storeState();
  133. }
  134. /**
  135. * Restored camera state. You must call storeState() first
  136. * @returns whether it was successful or not
  137. * @internal
  138. */
  139. _restoreStateValues() {
  140. if (!super._restoreStateValues()) {
  141. return false;
  142. }
  143. this.position = this._storedPosition.clone();
  144. this.rotation = this._storedRotation.clone();
  145. if (this.rotationQuaternion) {
  146. this.rotationQuaternion = this._storedRotationQuaternion.clone();
  147. }
  148. this.cameraDirection.copyFromFloats(0, 0, 0);
  149. this.cameraRotation.copyFromFloats(0, 0);
  150. return true;
  151. }
  152. /** @internal */
  153. _initCache() {
  154. super._initCache();
  155. this._cache.lockedTarget = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
  156. this._cache.rotation = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
  157. this._cache.rotationQuaternion = new Quaternion(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
  158. }
  159. /**
  160. * @internal
  161. */
  162. _updateCache(ignoreParentClass) {
  163. if (!ignoreParentClass) {
  164. super._updateCache();
  165. }
  166. const lockedTargetPosition = this._getLockedTargetPosition();
  167. if (!lockedTargetPosition) {
  168. this._cache.lockedTarget = null;
  169. }
  170. else {
  171. if (!this._cache.lockedTarget) {
  172. this._cache.lockedTarget = lockedTargetPosition.clone();
  173. }
  174. else {
  175. this._cache.lockedTarget.copyFrom(lockedTargetPosition);
  176. }
  177. }
  178. this._cache.rotation.copyFrom(this.rotation);
  179. if (this.rotationQuaternion) {
  180. this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion);
  181. }
  182. }
  183. // Synchronized
  184. /** @internal */
  185. _isSynchronizedViewMatrix() {
  186. if (!super._isSynchronizedViewMatrix()) {
  187. return false;
  188. }
  189. const lockedTargetPosition = this._getLockedTargetPosition();
  190. return ((this._cache.lockedTarget ? this._cache.lockedTarget.equals(lockedTargetPosition) : !lockedTargetPosition) &&
  191. (this.rotationQuaternion ? this.rotationQuaternion.equals(this._cache.rotationQuaternion) : this._cache.rotation.equals(this.rotation)));
  192. }
  193. // Methods
  194. /** @internal */
  195. _computeLocalCameraSpeed() {
  196. const engine = this.getEngine();
  197. return this.speed * Math.sqrt(engine.getDeltaTime() / (engine.getFps() * 100.0));
  198. }
  199. // Target
  200. /**
  201. * Defines the target the camera should look at.
  202. * @param target Defines the new target as a Vector
  203. */
  204. setTarget(target) {
  205. this.upVector.normalize();
  206. this._initialFocalDistance = target.subtract(this.position).length();
  207. if (this.position.z === target.z) {
  208. this.position.z += Epsilon;
  209. }
  210. this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance);
  211. Matrix.LookAtLHToRef(this.position, target, this._defaultUp, this._camMatrix);
  212. this._camMatrix.invert();
  213. this.rotation.x = Math.atan(this._camMatrix.m[6] / this._camMatrix.m[10]);
  214. const vDir = target.subtract(this.position);
  215. if (vDir.x >= 0.0) {
  216. this.rotation.y = -Math.atan(vDir.z / vDir.x) + Math.PI / 2.0;
  217. }
  218. else {
  219. this.rotation.y = -Math.atan(vDir.z / vDir.x) - Math.PI / 2.0;
  220. }
  221. this.rotation.z = 0;
  222. if (isNaN(this.rotation.x)) {
  223. this.rotation.x = 0;
  224. }
  225. if (isNaN(this.rotation.y)) {
  226. this.rotation.y = 0;
  227. }
  228. if (isNaN(this.rotation.z)) {
  229. this.rotation.z = 0;
  230. }
  231. if (this.rotationQuaternion) {
  232. Quaternion.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion);
  233. }
  234. }
  235. /**
  236. * Defines the target point of the camera.
  237. * The camera looks towards it form the radius distance.
  238. */
  239. get target() {
  240. return this.getTarget();
  241. }
  242. set target(value) {
  243. this.setTarget(value);
  244. }
  245. /**
  246. * Return the current target position of the camera. This value is expressed in local space.
  247. * @returns the target position
  248. */
  249. getTarget() {
  250. return this._currentTarget;
  251. }
  252. /** @internal */
  253. _decideIfNeedsToMove() {
  254. return Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;
  255. }
  256. /** @internal */
  257. _updatePosition() {
  258. if (this.parent) {
  259. this.parent.getWorldMatrix().invertToRef(TmpVectors.Matrix[0]);
  260. Vector3.TransformNormalToRef(this.cameraDirection, TmpVectors.Matrix[0], TmpVectors.Vector3[0]);
  261. this._deferredPositionUpdate.addInPlace(TmpVectors.Vector3[0]);
  262. if (!this._deferOnly) {
  263. this.position.copyFrom(this._deferredPositionUpdate);
  264. }
  265. else {
  266. this._deferredUpdated = true;
  267. }
  268. return;
  269. }
  270. this._deferredPositionUpdate.addInPlace(this.cameraDirection);
  271. if (!this._deferOnly) {
  272. this.position.copyFrom(this._deferredPositionUpdate);
  273. }
  274. else {
  275. this._deferredUpdated = true;
  276. }
  277. }
  278. /** @internal */
  279. _checkInputs() {
  280. const directionMultiplier = this.invertRotation ? -this.inverseRotationSpeed : 1.0;
  281. const needToMove = this._decideIfNeedsToMove();
  282. const needToRotate = this.cameraRotation.x || this.cameraRotation.y;
  283. this._deferredUpdated = false;
  284. this._deferredRotationUpdate.copyFrom(this.rotation);
  285. this._deferredPositionUpdate.copyFrom(this.position);
  286. if (this.rotationQuaternion) {
  287. this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion);
  288. }
  289. // Move
  290. if (needToMove) {
  291. this._updatePosition();
  292. }
  293. // Rotate
  294. if (needToRotate) {
  295. //rotate, if quaternion is set and rotation was used
  296. if (this.rotationQuaternion) {
  297. this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate);
  298. }
  299. this._deferredRotationUpdate.x += this.cameraRotation.x * directionMultiplier;
  300. this._deferredRotationUpdate.y += this.cameraRotation.y * directionMultiplier;
  301. // Apply constraints
  302. if (!this.noRotationConstraint) {
  303. const limit = 1.570796;
  304. if (this._deferredRotationUpdate.x > limit) {
  305. this._deferredRotationUpdate.x = limit;
  306. }
  307. if (this._deferredRotationUpdate.x < -limit) {
  308. this._deferredRotationUpdate.x = -limit;
  309. }
  310. }
  311. if (!this._deferOnly) {
  312. this.rotation.copyFrom(this._deferredRotationUpdate);
  313. }
  314. else {
  315. this._deferredUpdated = true;
  316. }
  317. //rotate, if quaternion is set and rotation was used
  318. if (this.rotationQuaternion) {
  319. const len = this._deferredRotationUpdate.lengthSquared();
  320. if (len) {
  321. Quaternion.RotationYawPitchRollToRef(this._deferredRotationUpdate.y, this._deferredRotationUpdate.x, this._deferredRotationUpdate.z, this._deferredRotationQuaternionUpdate);
  322. if (!this._deferOnly) {
  323. this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate);
  324. }
  325. else {
  326. this._deferredUpdated = true;
  327. }
  328. }
  329. }
  330. }
  331. // Inertia
  332. if (needToMove) {
  333. if (Math.abs(this.cameraDirection.x) < this.speed * Epsilon) {
  334. this.cameraDirection.x = 0;
  335. }
  336. if (Math.abs(this.cameraDirection.y) < this.speed * Epsilon) {
  337. this.cameraDirection.y = 0;
  338. }
  339. if (Math.abs(this.cameraDirection.z) < this.speed * Epsilon) {
  340. this.cameraDirection.z = 0;
  341. }
  342. this.cameraDirection.scaleInPlace(this.inertia);
  343. }
  344. if (needToRotate) {
  345. if (Math.abs(this.cameraRotation.x) < this.speed * Epsilon) {
  346. this.cameraRotation.x = 0;
  347. }
  348. if (Math.abs(this.cameraRotation.y) < this.speed * Epsilon) {
  349. this.cameraRotation.y = 0;
  350. }
  351. this.cameraRotation.scaleInPlace(this.inertia);
  352. }
  353. super._checkInputs();
  354. }
  355. _updateCameraRotationMatrix() {
  356. if (this.rotationQuaternion) {
  357. this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix);
  358. }
  359. else {
  360. Matrix.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this._cameraRotationMatrix);
  361. }
  362. }
  363. /**
  364. * Update the up vector to apply the rotation of the camera (So if you changed the camera rotation.z this will let you update the up vector as well)
  365. * @returns the current camera
  366. */
  367. _rotateUpVectorWithCameraRotationMatrix() {
  368. Vector3.TransformNormalToRef(this._defaultUp, this._cameraRotationMatrix, this.upVector);
  369. return this;
  370. }
  371. /** @internal */
  372. _getViewMatrix() {
  373. if (this.lockedTarget) {
  374. this.setTarget(this._getLockedTargetPosition());
  375. }
  376. // Compute
  377. this._updateCameraRotationMatrix();
  378. // Apply the changed rotation to the upVector
  379. if (this.rotationQuaternion && this._cachedQuaternionRotationZ != this.rotationQuaternion.z) {
  380. this._rotateUpVectorWithCameraRotationMatrix();
  381. this._cachedQuaternionRotationZ = this.rotationQuaternion.z;
  382. }
  383. else if (this._cachedRotationZ !== this.rotation.z) {
  384. this._rotateUpVectorWithCameraRotationMatrix();
  385. this._cachedRotationZ = this.rotation.z;
  386. }
  387. Vector3.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint);
  388. // Computing target and final matrix
  389. this.position.addToRef(this._transformedReferencePoint, this._currentTarget);
  390. if (this.updateUpVectorFromRotation) {
  391. if (this.rotationQuaternion) {
  392. Axis.Y.rotateByQuaternionToRef(this.rotationQuaternion, this.upVector);
  393. }
  394. else {
  395. Quaternion.FromEulerVectorToRef(this.rotation, this._tmpQuaternion);
  396. Axis.Y.rotateByQuaternionToRef(this._tmpQuaternion, this.upVector);
  397. }
  398. }
  399. this._computeViewMatrix(this.position, this._currentTarget, this.upVector);
  400. return this._viewMatrix;
  401. }
  402. _computeViewMatrix(position, target, up) {
  403. if (this.ignoreParentScaling) {
  404. if (this.parent) {
  405. const parentWorldMatrix = this.parent.getWorldMatrix();
  406. Vector3.TransformCoordinatesToRef(position, parentWorldMatrix, this._globalPosition);
  407. Vector3.TransformCoordinatesToRef(target, parentWorldMatrix, this._tmpTargetVector);
  408. Vector3.TransformNormalToRef(up, parentWorldMatrix, this._tmpUpVector);
  409. this._markSyncedWithParent();
  410. }
  411. else {
  412. this._globalPosition.copyFrom(position);
  413. this._tmpTargetVector.copyFrom(target);
  414. this._tmpUpVector.copyFrom(up);
  415. }
  416. if (this.getScene().useRightHandedSystem) {
  417. Matrix.LookAtRHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix);
  418. }
  419. else {
  420. Matrix.LookAtLHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix);
  421. }
  422. return;
  423. }
  424. if (this.getScene().useRightHandedSystem) {
  425. Matrix.LookAtRHToRef(position, target, up, this._viewMatrix);
  426. }
  427. else {
  428. Matrix.LookAtLHToRef(position, target, up, this._viewMatrix);
  429. }
  430. if (this.parent) {
  431. const parentWorldMatrix = this.parent.getWorldMatrix();
  432. this._viewMatrix.invert();
  433. this._viewMatrix.multiplyToRef(parentWorldMatrix, this._viewMatrix);
  434. this._viewMatrix.getTranslationToRef(this._globalPosition);
  435. this._viewMatrix.invert();
  436. this._markSyncedWithParent();
  437. }
  438. else {
  439. this._globalPosition.copyFrom(position);
  440. }
  441. }
  442. /**
  443. * @internal
  444. */
  445. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  446. createRigCamera(name, cameraIndex) {
  447. if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {
  448. const rigCamera = new TargetCamera(name, this.position.clone(), this.getScene());
  449. rigCamera.isRigCamera = true;
  450. rigCamera.rigParent = this;
  451. if (this.cameraRigMode === Camera.RIG_MODE_VR) {
  452. if (!this.rotationQuaternion) {
  453. this.rotationQuaternion = new Quaternion();
  454. }
  455. rigCamera._cameraRigParams = {};
  456. rigCamera.rotationQuaternion = new Quaternion();
  457. }
  458. rigCamera.mode = this.mode;
  459. rigCamera.orthoLeft = this.orthoLeft;
  460. rigCamera.orthoRight = this.orthoRight;
  461. rigCamera.orthoTop = this.orthoTop;
  462. rigCamera.orthoBottom = this.orthoBottom;
  463. return rigCamera;
  464. }
  465. return null;
  466. }
  467. /**
  468. * @internal
  469. */
  470. _updateRigCameras() {
  471. const camLeft = this._rigCameras[0];
  472. const camRight = this._rigCameras[1];
  473. this.computeWorldMatrix();
  474. switch (this.cameraRigMode) {
  475. case Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
  476. case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
  477. case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
  478. case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
  479. case Camera.RIG_MODE_STEREOSCOPIC_INTERLACED: {
  480. //provisionnaly using _cameraRigParams.stereoHalfAngle instead of calculations based on _cameraRigParams.interaxialDistance:
  481. const leftSign = this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? 1 : -1;
  482. const rightSign = this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? -1 : 1;
  483. this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * leftSign, camLeft);
  484. this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * rightSign, camRight);
  485. break;
  486. }
  487. case Camera.RIG_MODE_VR:
  488. if (camLeft.rotationQuaternion) {
  489. camLeft.rotationQuaternion.copyFrom(this.rotationQuaternion);
  490. camRight.rotationQuaternion.copyFrom(this.rotationQuaternion);
  491. }
  492. else {
  493. camLeft.rotation.copyFrom(this.rotation);
  494. camRight.rotation.copyFrom(this.rotation);
  495. }
  496. camLeft.position.copyFrom(this.position);
  497. camRight.position.copyFrom(this.position);
  498. break;
  499. }
  500. super._updateRigCameras();
  501. }
  502. _getRigCamPositionAndTarget(halfSpace, rigCamera) {
  503. const target = this.getTarget();
  504. target.subtractToRef(this.position, TargetCamera._TargetFocalPoint);
  505. TargetCamera._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);
  506. const newFocalTarget = TargetCamera._TargetFocalPoint.addInPlace(this.position);
  507. Matrix.TranslationToRef(-newFocalTarget.x, -newFocalTarget.y, -newFocalTarget.z, TargetCamera._TargetTransformMatrix);
  508. TargetCamera._TargetTransformMatrix.multiplyToRef(Matrix.RotationAxis(rigCamera.upVector, halfSpace), TargetCamera._RigCamTransformMatrix);
  509. Matrix.TranslationToRef(newFocalTarget.x, newFocalTarget.y, newFocalTarget.z, TargetCamera._TargetTransformMatrix);
  510. TargetCamera._RigCamTransformMatrix.multiplyToRef(TargetCamera._TargetTransformMatrix, TargetCamera._RigCamTransformMatrix);
  511. Vector3.TransformCoordinatesToRef(this.position, TargetCamera._RigCamTransformMatrix, rigCamera.position);
  512. rigCamera.setTarget(newFocalTarget);
  513. }
  514. /**
  515. * Gets the current object class name.
  516. * @returns the class name
  517. */
  518. getClassName() {
  519. return "TargetCamera";
  520. }
  521. }
  522. TargetCamera._RigCamTransformMatrix = new Matrix();
  523. TargetCamera._TargetTransformMatrix = new Matrix();
  524. TargetCamera._TargetFocalPoint = new Vector3();
  525. __decorate([
  526. serializeAsVector3()
  527. ], TargetCamera.prototype, "rotation", void 0);
  528. __decorate([
  529. serialize()
  530. ], TargetCamera.prototype, "speed", void 0);
  531. __decorate([
  532. serializeAsMeshReference("lockedTargetId")
  533. ], TargetCamera.prototype, "lockedTarget", void 0);
  534. //# sourceMappingURL=targetCamera.js.map