示例#1
0
 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)));
 }
示例#2
0
 public static TSVector3 Lerp(TSVector3 from, TSVector3 to, FP percent)
 {
     return(from + (to - from) * percent);
 }
示例#3
0
 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;
 }
示例#4
0
        public static TSVector3 operator +(TSVector3 value1, TSVector3 value2)
        {
            TSVector3 result; TSVector3.Add(ref value1, ref value2, out result);

            return(result);
        }
示例#5
0
 public void Scale(TSVector3 other)
 {
     this.x = x * other.x;
     this.y = y * other.y;
     this.z = z * other.z;
 }
示例#6
0
 public static TSVector3 Abs(TSVector3 other)
 {
     return(new TSVector3(FP.Abs(other.x), FP.Abs(other.y), FP.Abs(other.z)));
 }
示例#7
0
        public static TSVector3 operator -(TSVector3 value1, TSVector3 value2)
        {
            TSVector3 result; TSVector3.Subtract(ref value1, ref value2, out result);

            return(result);
        }
示例#8
0
 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;
 }
示例#9
0
 public static FP operator *(TSVector3 value1, TSVector3 value2)
 {
     return(TSVector3.Dot(ref value1, ref value2));
 }
示例#10
0
        public static TSMatrix AngleAxis(FP angle, TSVector3 axis)
        {
            TSMatrix result; CreateFromAxisAngle(ref axis, angle, out result);

            return(result);
        }
示例#11
0
 public bool Contains(TSVector3 point)
 {
     return(point.x >= this.xMin && point.x < this.xMax && point.y >= this.yMin && point.y < this.yMax);
 }
示例#12
0
    public static Vector3 ToVector3(TrueSync.TSVector3 v3)
    {
        Vector3 ret = new Vector3(v3.x.AsFloat(), v3.y.AsFloat(), v3.z.AsFloat());

        return(ret);
    }
示例#13
0
 public static TrueSync.TSVector3 ToTSVector3(Vector3 v3)
 {
     TrueSync.TSVector3 ret = new TrueSync.TSVector3(v3.x, v3.y, v3.z);
     return(ret);
 }
示例#14
0
        public void SetFromToRotation(TSVector3 fromDirection, TSVector3 toDirection)
        {
            TSQuaternion targetRotation = TSQuaternion.FromToRotation(fromDirection, toDirection);

            this.Set(targetRotation.x, targetRotation.y, targetRotation.z, targetRotation.w);
        }
示例#15
0
 public static TSQuaternion Euler(TSVector3 eulerAngles)
 {
     return(Euler(eulerAngles.x, eulerAngles.y, eulerAngles.z));
 }
示例#16
0
 public static TSQuaternion LookRotation(TSVector3 forward, TSVector3 upwards)
 {
     return(CreateFromMatrix(TSMatrix.LookAt(forward, upwards)));
 }