|
@@ -1,4 +1,4 @@
|
|
|
-var __extends = (this && this.__extends) || function (d, b) {
|
|
|
+var __extends = this.__extends || function (d, b) {
|
|
|
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
|
function __() { this.constructor = d; }
|
|
|
__.prototype = b.prototype;
|
|
@@ -45,18 +45,17 @@ var BABYLON;
|
|
|
this._newPosition = BABYLON.Vector3.Zero();
|
|
|
this._onCollisionPositionChange = function (collisionId, newPosition, collidedMesh) {
|
|
|
if (collidedMesh === void 0) { collidedMesh = null; }
|
|
|
- if (collisionId != null || collisionId != undefined)
|
|
|
+ if (_this.getScene().workerCollisions) {
|
|
|
newPosition.multiplyInPlace(_this._collider.radius);
|
|
|
- if (newPosition.equalsWithEpsilon(_this.position)) {
|
|
|
+ }
|
|
|
+ if (!newPosition.equalsWithEpsilon(_this.position)) {
|
|
|
_this.position.copyFrom(_this._previousPosition);
|
|
|
_this.alpha = _this._previousAlpha;
|
|
|
_this.beta = _this._previousBeta;
|
|
|
_this.radius = _this._previousRadius;
|
|
|
}
|
|
|
- else {
|
|
|
- if (_this.onCollide && collidedMesh) {
|
|
|
- _this.onCollide(collidedMesh);
|
|
|
- }
|
|
|
+ if (collidedMesh && _this.onCollide) {
|
|
|
+ _this.onCollide(collidedMesh);
|
|
|
}
|
|
|
_this._collisionTriggered = false;
|
|
|
};
|
|
@@ -91,11 +90,7 @@ var BABYLON;
|
|
|
ArcRotateCamera.prototype._isSynchronizedViewMatrix = function () {
|
|
|
if (!_super.prototype._isSynchronizedViewMatrix.call(this))
|
|
|
return false;
|
|
|
- return this._cache.target.equals(this._getTargetPosition())
|
|
|
- && this._cache.alpha === this.alpha
|
|
|
- && this._cache.beta === this.beta
|
|
|
- && this._cache.radius === this.radius
|
|
|
- && this._cache.targetScreenOffset.equals(this.targetScreenOffset);
|
|
|
+ return this._cache.target.equals(this._getTargetPosition()) && this._cache.alpha === this.alpha && this._cache.beta === this.beta && this._cache.radius === this.radius && this._cache.targetScreenOffset.equals(this.targetScreenOffset);
|
|
|
};
|
|
|
// Methods
|
|
|
ArcRotateCamera.prototype.attachControl = function (element, noPreventDefault) {
|
|
@@ -190,10 +185,7 @@ var BABYLON;
|
|
|
}
|
|
|
};
|
|
|
this._onKeyDown = function (evt) {
|
|
|
- if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysRight.indexOf(evt.keyCode) !== -1) {
|
|
|
+ if (_this.keysUp.indexOf(evt.keyCode) !== -1 || _this.keysDown.indexOf(evt.keyCode) !== -1 || _this.keysLeft.indexOf(evt.keyCode) !== -1 || _this.keysRight.indexOf(evt.keyCode) !== -1) {
|
|
|
var index = _this._keys.indexOf(evt.keyCode);
|
|
|
if (index === -1) {
|
|
|
_this._keys.push(evt.keyCode);
|
|
@@ -206,10 +198,7 @@ var BABYLON;
|
|
|
}
|
|
|
};
|
|
|
this._onKeyUp = function (evt) {
|
|
|
- if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysRight.indexOf(evt.keyCode) !== -1) {
|
|
|
+ if (_this.keysUp.indexOf(evt.keyCode) !== -1 || _this.keysDown.indexOf(evt.keyCode) !== -1 || _this.keysLeft.indexOf(evt.keyCode) !== -1 || _this.keysRight.indexOf(evt.keyCode) !== -1) {
|
|
|
var index = _this._keys.indexOf(evt.keyCode);
|
|
|
if (index >= 0) {
|
|
|
_this._keys.splice(index, 1);
|
|
@@ -300,7 +289,6 @@ var BABYLON;
|
|
|
if (this._collisionTriggered) {
|
|
|
return;
|
|
|
}
|
|
|
- // Keyboard
|
|
|
for (var index = 0; index < this._keys.length; index++) {
|
|
|
var keyCode = this._keys[index];
|
|
|
if (this.keysLeft.indexOf(keyCode) !== -1) {
|
|
@@ -433,4 +421,3 @@ var BABYLON;
|
|
|
})(BABYLON.Camera);
|
|
|
BABYLON.ArcRotateCamera = ArcRotateCamera;
|
|
|
})(BABYLON || (BABYLON = {}));
|
|
|
-//# sourceMappingURL=babylon.arcRotateCamera.js.map
|