Przeglądaj źródła

Merge pull request #1263 from jbousquie/fix.SPSbillboard

fix SPS wrong normals on billboard
David Catuhe 9 lat temu
rodzic
commit
273a3531d5
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      src/Particles/babylon.solidParticleSystem.ts

+ 3 - 3
src/Particles/babylon.solidParticleSystem.ts

@@ -516,13 +516,13 @@
                 this._rotMatrix.invertToRef(this._invertMatrix);
                 this._camera._currentTarget.subtractToRef(this._camera.globalPosition, this._camDir);
                 Vector3.TransformCoordinatesToRef(this._camDir, this._invertMatrix, this._cam_axisZ);
+                this._cam_axisZ.normalize();
 
                 // set two orthogonal vectors (_cam_axisX and and _cam_axisY) to the rotated camDir axis (_cam_axisZ)
                 Vector3.CrossToRef(this._cam_axisZ, this._axisX, this._cam_axisY);
-                Vector3.CrossToRef(this._cam_axisZ, this._cam_axisY, this._cam_axisX);
+                Vector3.CrossToRef(this._cam_axisY, this._cam_axisZ, this._cam_axisX);
                 this._cam_axisY.normalize();
-                this._cam_axisX.normalize();
-                this._cam_axisZ.normalize();
+                this._cam_axisX.normalize();             
             }
 
             Matrix.IdentityToRef(this._rotMatrix);