Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Particle emitter death zones are positioned in global space #6371

Closed
vforsh opened this issue Jan 28, 2023 · 2 comments · May be fixed by jonesrussell/nishman#6
Closed

Particle emitter death zones are positioned in global space #6371

vforsh opened this issue Jan 28, 2023 · 2 comments · May be fixed by jonesrussell/nishman#6
Assignees

Comments

@vforsh
Copy link
Contributor

vforsh commented Jan 28, 2023

Version

Phaser 3.60 beta 18

Description

Emitter death zones are positioned in global space which is unexpected.

Was it an intentional change? It is quite confusing IMO because of the 2 reasons:

  • in prior versions death zones were positioned in emitter local coordinates space
  • emit zones & gravity wells are positioned in local space

Example Test Code

https://codesandbox.io/s/particles-death-zone-qpmvhn

let particles = this.add.particles(300, 300, "flares", {
	lifespan: 1500,
	alpha: { start: 0, end: 1 },
	scale: 0.2,
	quantity: 20,
	emitting: false,
})

// emit zone position is in local emitter space (as expected)
let emitZone = new Phaser.Geom.Circle(0, 0, 200)
particles.addEmitZone({
	source: emitZone,
	type: "random",
	quantity: -1,
})

// deathZone position is in global space
let deathZone = new Phaser.Geom.Circle(0, 0, 100)
// you need to manually calculate the offset to put it in the right place
// let deathZone = new Phaser.Geom.Circle(particles.x, particles.y, 100)
particles.addDeathZone({
	source: deathZone,
	type: "onEnter",
})

particles.start(1500)
@claudeduguay
Copy link

I am having this issue as well. Clearly coordinates should be in emitter-space or this does not work using existing geometries. I am trying to get this to work by passing the center point but this is clearly an unacceptable hack.

Any chance this will be addressed?

@zekeatchan zekeatchan self-assigned this Jun 14, 2024
@zekeatchan
Copy link
Collaborator

This issue has been resolved.

The death zones collisions have been corrected to check local coordinates instead of global coordinates to ensure it aligns with the local emitter space.

The changes will be reflected in the next update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants