Vector int-float conversion methods
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user