Jump to content

Phaser isometric plugin: rotate phyisics body?


PhasedEvolution
 Share

Recommended Posts

I am working with Phaser and its isometric plugin. I have a sprite with this physical body ( as shown in blue).

iso_sprite

As you can see the physics body doesn't match the actually visible body. I think I would need to rotate the body in order to properly match the visible body. Because the sprite is an iso sprite but its position is not "isometric". I have no idea on how to do that and if there is another solution. Can someone help me?

 

Link to comment
Share on other sites

@lewster32 oh ok... If I were to make that sprite as a normal sprite which would have a rect phyisics body that could expand on the non-isometric axis... Could that be bad for in-game collisions and that type of stuff?

 

EDIT : well as I wrote on the other thread I will invest on some code of my own to add the functionalites I require. Nevertheless your iso plugin is great

Link to comment
Share on other sites

2 hours ago, lewster32 said:

Unfortunately I don't think you can feasibly combine standard rectangular physics with the isometric physics; they simply work on different axes. To do this kind of collision detection and separation requires a major re-think of the physics involved.

I think I understand you. So those type of games that have an isometric perspective but don't get limited by isometric axes (might be the case of diablo 2 for example) are stuctured in a different way. I mean it is not entirely isometric if I could say it like this...?

Link to comment
Share on other sites

The deciding factor is in whether you use AABB or not. AABB (which is what Phaser Arcade and by extension the isometric plug-in uses) cannot represent physics bodies off-axis; they are by definition axis-aligned. You could extend this with circles, spheres and (though slightly harder if using Z axis collision) upright cylinders or capsules - as Phaser has done with the circle bodies - pretty easily, as they are able to function in an aligned environment, having no intrinsic alignment themselves. It'd be impractical to extend this to arbitrary shapes however, as at that point you're basically creating a non-aligned physics system, with all of the extra complexity that brings. I imagine Diablo 2 will have very likely used an AABB + circles collision system (AABB for most map geometry like walls etc, circles for mobs and smaller objects with indistinct 'faces') which would be very fast and do all of the jobs that needed to be done in that game.

Link to comment
Share on other sites

20 minutes ago, lewster32 said:

The deciding factor is in whether you use AABB or not. AABB (which is what Phaser Arcade and by extension the isometric plug-in uses) cannot represent physics bodies off-axis; they are by definition axis-aligned. You could extend this with circles, spheres and (though slightly harder if using Z axis collision) upright cylinders or capsules - as Phaser has done with the circle bodies - pretty easily, as they are able to function in an aligned environment, having no intrinsic alignment themselves. It'd be impractical to extend this to arbitrary shapes however, as at that point you're basically creating a non-aligned physics system, with all of the extra complexity that brings. I imagine Diablo 2 will have very likely used an AABB + circles collision system (AABB for most map geometry like walls etc, circles for mobs and smaller objects with indistinct 'faces') which would be very fast and do all of the jobs that needed to be done in that game.

I see. Thank you very much for the clarification

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...