This commit is contained in:
2024-10-16 23:18:47 +02:00
parent a60fe82272
commit 221be140bf
6 changed files with 174 additions and 72 deletions

View File

@@ -69,6 +69,16 @@ point_inside_aabb :: (aabb: AABB, point: Vector3) -> bool {
&& point.z >= aabb.min.z && point.z <= aabb.max.z;
}
aabb_add :: (aabb: *AABB, point: Vector3) {
aabb.min.x = min(point.x, aabb.min.x);
aabb.min.y = min(point.y, aabb.min.y);
aabb.min.z = min(point.z, aabb.min.z);
aabb.max.x = max(point.x, aabb.max.x);
aabb.max.y = max(point.y, aabb.max.y);
aabb.max.z = max(point.z, aabb.max.z);
}
operator == :: inline (a: Vector3i, b: Vector3i) -> bool {
return a.x == b.x && a.y == b.y && a.z == b.z;
}
@@ -366,4 +376,5 @@ ease_in_out_sine :: (x: float) -> float {
}
#import "PCG";
#import "Math";
#import "Math";
#load "frustum.jai";