public static Vector3f Add(Vector3f vectorA, float x_0, float y_1, float z_2) { vectorA.x += x_0; vectorA.y += y_1; vectorA.z += z_2; return vectorA; }
public static Vector3f Add(Vector3f vectorA, Vector3f vectorB) { vectorA.x += vectorB.x; vectorA.y += vectorB.y; vectorA.z += vectorB.z; return vectorA; }
public float Dst(Vector3f vector) { float a = vector.x - x; float b = vector.y - y; float c = vector.z - z; a *= a; b *= b; c *= c; return MathUtils.Sqrt(a + b + c); }
public static Vector3f Sub(Vector3f vectorA, float x_0, float y_1, float z_2) { vectorA.x -= x_0; vectorA.y -= y_1; vectorA.z -= z_2; return vectorA; }
public static Vector3f Sub(Vector3f vectorA, float value_ren) { vectorA.x -= value_ren; vectorA.y -= value_ren; vectorA.z -= value_ren; return vectorA; }
public Vector3f(Vector3f vector) { this.Set(vector); }
public static float Dst2(Vector3f vectorA, float x_0, float y_1, float z_2) { float a = x_0 - vectorA.x; float b = y_1 - vectorA.y; float c = z_2 - vectorA.z; a *= a; b *= b; c *= c; return a + b + c; }
public float Dst2(Vector3f point) { float a = point.x - x; float b = point.y - y; float c = point.z - z; a *= a; b *= b; c *= c; return a + b + c; }
public Vector3f Set(Vector3f vector) { return this.Set(vector.x, vector.y, vector.z); }
public static Vector3f Mul(Vector3f vectorA, float value_ren) { vectorA.x = value_ren * vectorA.x; vectorA.y = value_ren * vectorA.y; vectorA.z = value_ren * vectorA.z; return vectorA; }
public Vector3f Crs(Vector3f vector) { return this.Set(y * vector.z - z * vector.y, z * vector.x - x * vector.z, x * vector.y - y * vector.x); }
public static float Len2(Vector3f vectorA) { return vectorA.x * vectorA.x + vectorA.y * vectorA.y + vectorA.z * vectorA.z; }
public static Vector3f Lerp(Vector3f vectorA, Vector3f target, float alpha) { Vector3f r = Mul(vectorA, 1.0f - alpha); Add(r, Mul(Cpy(vectorA), alpha)); return r; }
public static float Len(Vector3f vectorA) { return MathUtils.Sqrt(vectorA.x * vectorA.x + vectorA.y * vectorA.y + vectorA.z * vectorA.z); }
public static bool IsZero(Vector3f vectorA) { return vectorA.x == 0 && vectorA.y == 0 && vectorA.z == 0; }
public static bool Idt(Vector3f vectorA, Vector3f vectorB) { return vectorA.x == vectorB.x && vectorA.y == vectorB.y && vectorA.z == vectorB.z; }
public static float[] ToArray(Vector3f vectorA) { return new float[] { vectorA.x, vectorA.y, vectorA.z }; }
public static Vector3f Scale(Vector3f vectorA, float scalarX, float scalarY, float scalarZ) { vectorA.x *= scalarX; vectorA.y *= scalarY; vectorA.z *= scalarZ; return vectorA; }
public Vector3f Add(Vector3f vector) { return this.Add(vector.x, vector.y, vector.z); }
public static Vector3f Set(Vector3f vectorA, float x_0, float y_1, float z_2) { vectorA.x = x_0; vectorA.y = y_1; vectorA.z = z_2; return vectorA; }
public float Dot(Vector3f vector) { return x * vector.x + y * vector.y + z * vector.z; }
public static Vector3f Set(Vector3f vectorA, Vector3f vectorB) { return Set(vectorA, vectorB.x, vectorB.y, vectorB.z); }
public bool Idt(Vector3f vector) { return x == vector.x && y == vector.y && z == vector.z; }
public static float Dst(Vector3f vectorA, float x_0, float y_1, float z_2) { float a = x_0 - vectorA.x; float b = y_1 - vectorA.y; float c = z_2 - vectorA.z; a *= a; b *= b; c *= c; return MathUtils.Sqrt(a + b + c); }
public Vector3f Sub(Vector3f a_vec) { return this.Sub(a_vec.x, a_vec.y, a_vec.z); }
public static float Dst(Vector3f vectorA, Vector3f vectorB) { float a = vectorB.x - vectorA.x; float b = vectorB.y - vectorA.y; float c = vectorB.z - vectorA.z; a *= a; b *= b; c *= c; return MathUtils.Sqrt(a + b + c); }
public static Vector3f Set(Vector3f vectorA, float[] values) { return Set(vectorA, values[0], values[1], values[2]); }
public static float Dst2(Vector3f vectorA, Vector3f vectorB) { float a = vectorB.x - vectorA.x; float b = vectorB.y - vectorA.y; float c = vectorB.z - vectorA.z; a *= a; b *= b; c *= c; return a + b + c; }
public static Vector3f Add(Vector3f vectorA, float value_ren) { vectorA.x += value_ren; vectorA.y += value_ren; vectorA.z += value_ren; return vectorA; }
public static Vector3f Sub(Vector3f vectorA, Vector3f vectorB) { vectorA.x -= vectorB.x; vectorA.y -= vectorB.y; vectorA.z -= vectorB.z; return vectorA; }