public F32Vec2(F32 x, F32 y) { RawX = x.Raw; RawY = y.Raw; }
public static F32Vec2 NormalizeFastest(F32Vec2 a) { F32 ooLen = F32.FromRaw(Fixed32.RSqrtFastest(Fixed32.Mul(a.RawX, a.RawX) + Fixed32.Mul(a.RawY, a.RawY))); return(ooLen * a); }
public static F32Vec2 Clamp(F32Vec2 a, F32 min, F32 max) { return(new F32Vec2( Fixed32.Clamp(a.RawX, min.Raw, max.Raw), Fixed32.Clamp(a.RawY, min.Raw, max.Raw))); }
public F64(F32 v) { Raw = (long)v.Raw << 16; }
public static F32 LengthSqr(F32Vec2 a) { return(F32.FromRaw(Fixed32.Mul(a.RawX, a.RawX) + Fixed32.Mul(a.RawY, a.RawY))); }
public static F32Vec2 PowFastest(F32 a, F32Vec2 b) { return(new F32Vec2(Fixed32.PowFastest(a.Raw, b.RawX), Fixed32.PowFastest(a.Raw, b.RawY))); }
public static F32Vec2 NormalizeFastest(F32Vec2 a) { F32 ooLen = F32.FromRaw((int)(Fixed64.RSqrtFastest((long)a.RawX * (long)a.RawX + (long)a.RawY * (long)a.RawY) >> 16)); return(ooLen * a); }
public static F32Vec4 Normalize(F32Vec4 a) { F32 ooLen = F32.FromRaw(Fixed32.RSqrt(Fixed32.Mul(a.RawX, a.RawX) + Fixed32.Mul(a.RawY, a.RawY) + Fixed32.Mul(a.RawZ, a.RawZ) + Fixed32.Mul(a.RawW, a.RawW))); return(ooLen * a); }
public static F32 Dot(F32Vec4 a, F32Vec4 b) { return(F32.FromRaw(Fixed32.Mul(a.RawX, b.RawX) + Fixed32.Mul(a.RawY, b.RawY) + Fixed32.Mul(a.RawZ, b.RawZ) + Fixed32.Mul(a.RawW, b.RawW))); }
public static F32Vec4 PowFastest(F32 a, F32Vec4 b) { return(new F32Vec4(Fixed32.PowFastest(a.Raw, b.RawX), Fixed32.PowFastest(a.Raw, b.RawY), Fixed32.PowFastest(a.Raw, b.RawZ), Fixed32.PowFastest(a.Raw, b.RawW))); }
public static F32 LengthFastest(F32Vec4 a) { return(F32.FromRaw(Fixed32.SqrtFastest(Fixed32.Mul(a.RawX, a.RawX) + Fixed32.Mul(a.RawY, a.RawY) + Fixed32.Mul(a.RawZ, a.RawZ) + Fixed32.Mul(a.RawW, a.RawW)))); }
public static F32Vec4 PowFastest(F32Vec4 a, F32 b) { return(new F32Vec4(Fixed32.PowFastest(a.RawX, b.Raw), Fixed32.PowFastest(a.RawY, b.Raw), Fixed32.PowFastest(a.RawZ, b.Raw), Fixed32.PowFastest(a.RawW, b.Raw))); }
public static F32Vec4 DivFast(F32Vec4 a, F32 b) { int oob = Fixed32.RcpFast(b.Raw); return(new F32Vec4(Fixed32.Mul(a.RawX, oob), Fixed32.Mul(a.RawY, oob), Fixed32.Mul(a.RawZ, oob), Fixed32.Mul(a.RawW, oob))); }
public static F32Vec4 FromDouble(double x, double y, double z, double w) { return(new F32Vec4(F32.FromDouble(x), F32.FromDouble(y), F32.FromDouble(z), F32.FromDouble(w))); }
public static F32Vec2 DivFastest(F32Vec2 a, F32 b) { int oob = Fixed32.RcpFastest(b.Raw); return(new F32Vec2(Fixed32.Mul(a.RawX, oob), Fixed32.Mul(a.RawY, oob))); }
public static F32Vec4 FromInt(int x, int y, int z, int w) { return(new F32Vec4(F32.FromInt(x), F32.FromInt(y), F32.FromInt(z), F32.FromInt(w))); }
public static F32Vec2 PowFast(F32Vec2 a, F32 b) { return(new F32Vec2(Fixed32.PowFast(a.RawX, b.Raw), Fixed32.PowFast(a.RawY, b.Raw))); }
public static F32Vec4 FromFloat(float x, float y, float z, float w) { return(new F32Vec4(F32.FromFloat(x), F32.FromFloat(y), F32.FromFloat(z), F32.FromFloat(w))); }
public static F32 LengthFastest(F32Vec2 a) { return(F32.FromRaw((int)(Fixed64.SqrtFastest((long)a.RawX * (long)a.RawX + (long)a.RawY * (long)a.RawY) >> 16))); }
[MethodImpl(FixedUtil.AggressiveInlining)] public static F64 FromF32(F32 v) { return(FromRaw((long)v.Raw << 16)); }
public static F32 Dot(F32Vec2 a, F32Vec2 b) { return(F32.FromRaw(Fixed32.Mul(a.RawX, b.RawX) + Fixed32.Mul(a.RawY, b.RawY))); }
public static F64 FromF32(F32 v) { return(new F64(v)); }