Add GlobalTransform to map colliders.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nolan Darilek 2022-06-07 09:14:11 -05:00
parent a1edab98f9
commit a019e8b5c7

View File

@ -242,6 +242,7 @@ fn spawn_colliders<D: 'static + Clone + Default + Send + Sync>(
.spawn() .spawn()
.insert(Collider::cuboid(0.5, 0.5)) .insert(Collider::cuboid(0.5, 0.5))
.insert(Transform::from_xyz(x as f32 + 0.5, y as f32 + 0.5, 0.)) .insert(Transform::from_xyz(x as f32 + 0.5, y as f32 + 0.5, 0.))
.insert(GlobalTransform::default())
.insert(MapObstruction) .insert(MapObstruction)
.id(); .id();
if tile.blocks_visibility() { if tile.blocks_visibility() {
@ -326,6 +327,7 @@ fn spawn_colliders<D: 'static + Clone + Default + Send + Sync>(
.spawn() .spawn()
.insert(Collider::cuboid(half_width, half_height)) .insert(Collider::cuboid(half_width, half_height))
.insert(Transform::from_xyz(center.x(), center.y(), 0.)) .insert(Transform::from_xyz(center.x(), center.y(), 0.))
.insert(GlobalTransform::default())
.insert(MapObstruction) .insert(MapObstruction)
.id(); .id();
if map.at(x as usize, y as usize).blocks_visibility() { if map.at(x as usize, y as usize).blocks_visibility() {
@ -428,6 +430,7 @@ fn spawn_portal_colliders<D: 'static + Clone + Default + Send + Sync>(
commands commands
.entity(portal_entity) .entity(portal_entity)
.insert(Transform::from_xyz(position.x(), position.y(), 0.)) .insert(Transform::from_xyz(position.x(), position.y(), 0.))
.insert(GlobalTransform::default())
.insert(Collider::cuboid(0.5, 0.5)) .insert(Collider::cuboid(0.5, 0.5))
.insert(Sensor(true)) .insert(Sensor(true))
.insert(ActiveEvents::COLLISION_EVENTS); .insert(ActiveEvents::COLLISION_EVENTS);