Actually fix formatting (for real this time)

This commit is contained in:
codemob-dev 2025-07-28 17:29:29 -04:00
parent fe23c5eb17
commit 5c2e165ba2

View File

@ -63,7 +63,7 @@ pub const collision = struct {
pub fn extent(self: AABB) Vec3d { pub fn extent(self: AABB) Vec3d {
return (self.max - self.min)*@as(Vec3d, @splat(0.5)); return (self.max - self.min)*@as(Vec3d, @splat(0.5));
} }
pub fn intersects(self: AABB, other: AABB) bool { pub fn intersects(self: AABB, other: AABB) bool {
var i: usize = 0; var i: usize = 0;
while(i < 3) : (i += 1) { while(i < 3) : (i += 1) {
@ -95,7 +95,7 @@ pub const collision = struct {
if(blockAABB.intersects(entityAABB)) { if(blockAABB.intersects(entityAABB)) {
const dotMin = vec.dot(directionVector, blockAABB.min); const dotMin = vec.dot(directionVector, blockAABB.min);
const dotMax = vec.dot(directionVector, blockAABB.max); const dotMax = vec.dot(directionVector, blockAABB.max);
const distance = @min(dotMin, dotMax); const distance = @min(dotMin, dotMax);
if(distance < minDistance) { if(distance < minDistance) {
@ -105,7 +105,6 @@ pub const collision = struct {
resultBox = resultBox.?.join(blockAABB); resultBox = resultBox.?.join(blockAABB);
} }
} }
} }
} }
return .{.box = resultBox orelse return null, .dist = minDistance}; return .{.box = resultBox orelse return null, .dist = minDistance};
@ -343,7 +342,7 @@ pub const collision = struct {
return true; return true;
} }
} }
return false; return false;
} }