Add widening/shortening vector dimensions
This commit is contained in:
@@ -52,6 +52,14 @@ pub const Vector4Int_x8 = struct {
|
||||
|
||||
// --- CONVERSION ----------------------------------------------------------
|
||||
|
||||
pub inline fn dropW(self: Vector4Int_x8) vm.Vector3Int_x8 {
|
||||
return .{ .x = self.x, .y = self.y, .z = self.z };
|
||||
}
|
||||
|
||||
pub inline fn dropZW(self: Vector4Int_x8) vm.Vector2Int_x8 {
|
||||
return .{ .x = self.x, .y = self.y };
|
||||
}
|
||||
|
||||
pub inline fn asArrayOfVectors(self: Vector4Int_x8) [8]vm.Vector4 {
|
||||
const vector: @Vector(32, i32) = self.x ++ self.y ++ self.z ++ self.w;
|
||||
return @bitCast(@as([32]i32, @shuffle(i32, vector, undefined, [_]i32{
|
||||
|
||||
Reference in New Issue
Block a user