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

Physics colliders do not work properly for isometric (diamond) maps #32

Open
adrien-bon opened this issue Sep 8, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@adrien-bon
Copy link
Owner

When using an isometric maps, physics colliders :

  • have their origin at the correct position (fixed in commit 839110b)
  • but they don"t have the proper shape

It's because Tiled does not handle objects for isometric maps the way it does for orthogonal / hexagonal maps.
On isometric maps, objects are "projected" on the isometric plane: we need to do the same when spawning colliders.

Example in Tiled:
image

What it does under Bevy / bevy_ecs_tiled:
image

One possible fix would be to change the shape and convert all vertexes coordinates using the utils::from_isometric_coords_to_bevy function.
Like, for instance, if we have a rectangle, spawn a polyline instead and update its vertexes.

@adrien-bon adrien-bon added the bug Something isn't working label Sep 8, 2024
@adrien-bon adrien-bon changed the title Physics colliders do not work properly for isometric (diamong) maps Physics colliders do not work properly for isometric (diamond) maps Sep 8, 2024
@darkautism
Copy link

Giving each brick a collider would cause the game to be very laggy, so I created a collider that encompassed the entire map, but the game actually gave me the rectangle

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants