浏览代码

Use readonly up vector instead of creating it all the time

michalzr 4 年之前
父节点
当前提交
95dea0ad7e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      materialsLibrary/src/sky/skyMaterial.ts

+ 1 - 1
materialsLibrary/src/sky/skyMaterial.ts

@@ -308,7 +308,7 @@ export class SkyMaterial extends PushMaterial {
             this.sunPosition.y = this.distance * Math.sin(phi) * Math.sin(theta);
             this.sunPosition.z = this.distance * Math.sin(phi) * Math.cos(theta);
 
-            Quaternion.FromUnitVectorsToRef(Vector3.Up(), this.up, this._skyOrientation);
+            Quaternion.FromUnitVectorsToRef(Vector3.UpReadOnly, this.up, this._skyOrientation);
             this.sunPosition.rotateByQuaternionToRef(this._skyOrientation, this.sunPosition);
         }