mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Address MR 2460 comments.
- Switch from point query to AABB query to take into account block thickness.
This commit is contained in:
parent
5e6363dbcc
commit
96ffae4387
@ -1290,7 +1290,11 @@ fn box_voxel_collision<'a, T: BaseVol<Vox = Block> + ReadVol>(
|
||||
min: pos + Vec3::new(-radius, -radius, z_range.start),
|
||||
max: pos + Vec3::new(radius, radius, z_range.end),
|
||||
};
|
||||
if !player_aabb.contains_point(block_pos.as_() + Vec3::broadcast(0.5)) {
|
||||
let block_approx = Aabb {
|
||||
min: block_pos.as_(),
|
||||
max: block_pos.as_() + Vec3::new(1.0, 1.0, Block::MAX_HEIGHT),
|
||||
};
|
||||
if !player_aabb.collides_with_aabb(block_approx) {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user