mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 11:17:05 -04:00
Actually fix formatting (for real this time)
This commit is contained in:
parent
fe23c5eb17
commit
5c2e165ba2
@ -63,7 +63,7 @@ pub const collision = struct {
|
||||
pub fn extent(self: AABB) Vec3d {
|
||||
return (self.max - self.min)*@as(Vec3d, @splat(0.5));
|
||||
}
|
||||
|
||||
|
||||
pub fn intersects(self: AABB, other: AABB) bool {
|
||||
var i: usize = 0;
|
||||
while(i < 3) : (i += 1) {
|
||||
@ -95,7 +95,7 @@ pub const collision = struct {
|
||||
if(blockAABB.intersects(entityAABB)) {
|
||||
const dotMin = vec.dot(directionVector, blockAABB.min);
|
||||
const dotMax = vec.dot(directionVector, blockAABB.max);
|
||||
|
||||
|
||||
const distance = @min(dotMin, dotMax);
|
||||
|
||||
if(distance < minDistance) {
|
||||
@ -105,7 +105,6 @@ pub const collision = struct {
|
||||
resultBox = resultBox.?.join(blockAABB);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return .{.box = resultBox orelse return null, .dist = minDistance};
|
||||
@ -343,7 +342,7 @@ pub const collision = struct {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user