public static FP Distance2D(TSVector3 v1, TSVector3 v2) { return(FP.Sqrt((v1.x - v2.x) * (v1.x - v2.x) + (v1.z - v2.z) * (v1.z - v2.z))); }
public static TSVector3 Lerp(TSVector3 from, TSVector3 to, FP percent) { return(from + (to - from) * percent); }
public static void Min(ref TSVector3 value1, ref TSVector3 value2, out TSVector3 result) { result.x = (value1.x < value2.x) ? value1.x : value2.x; result.y = (value1.y < value2.y) ? value1.y : value2.y; result.z = (value1.z < value2.z) ? value1.z : value2.z; }
public static TSVector3 operator +(TSVector3 value1, TSVector3 value2) { TSVector3 result; TSVector3.Add(ref value1, ref value2, out result); return(result); }
public void Scale(TSVector3 other) { this.x = x * other.x; this.y = y * other.y; this.z = z * other.z; }
public static TSVector3 Abs(TSVector3 other) { return(new TSVector3(FP.Abs(other.x), FP.Abs(other.y), FP.Abs(other.z))); }
public static TSVector3 operator -(TSVector3 value1, TSVector3 value2) { TSVector3 result; TSVector3.Subtract(ref value1, ref value2, out result); return(result); }
public static void Multiply(ref TSVector3 value1, long scaleFactor, out TSVector3 result) { result.x = value1.x * scaleFactor; result.y = value1.y * scaleFactor; result.z = value1.z * scaleFactor; }
public static FP operator *(TSVector3 value1, TSVector3 value2) { return(TSVector3.Dot(ref value1, ref value2)); }
public static TSMatrix AngleAxis(FP angle, TSVector3 axis) { TSMatrix result; CreateFromAxisAngle(ref axis, angle, out result); return(result); }
public bool Contains(TSVector3 point) { return(point.x >= this.xMin && point.x < this.xMax && point.y >= this.yMin && point.y < this.yMax); }
public static Vector3 ToVector3(TrueSync.TSVector3 v3) { Vector3 ret = new Vector3(v3.x.AsFloat(), v3.y.AsFloat(), v3.z.AsFloat()); return(ret); }
public static TrueSync.TSVector3 ToTSVector3(Vector3 v3) { TrueSync.TSVector3 ret = new TrueSync.TSVector3(v3.x, v3.y, v3.z); return(ret); }
public void SetFromToRotation(TSVector3 fromDirection, TSVector3 toDirection) { TSQuaternion targetRotation = TSQuaternion.FromToRotation(fromDirection, toDirection); this.Set(targetRotation.x, targetRotation.y, targetRotation.z, targetRotation.w); }
public static TSQuaternion Euler(TSVector3 eulerAngles) { return(Euler(eulerAngles.x, eulerAngles.y, eulerAngles.z)); }
public static TSQuaternion LookRotation(TSVector3 forward, TSVector3 upwards) { return(CreateFromMatrix(TSMatrix.LookAt(forward, upwards))); }