David Catuhe 7 年之前
父节点
当前提交
fa0f4ce1bb
共有 3 个文件被更改,包括 8 次插入4 次删除
  1. 1 1
      src/Cameras/babylon.camera.ts
  2. 6 2
      src/Cameras/babylon.targetCamera.ts
  3. 1 1
      src/Materials/babylon.shaderMaterial.ts

+ 1 - 1
src/Cameras/babylon.camera.ts

@@ -780,7 +780,7 @@
             if (!origin) {
                 origin = this.position;
             }
-            var forward = new Vector3(0, 0, 1);
+            var forward = this._scene.useRightHandedSystem ? new Vector3(0, 0, -1) : new Vector3(0, 0, 1);
             var forwardWorld = Vector3.TransformNormal(forward, transform);
 
             var direction = Vector3.Normalize(forwardWorld);

+ 6 - 2
src/Cameras/babylon.targetCamera.ts

@@ -350,6 +350,7 @@
         }
 
         private _cachedRotationZ = 0;
+        private _cachedQuaternionRotationZ = 0;
         /** @hidden */
         public _getViewMatrix(): Matrix {
             if (this.lockedTarget) {
@@ -359,8 +360,11 @@
             // Compute
             this._updateCameraRotationMatrix();
 
-            // Apply the changed rotation to the upVector.
-            if (this._cachedRotationZ != this.rotation.z) {
+            // Apply the changed rotation to the upVector
+            if (this.rotationQuaternion && this._cachedQuaternionRotationZ != this.rotationQuaternion.z) {
+                this._rotateUpVectorWithCameraRotationMatrix();
+                this._cachedQuaternionRotationZ = this.rotationQuaternion.z;
+            } else if (this._cachedRotationZ != this.rotation.z) {
                 this._rotateUpVectorWithCameraRotationMatrix();
                 this._cachedRotationZ = this.rotation.z;
             }

+ 1 - 1
src/Materials/babylon.shaderMaterial.ts

@@ -111,7 +111,7 @@
          * @returns a boolean specifying if alpha blending is needed
          */
         public needAlphaBlending(): boolean {
-            return (this.alpha < 1.0);
+            return (this.alpha < 1.0) || this._options.needAlphaBlending;
         }
 
         /**