mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 12:43:26 +00:00
No need to multiply the camMatrix for every particle. Once is enough.
This commit is contained in:
parent
b25337b4e8
commit
8815205900
1 changed files with 3 additions and 6 deletions
|
@ -75,8 +75,9 @@ var ParticleEmitterWebGLRenderer = function (renderer, emitter, camera, parentMa
|
|||
|
||||
camera.addToRenderList(emitter);
|
||||
|
||||
var scrollFactorX = emitter.scrollFactorX;
|
||||
var scrollFactorY = emitter.scrollFactorY;
|
||||
camMatrix.copyFrom(camera.matrix);
|
||||
|
||||
camMatrix.multiplyWithOffset(managerMatrix, -camera.scrollX * emitter.scrollFactorX, -camera.scrollY * emitter.scrollFactorY);
|
||||
|
||||
renderer.setBlendMode(emitter.blendMode);
|
||||
|
||||
|
@ -102,10 +103,6 @@ var ParticleEmitterWebGLRenderer = function (renderer, emitter, camera, parentMa
|
|||
|
||||
particleMatrix.applyITRS(particle.x, particle.y, particle.rotation, particle.scaleX, particle.scaleY);
|
||||
|
||||
camMatrix.copyFrom(camera.matrix);
|
||||
|
||||
camMatrix.multiplyWithOffset(managerMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY);
|
||||
|
||||
// Undo the camera scroll
|
||||
particleMatrix.e = particle.x;
|
||||
particleMatrix.f = particle.y;
|
||||
|
|
Loading…
Reference in a new issue