math: Add Ray type and ray methods to test runner

This commit is contained in:
Joel D. Schüller 2023-10-03 14:42:28 +02:00 committed by Stephen Gutekanst
parent 9399cda75c
commit 24b9a415b3
2 changed files with 6 additions and 0 deletions

View file

@ -44,6 +44,7 @@ const testing = std.testing;
const vec = @import("vec.zig"); const vec = @import("vec.zig");
const mat = @import("mat.zig"); const mat = @import("mat.zig");
const q = @import("quat.zig"); const q = @import("quat.zig");
const ray = @import("ray.zig");
/// Standard f32 precision types /// Standard f32 precision types
pub const Vec2 = vec.Vec(2, f32); pub const Vec2 = vec.Vec(2, f32);
@ -93,6 +94,10 @@ pub const quatd = Quatd.init;
pub const mat3x3d = Mat3x3d.init; pub const mat3x3d = Mat3x3d.init;
pub const mat4x4d = Mat4x4d.init; pub const mat4x4d = Mat4x4d.init;
// Rays in 3 dimensional space
pub const Ray = ray.Ray;
pub const RayHit = ray.RayHit;
test { test {
testing.refAllDeclsRecursive(@This()); testing.refAllDeclsRecursive(@This());
} }

View file

@ -206,6 +206,7 @@ test {
testing.refAllDeclsRecursive(Expect(mach.math.Vec2h)); testing.refAllDeclsRecursive(Expect(mach.math.Vec2h));
testing.refAllDeclsRecursive(Expect(mach.math.Vec3)); testing.refAllDeclsRecursive(Expect(mach.math.Vec3));
testing.refAllDeclsRecursive(Expect(mach.math.Vec4d)); testing.refAllDeclsRecursive(Expect(mach.math.Vec4d));
testing.refAllDeclsRecursive(Expect(mach.math.Ray));
// testing.refAllDeclsRecursive(Expect(mach.math.Mat4h)); // testing.refAllDeclsRecursive(Expect(mach.math.Mat4h));
// testing.refAllDeclsRecursive(Expect(mach.math.Mat4)); // testing.refAllDeclsRecursive(Expect(mach.math.Mat4));
// testing.refAllDeclsRecursive(Expect(mach.math.Mat4d)); // testing.refAllDeclsRecursive(Expect(mach.math.Mat4d));