public void Cross(Vector3F v1, Vector3F v2) { Set(v1.y * v2.z - v1.z * v2.y, v1.z * v2.x - v1.x * v2.z, v1.x * v2.y - v1.y * v2.x); }
protected bool Equals(Vector3F other) { return(x.Equals(other.x) && y.Equals(other.y) && z.Equals(other.z)); }
public void Scale(Vector3F p) { x *= p.x; y *= p.y; z *= p.z; }
public void Average(Vector3F a, Vector3F b) { x = (a.x + b.x) / 2f; y = (a.y + b.y) / 2f; z = (a.z + b.z) / 2f; }
public float Angle(Vector3F v1) { double xx = y*v1.z - z*v1.y; double yy = z*v1.x - x*v1.z; double zz = x*v1.y - y*v1.x; double cross = Math.Sqrt(xx*xx + yy*yy + zz*zz); return (float) Math.Abs(Math.Atan2(cross, Dot(v1))); }
public static Vector3F SubtractNew(Vector3F t1, Vector3F t2) { return(new Vector3F(t1.x - t2.x, t1.y - t2.y, t1.z - t2.z)); }
public void Rotate(Vector3F t) { Rotate(t, t); }
public float DistanceSquared(Vector3F p1) { double dx = x - p1.x; double dy = y - p1.y; double dz = z - p1.z; return (float) (dx*dx + dy*dy + dz*dz); }
public float Dot(Vector3F v) { return x*v.x + y*v.y + z*v.z; }
public float Distance(Vector3F p1) { return (float) Math.Sqrt(DistanceSquared(p1)); }
public void Cross(Vector3F v1, Vector3F v2) { Set(v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x); }
public void Average(Vector3F a, Vector3F b) { x = (a.x + b.x)/2f; y = (a.y + b.y)/2f; z = (a.z + b.z)/2f; }
public static Vector3F Abs(Vector3F v) { return(new Vector3F(Math.Abs(v.x), Math.Abs(v.y), Math.Abs(v.z))); }
public void ScaleAdd(float s, Vector3F t1, Vector3F t2) { x = s*t1.x + t2.x; y = s*t1.y + t2.y; z = s*t1.z + t2.z; }
public void Add(Vector3F t1, Vector3F t2) { x = t1.x + t2.x; y = t1.y + t2.y; z = t1.z + t2.z; }
public void Set(Vector3F t1) { x = t1.x; y = t1.y; z = t1.z; }
public Quat(Vector3F v, float theta) { Set(v, theta); }
public void Subtract(Vector3F t1, Vector3F t2) { x = t1.x - t2.x; y = t1.y - t2.y; z = t1.z - t2.z; }
public void Subtract(Vector3F t1) { x -= t1.x; y -= t1.y; z -= t1.z; }
protected bool Equals(Vector3F other) { return x.Equals(other.x) && y.Equals(other.y) && z.Equals(other.z); }
public void ScaleAdd(float s, Vector3F t1, Vector3F t2) { x = s * t1.x + t2.x; y = s * t1.y + t2.y; z = s * t1.z + t2.z; }
public Vector3F(Vector3F vec) { x = vec.x; y = vec.y; z = vec.z; }
public float Dot(Vector3F v) { return(x * v.x + y * v.y + z * v.z); }
public static Vector3F Abs(Vector3F v) { return new Vector3F(Math.Abs(v.x), Math.Abs(v.y), Math.Abs(v.z)); }
public static Vector3F Clamp(Vector3F x, Vector3F min, Vector3F max) { return new Vector3F(NumUtils.Clamp(x.x, min.x, max.x), NumUtils.Clamp(x.y, min.y, max.y), NumUtils.Clamp(x.z, min.z, max.z)); }
public static Vector3F Clamp(Vector3F x, Vector3F min, Vector3F max) { return(new Vector3F(NumUtils.Clamp(x.x, min.x, max.x), NumUtils.Clamp(x.y, min.y, max.y), NumUtils.Clamp(x.z, min.z, max.z))); }
public static Vector3F SubtractNew(Vector3F t1, Vector3F t2) { return new Vector3F(t1.x - t2.x, t1.y - t2.y, t1.z - t2.z); }
public void Add(Vector3F t1) { x += t1.x; y += t1.y; z += t1.z; }
public AxisVector3F(Vector3F axis, float angle) { Set(axis, angle); }
public void Rotate(Vector3F t, Vector3F result) { result.Set(m00 * t.x + m01 * t.y + m02 * t.z, m10 * t.x + m11 * t.y + m12 * t.z, m20 * t.x + m21 * t.y + m22 * t.z); }
public float Distance(Vector3F p1) { return((float)Math.Sqrt(DistanceSquared(p1))); }
public Vector3F Get3DProjection(Vector3F v3D) { v3D.Set(q1, q2, q3); return(v3D); }