소스 검색

Merge pull request #3026 from jbousquie/SPS.improvement

SPS particle pivot : added missing pivot computation on immutable SPS
David Catuhe 7 년 전
부모
커밋
7d8f628244
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      src/Particles/babylon.solidParticleSystem.ts

+ 8 - 0
src/Particles/babylon.solidParticleSystem.ts

@@ -399,6 +399,10 @@
                     this._vertex.x *= this._copy.scaling.x;
                     this._vertex.y *= this._copy.scaling.y;
                     this._vertex.z *= this._copy.scaling.z;
+
+                    this._vertex.x += this._copy.pivot.x;
+                    this._vertex.y += this._copy.pivot.y;
+                    this._vertex.z += this._copy.pivot.z;
     
                     Vector3.TransformCoordinatesToRef(this._vertex, this._rotMatrix, this._rotated);
                     positions.push(this._copy.position.x + this._rotated.x, this._copy.position.y + this._rotated.y, this._copy.position.z + this._rotated.z);
@@ -568,6 +572,10 @@
                     this._vertex.x *= this._copy.scaling.x;
                     this._vertex.y *= this._copy.scaling.y;
                     this._vertex.z *= this._copy.scaling.z;
+
+                    this._vertex.x += this._copy.pivot.x;
+                    this._vertex.y += this._copy.pivot.y;
+                    this._vertex.z += this._copy.pivot.z;
     
                     Vector3.TransformCoordinatesToRef(this._vertex, this._rotMatrix, this._rotated);