David catuhe 9 tahun lalu
induk
melakukan
270f5bb9eb
2 mengubah file dengan 762 tambahan dan 760 penghapusan
  1. 756 756
      dist/preview release/babylon.d.ts
  2. 6 4
      src/Particles/babylon.solidParticleSystem.ts

File diff ditekan karena terlalu besar
+ 756 - 756
dist/preview release/babylon.d.ts


+ 6 - 4
src/Particles/babylon.solidParticleSystem.ts

@@ -46,6 +46,7 @@ module BABYLON {
         private _particle: SolidParticle;
         private _fakeCamPos: Vector3 = Vector3.Zero();
         private _rotMatrix: Matrix = new Matrix();
+        private _invertedMatrix: Matrix = new Matrix();
         private _rotated: Vector3 = Vector3.Zero();
         private _quaternion: Quaternion = new Quaternion();
         private _vertex: Vector3 = Vector3.Zero();
@@ -358,10 +359,11 @@ module BABYLON {
                 this._roll = this.mesh.rotation.z;
                 this._quaternionRotationYPR();
                 this._quaternionToRotationMatrix();
-                Vector3.TransformCoordinatesToRef(this._camera.globalPosition, this._rotMatrix, this._fakeCamPos);
+                this._rotMatrix.invertToRef(this._invertedMatrix);
+                Vector3.TransformCoordinatesToRef(this._camera.globalPosition, this._invertedMatrix, this._fakeCamPos);
 
                 // set two orthogonal vectors (_cam_axisX and and _cam_axisY) to the cam-mesh axis (_cam_axisZ)
-                (this._fakeCamPos).subtractToRef(this.mesh.position, this._cam_axisZ);
+                (this.mesh.position).subtractToRef(this._fakeCamPos, this._cam_axisZ);
                 Vector3.CrossToRef(this._cam_axisZ, this._axisX, this._cam_axisY);
                 Vector3.CrossToRef(this._cam_axisZ, this._cam_axisY, this._cam_axisX);
                 this._cam_axisY.normalize();
@@ -435,7 +437,7 @@ module BABYLON {
                     this._positions32[idx + 2] = this._particle.position.z + this._cam_axisX.z * this._rotated.x + this._cam_axisY.z * this._rotated.y + this._cam_axisZ.z * this._rotated.z;
 
                     // normals : if the particles can't be morphed then just rotate the normals
-                    if (!this._computeParticleVertex && !this.billboard) {
+                    if (!this._computeParticleVertex) {
                         this._normal.x = this._fixedNormal32[idx];
                         this._normal.y = this._fixedNormal32[idx + 1];
                         this._normal.z = this._fixedNormal32[idx + 2];
@@ -476,7 +478,7 @@ module BABYLON {
                 }
                 this.mesh.updateVerticesData(VertexBuffer.PositionKind, this._positions32, false, false);
                 if (!this.mesh.areNormalsFrozen) {
-                    if (this._computeParticleVertex || this.billboard) {
+                    if (this._computeParticleVertex) {
                         // recompute the normals only if the particles can be morphed, update then the normal reference array
                         VertexData.ComputeNormals(this._positions32, this._indices, this._normals32);
                         for (var i = 0; i < this._normals32.length; i++) {