Correctly calcuate area AABBs.
This commit is contained in:
parent
ade155fcb4
commit
fef392a8cc
|
@ -332,9 +332,11 @@ fn spawn_colliders(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for room in &map.rooms {
|
for room in &map.rooms {
|
||||||
let shape =
|
let shape = ColliderShape::cuboid(
|
||||||
ColliderShape::cuboid((room.width() / 2) as f32, (room.height() / 2) as f32);
|
(room.width() / 2) as f32 + 0.5,
|
||||||
let position = Vec2::new(room.center().x(), room.center().y()).into();
|
(room.height() / 2) as f32 + 0.5,
|
||||||
|
);
|
||||||
|
let position = Vec2::new(room.center().x() + 0.5, room.center().y() + 0.5).into();
|
||||||
commands
|
commands
|
||||||
.spawn_bundle(ColliderBundle {
|
.spawn_bundle(ColliderBundle {
|
||||||
collider_type: ColliderType::Sensor,
|
collider_type: ColliderType::Sensor,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user