Correctly size zone colliders so they connect with neighbors.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a4fda4a41c
commit
c980854663
|
@ -215,7 +215,10 @@ fn spawn_colliders<D: 'static + Clone + Default + Send + Sync>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for room in &map.rooms {
|
for room in &map.rooms {
|
||||||
let shape = Collider::cuboid((room.width() / 2) as f32, (room.height() / 2) as f32);
|
let shape = Collider::cuboid(
|
||||||
|
(room.width() / 2) as f32 + 0.5,
|
||||||
|
(room.height() / 2) as f32 + 0.5,
|
||||||
|
);
|
||||||
let position =
|
let position =
|
||||||
Isometry2::new(Vector2::new(room.center().x(), room.center().y()), 0.);
|
Isometry2::new(Vector2::new(room.center().x(), room.center().y()), 0.);
|
||||||
let aabb = shape.raw.compute_aabb(&position);
|
let aabb = shape.raw.compute_aabb(&position);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user