Vector int-float conversion methods

This commit is contained in:
2026-01-06 21:14:12 +01:00
parent 7963813034
commit 34f0b1fb89
13 changed files with 53 additions and 5 deletions

View File

@@ -36,6 +36,10 @@ pub const Vector4 = extern struct {
// --- CONVERSION ----------------------------------------------------------
pub inline fn asInt(self: Vector4) vm.Vector4Int {
return .{ .x = @intFromFloat(self.x), .y = @intFromFloat(self.y), .z = @intFromFloat(self.z), .w = @intFromFloat(self.w) };
}
pub inline fn asArray(self: Vector4) Array {
return @bitCast(self);
}