public Vec4f Set(Vec4f vec) { this.X = vec.X; this.Y = vec.Y; this.Z = vec.Z; this.W = vec.W; return(this); }
public Vec4f Mul(Vec4f vec) { this.X *= vec.X; this.Y *= vec.Y; this.Z *= vec.Z; this.W *= vec.W; return(this); }
public static Vec4f ToRGBAVec4f(int color, ref Vec4f outVal) { return(outVal.Set( ((color >> 16) & 0xff) / 255f, ((color >> 8) & 0xff) / 255f, ((color >> 0) & 0xff) / 255f, ((color >> 24) & 0xff) / 255f )); }
public static int ColorFromRgba(Vec4f colorRel) { return((int)(colorRel.R * 255) | ((int)(colorRel.G * 255) << 8) | ((int)(colorRel.B * 255) << 16) | ((int)(colorRel.A * 255) << 24)); }
/// <summary> /// Create a new vector with given coordinates /// </summary> /// <param name="vec"></param> public Vec3f(Vec4f vec) { this.X = vec.X; this.Y = vec.Y; this.Z = vec.Z; }
/// <summary> /// Creates the cross product from a and b and sets own values accordingly /// </summary> /// <param name="a"></param> /// <param name="b"></param> public void Cross(Vec3f a, Vec4f b) { X = a.Y * b.Z - a.Z * b.Y; Y = a.Z * b.X - a.X * b.Z; Z = a.X * b.Y - a.Y * b.X; }