body.checkCollision.none, body.checkCollision.any do not prevent collisions #2661

Closed
samme opened this Issue Jul 23, 2016 · 4 comments

Projects

None yet

2 participants

@samme
samme commented Jul 23, 2016

http://phaser.io/sandbox/CDdkxjgV

Set the checkCollision properties to control which directions collision is processed for this Body. …

checkCollision includes any and none, but setting any = false or none = true doesn't prevent collisions.

This issue is about

  • A bug in the API (or)
  • An error in the documentation
@photonstorm
Owner

To be honest I can't think of a reason why checkCollision.none is even in there. I'm thinking it may be a copy-paste left over from the Body.touching object. If you want to disable collision on a Body you should use Body.enable = false. I'm going to remove it, thanks for spotting it.

@photonstorm photonstorm added a commit that referenced this issue Jul 23, 2016
@photonstorm The property `checkCollision.none` has been removed from the ArcadePh…
…ysics.Body class. It was never used internally, so lead to confusion about its use. To disable a body, use `body.enable = false` (thanks @samme #2661)
46c20ab
@photonstorm
Owner

Thanks for submitting this issue. We have fixed this, and the fix has been pushed to the dev branch.

@photonstorm
Owner

Actually I'm changing my mind :) I can think of reasons while you'd want a Body updating but not checking for collision.

@photonstorm photonstorm reopened this Jul 23, 2016
@photonstorm photonstorm added a commit that referenced this issue Jul 23, 2016
@photonstorm The property `checkCollision.none` in the ArcadePhysics.Body class wa…
…s available, but never used internally. It is now used and checked by the `separate` method. By setting `checkCollision.none = true` you can disable all collision and overlap checks on a Body, but still retain its motion updates (thanks @samme #2661)
6947057
@photonstorm
Owner

There - much better. You can now set it, and it'll be checked inside of separate and skip the check if either of them has it set to true.

@photonstorm photonstorm added a commit that referenced this issue Jul 23, 2016
@photonstorm The Emitter.makeParticles `collide` argument didn't work, as a result…
… of #2661, but is now properly respected thanks to that change (thanks @samme #2662)
7527297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment