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

This Issue is about the rectangle form debug in p2 physic. #258

Closed
spiritabsolute opened this issue Jun 12, 2017 · 3 comments
Closed

This Issue is about the rectangle form debug in p2 physic. #258

spiritabsolute opened this issue Jun 12, 2017 · 3 comments
Labels

Comments

@spiritabsolute
Copy link

spiritabsolute commented Jun 12, 2017

This Issue is about the rectangle form debug in p2 physic.

If I rotate the rectangle form, then in debug mode the boundary of the collider does not rotate, it is displayed incorrectly.

  • A bug in the API:
    • Phaser version(s): 2.8.0
    • Live example: http://phaser.io/sandbox/MKAwWVbo/play
    • What should happen: The rectangle should be displayed at an angle.
    • What happens instead: The rectangle is displayed without inclination angle.
game.physics.startSystem(Phaser.Physics.P2JS);
    var sprite = game.add.sprite(100, 100);
    game.physics.p2.enable(sprite, true);
    sprite.body.setRectangle(20, 90, -30, -30, `game.math.degToRad(80));
@samme
Copy link
Collaborator

samme commented Jun 14, 2017

Can you try copying https://samme.github.io/phaser-examples-mirror/p2%20physics/body%20debug.html and rotate the block?

@spiritabsolute
Copy link
Author

sprite.body.rotateLeft(2); work fine, but i need .setRectangle rotate. I have static body. I want to turn the box through .setRectangle and see the result of the turn.

samid737 added a commit to samid737/phaser-ce that referenced this issue Jul 11, 2017
assigned rotation value to physics body angle.
samid737 added a commit to samid737/phaser-ce that referenced this issue Jul 12, 2017
Possible fix/hack by always first applying the the rotation and then move on to debugBody.draw(). In debug.draw() the angle is not used anymore however.. tested with rectangle, circle, line, polygon and capsule..
samid737 added a commit to samid737/phaser-ce that referenced this issue Jul 12, 2017
Possible fix/hack by always first applying the the rotation and then move on to debugBody.draw(). In debug.draw() the angle is not used anymore however.. tested with rectangle, circle, line, polygon and capsule..
samme added a commit that referenced this issue Sep 22, 2017
Fixes #366

Revert "Fix for #258 part 2"

This reverts commit cfc7f95.

Revert "minor adjustment"

This reverts commit 4e62048.

Revert "Fix for #258 part 2"

This reverts commit cfc7f95.
@samme samme added the bug label Dec 19, 2017
@samme
Copy link
Collaborator

samme commented Dec 19, 2017

Assume fixed by b1db282.

@samme samme closed this as completed Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants