PhasedEvolution Posted October 5, 2016 Share Posted October 5, 2016 down vote favorite I am working with Phaser and its isometric plugin. I have a sprite with this physical body ( as shown in blue). 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 More sharing options...
douglas Posted October 5, 2016 Share Posted October 5, 2016 my little knowledge on the question is at this point how to display a sprite http://codepen.io/featuresmega/pen/WGQEaw and how to display a map http://codepen.io/featuresmega/pen/ZpbZOB perhaps this one too multiple sprites : https://jsfiddle.net/johndo101/tyx0xv7u/ but to rotate a sprite i don't know Link to comment Share on other sites More sharing options...
PhasedEvolution Posted October 5, 2016 Author Share Posted October 5, 2016 @douglas Well I have already been through that but didn't see anything that could help me ... but thank you douglas 1 Link to comment Share on other sites More sharing options...
lewster32 Posted October 5, 2016 Share Posted October 5, 2016 Sorry, but this is not possible with AABB physics bodies - they must remain aligned to the isometric axes. Link to comment Share on other sites More sharing options...
PhasedEvolution Posted October 5, 2016 Author Share Posted October 5, 2016 @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 More sharing options...
lewster32 Posted October 5, 2016 Share Posted October 5, 2016 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. Link to comment Share on other sites More sharing options...
PhasedEvolution Posted October 5, 2016 Author Share Posted October 5, 2016 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 More sharing options...
lewster32 Posted October 5, 2016 Share Posted October 5, 2016 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. PhasedEvolution 1 Link to comment Share on other sites More sharing options...
PhasedEvolution Posted October 5, 2016 Author Share Posted October 5, 2016 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 More sharing options...
Recommended Posts