|
@@ -90,13 +90,16 @@ var BABYLON = BABYLON || {};
|
|
this._cache.maxZ = this.maxZ;
|
|
this._cache.maxZ = this.maxZ;
|
|
|
|
|
|
this._cache.fov = this.fov;
|
|
this._cache.fov = this.fov;
|
|
|
|
+
|
|
|
|
+ var engine = this._scene.getEngine();
|
|
|
|
+
|
|
this._cache.aspectRatio = engine.getAspectRatio();
|
|
this._cache.aspectRatio = engine.getAspectRatio();
|
|
|
|
|
|
this._cache.orthoLeft = this.orthoLeft;
|
|
this._cache.orthoLeft = this.orthoLeft;
|
|
this._cache.orthoRight = this.orthoRight;
|
|
this._cache.orthoRight = this.orthoRight;
|
|
this._cache.orthoBottom = this.orthoBottom;
|
|
this._cache.orthoBottom = this.orthoBottom;
|
|
this._cache.orthoTop = this.orthoTop;
|
|
this._cache.orthoTop = this.orthoTop;
|
|
- this._cache.renderWidth = engine.getRenderWidth()
|
|
|
|
|
|
+ this._cache.renderWidth = engine.getRenderWidth();
|
|
this._cache.renderHeight = engine.getRenderHeight();
|
|
this._cache.renderHeight = engine.getRenderHeight();
|
|
};
|
|
};
|
|
|
|
|
|
@@ -121,6 +124,9 @@ var BABYLON = BABYLON || {};
|
|
if (!r)
|
|
if (!r)
|
|
return false;
|
|
return false;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ var engine = this._scene.getEngine();
|
|
|
|
+
|
|
if (this.mode === BABYLON.Camera.PERSPECTIVE_CAMERA) {
|
|
if (this.mode === BABYLON.Camera.PERSPECTIVE_CAMERA) {
|
|
r = this._cache.fov === this.fov
|
|
r = this._cache.fov === this.fov
|
|
&& this._cache.aspectRatio === engine.getAspectRatio();
|
|
&& this._cache.aspectRatio === engine.getAspectRatio();
|
|
@@ -152,11 +158,11 @@ var BABYLON = BABYLON || {};
|
|
};
|
|
};
|
|
|
|
|
|
BABYLON.Camera.prototype.getWorldMatrix = function () {
|
|
BABYLON.Camera.prototype.getWorldMatrix = function () {
|
|
- var viewMatrix = this.getViewMatrix();
|
|
|
|
-
|
|
|
|
if (!this._worldMatrix) {
|
|
if (!this._worldMatrix) {
|
|
this._worldMatrix = BABYLON.Matrix.Identity();
|
|
this._worldMatrix = BABYLON.Matrix.Identity();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ var viewMatrix = this.getViewMatrix();
|
|
|
|
|
|
viewMatrix.invertToRef(this._worldMatrix);
|
|
viewMatrix.invertToRef(this._worldMatrix);
|
|
|
|
|
|
@@ -175,6 +181,10 @@ var BABYLON = BABYLON || {};
|
|
|| (!this.hasNewParent() && this.parent.isSynchronized())) {
|
|
|| (!this.hasNewParent() && this.parent.isSynchronized())) {
|
|
return this._computedViewMatrix;
|
|
return this._computedViewMatrix;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (!this._worldMatrix) {
|
|
|
|
+ this._worldMatrix = BABYLON.Matrix.Identity();
|
|
|
|
+ }
|
|
|
|
|
|
this._computedViewMatrix.invertToRef(this._worldMatrix);
|
|
this._computedViewMatrix.invertToRef(this._worldMatrix);
|
|
|
|
|