684 lines
20 KiB
C#
684 lines
20 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using UnityEngine.Scripting;
|
|
|
|
namespace UnityEngine
|
|
{
|
|
// Token: 0x02000085 RID: 133
|
|
[UsedByNativeCode]
|
|
public struct Matrix4x4
|
|
{
|
|
// Token: 0x06000995 RID: 2453 RVA: 0x0000CC94 File Offset: 0x0000AE94
|
|
public Matrix4x4(Vector4 column0, Vector4 column1, Vector4 column2, Vector4 column3)
|
|
{
|
|
this.m00 = column0.x;
|
|
this.m01 = column1.x;
|
|
this.m02 = column2.x;
|
|
this.m03 = column3.x;
|
|
this.m10 = column0.y;
|
|
this.m11 = column1.y;
|
|
this.m12 = column2.y;
|
|
this.m13 = column3.y;
|
|
this.m20 = column0.z;
|
|
this.m21 = column1.z;
|
|
this.m22 = column2.z;
|
|
this.m23 = column3.z;
|
|
this.m30 = column0.w;
|
|
this.m31 = column1.w;
|
|
this.m32 = column2.w;
|
|
this.m33 = column3.w;
|
|
}
|
|
|
|
// Token: 0x06000996 RID: 2454 RVA: 0x0000CD74 File Offset: 0x0000AF74
|
|
[ThreadAndSerializationSafe]
|
|
public static Matrix4x4 Inverse(Matrix4x4 m)
|
|
{
|
|
Matrix4x4 matrix4x;
|
|
Matrix4x4.INTERNAL_CALL_Inverse(ref m, out matrix4x);
|
|
return matrix4x;
|
|
}
|
|
|
|
// Token: 0x06000997 RID: 2455
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void INTERNAL_CALL_Inverse(ref Matrix4x4 m, out Matrix4x4 value);
|
|
|
|
// Token: 0x06000998 RID: 2456 RVA: 0x0000CD94 File Offset: 0x0000AF94
|
|
public static Matrix4x4 Transpose(Matrix4x4 m)
|
|
{
|
|
Matrix4x4 matrix4x;
|
|
Matrix4x4.INTERNAL_CALL_Transpose(ref m, out matrix4x);
|
|
return matrix4x;
|
|
}
|
|
|
|
// Token: 0x06000999 RID: 2457
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void INTERNAL_CALL_Transpose(ref Matrix4x4 m, out Matrix4x4 value);
|
|
|
|
// Token: 0x0600099A RID: 2458 RVA: 0x0000CDB4 File Offset: 0x0000AFB4
|
|
internal static bool Invert(Matrix4x4 inMatrix, out Matrix4x4 dest)
|
|
{
|
|
return Matrix4x4.INTERNAL_CALL_Invert(ref inMatrix, out dest);
|
|
}
|
|
|
|
// Token: 0x0600099B RID: 2459
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern bool INTERNAL_CALL_Invert(ref Matrix4x4 inMatrix, out Matrix4x4 dest);
|
|
|
|
// Token: 0x17000244 RID: 580
|
|
// (get) Token: 0x0600099C RID: 2460 RVA: 0x0000CDD4 File Offset: 0x0000AFD4
|
|
public Matrix4x4 inverse
|
|
{
|
|
get
|
|
{
|
|
return Matrix4x4.Inverse(this);
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000245 RID: 581
|
|
// (get) Token: 0x0600099D RID: 2461 RVA: 0x0000CDF4 File Offset: 0x0000AFF4
|
|
public Matrix4x4 transpose
|
|
{
|
|
get
|
|
{
|
|
return Matrix4x4.Transpose(this);
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000246 RID: 582
|
|
// (get) Token: 0x0600099E RID: 2462
|
|
public extern bool isIdentity
|
|
{
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
get;
|
|
}
|
|
|
|
// Token: 0x0600099F RID: 2463 RVA: 0x0000CE14 File Offset: 0x0000B014
|
|
public static float Determinant(Matrix4x4 m)
|
|
{
|
|
return Matrix4x4.INTERNAL_CALL_Determinant(ref m);
|
|
}
|
|
|
|
// Token: 0x060009A0 RID: 2464
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern float INTERNAL_CALL_Determinant(ref Matrix4x4 m);
|
|
|
|
// Token: 0x17000247 RID: 583
|
|
// (get) Token: 0x060009A1 RID: 2465 RVA: 0x0000CE30 File Offset: 0x0000B030
|
|
public float determinant
|
|
{
|
|
get
|
|
{
|
|
return Matrix4x4.Determinant(this);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060009A2 RID: 2466 RVA: 0x0000CE50 File Offset: 0x0000B050
|
|
public void SetTRS(Vector3 pos, Quaternion q, Vector3 s)
|
|
{
|
|
this = Matrix4x4.TRS(pos, q, s);
|
|
}
|
|
|
|
// Token: 0x060009A3 RID: 2467 RVA: 0x0000CE64 File Offset: 0x0000B064
|
|
public static Matrix4x4 TRS(Vector3 pos, Quaternion q, Vector3 s)
|
|
{
|
|
Matrix4x4 matrix4x;
|
|
Matrix4x4.INTERNAL_CALL_TRS(ref pos, ref q, ref s, out matrix4x);
|
|
return matrix4x;
|
|
}
|
|
|
|
// Token: 0x060009A4 RID: 2468
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void INTERNAL_CALL_TRS(ref Vector3 pos, ref Quaternion q, ref Vector3 s, out Matrix4x4 value);
|
|
|
|
// Token: 0x060009A5 RID: 2469 RVA: 0x0000CE88 File Offset: 0x0000B088
|
|
public static Matrix4x4 Ortho(float left, float right, float bottom, float top, float zNear, float zFar)
|
|
{
|
|
Matrix4x4 matrix4x;
|
|
Matrix4x4.INTERNAL_CALL_Ortho(left, right, bottom, top, zNear, zFar, out matrix4x);
|
|
return matrix4x;
|
|
}
|
|
|
|
// Token: 0x060009A6 RID: 2470
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void INTERNAL_CALL_Ortho(float left, float right, float bottom, float top, float zNear, float zFar, out Matrix4x4 value);
|
|
|
|
// Token: 0x060009A7 RID: 2471 RVA: 0x0000CEB0 File Offset: 0x0000B0B0
|
|
public static Matrix4x4 Perspective(float fov, float aspect, float zNear, float zFar)
|
|
{
|
|
Matrix4x4 matrix4x;
|
|
Matrix4x4.INTERNAL_CALL_Perspective(fov, aspect, zNear, zFar, out matrix4x);
|
|
return matrix4x;
|
|
}
|
|
|
|
// Token: 0x060009A8 RID: 2472
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void INTERNAL_CALL_Perspective(float fov, float aspect, float zNear, float zFar, out Matrix4x4 value);
|
|
|
|
// Token: 0x060009A9 RID: 2473 RVA: 0x0000CED4 File Offset: 0x0000B0D4
|
|
public static Matrix4x4 LookAt(Vector3 from, Vector3 to, Vector3 up)
|
|
{
|
|
Matrix4x4 matrix4x;
|
|
Matrix4x4.INTERNAL_CALL_LookAt(ref from, ref to, ref up, out matrix4x);
|
|
return matrix4x;
|
|
}
|
|
|
|
// Token: 0x060009AA RID: 2474
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void INTERNAL_CALL_LookAt(ref Vector3 from, ref Vector3 to, ref Vector3 up, out Matrix4x4 value);
|
|
|
|
// Token: 0x17000248 RID: 584
|
|
public float this[int row, int column]
|
|
{
|
|
get
|
|
{
|
|
return this[row + column * 4];
|
|
}
|
|
set
|
|
{
|
|
this[row + column * 4] = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000249 RID: 585
|
|
public float this[int index]
|
|
{
|
|
get
|
|
{
|
|
float num;
|
|
switch (index)
|
|
{
|
|
case 0:
|
|
num = this.m00;
|
|
break;
|
|
case 1:
|
|
num = this.m10;
|
|
break;
|
|
case 2:
|
|
num = this.m20;
|
|
break;
|
|
case 3:
|
|
num = this.m30;
|
|
break;
|
|
case 4:
|
|
num = this.m01;
|
|
break;
|
|
case 5:
|
|
num = this.m11;
|
|
break;
|
|
case 6:
|
|
num = this.m21;
|
|
break;
|
|
case 7:
|
|
num = this.m31;
|
|
break;
|
|
case 8:
|
|
num = this.m02;
|
|
break;
|
|
case 9:
|
|
num = this.m12;
|
|
break;
|
|
case 10:
|
|
num = this.m22;
|
|
break;
|
|
case 11:
|
|
num = this.m32;
|
|
break;
|
|
case 12:
|
|
num = this.m03;
|
|
break;
|
|
case 13:
|
|
num = this.m13;
|
|
break;
|
|
case 14:
|
|
num = this.m23;
|
|
break;
|
|
case 15:
|
|
num = this.m33;
|
|
break;
|
|
default:
|
|
throw new IndexOutOfRangeException("Invalid matrix index!");
|
|
}
|
|
return num;
|
|
}
|
|
set
|
|
{
|
|
switch (index)
|
|
{
|
|
case 0:
|
|
this.m00 = value;
|
|
break;
|
|
case 1:
|
|
this.m10 = value;
|
|
break;
|
|
case 2:
|
|
this.m20 = value;
|
|
break;
|
|
case 3:
|
|
this.m30 = value;
|
|
break;
|
|
case 4:
|
|
this.m01 = value;
|
|
break;
|
|
case 5:
|
|
this.m11 = value;
|
|
break;
|
|
case 6:
|
|
this.m21 = value;
|
|
break;
|
|
case 7:
|
|
this.m31 = value;
|
|
break;
|
|
case 8:
|
|
this.m02 = value;
|
|
break;
|
|
case 9:
|
|
this.m12 = value;
|
|
break;
|
|
case 10:
|
|
this.m22 = value;
|
|
break;
|
|
case 11:
|
|
this.m32 = value;
|
|
break;
|
|
case 12:
|
|
this.m03 = value;
|
|
break;
|
|
case 13:
|
|
this.m13 = value;
|
|
break;
|
|
case 14:
|
|
this.m23 = value;
|
|
break;
|
|
case 15:
|
|
this.m33 = value;
|
|
break;
|
|
default:
|
|
throw new IndexOutOfRangeException("Invalid matrix index!");
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x060009AF RID: 2479 RVA: 0x0000D174 File Offset: 0x0000B374
|
|
public override int GetHashCode()
|
|
{
|
|
return this.GetColumn(0).GetHashCode() ^ (this.GetColumn(1).GetHashCode() << 2) ^ (this.GetColumn(2).GetHashCode() >> 2) ^ (this.GetColumn(3).GetHashCode() >> 1);
|
|
}
|
|
|
|
// Token: 0x060009B0 RID: 2480 RVA: 0x0000D1E8 File Offset: 0x0000B3E8
|
|
public override bool Equals(object other)
|
|
{
|
|
bool flag;
|
|
if (!(other is Matrix4x4))
|
|
{
|
|
flag = false;
|
|
}
|
|
else
|
|
{
|
|
Matrix4x4 matrix4x = (Matrix4x4)other;
|
|
flag = this.GetColumn(0).Equals(matrix4x.GetColumn(0)) && this.GetColumn(1).Equals(matrix4x.GetColumn(1)) && this.GetColumn(2).Equals(matrix4x.GetColumn(2)) && this.GetColumn(3).Equals(matrix4x.GetColumn(3));
|
|
}
|
|
return flag;
|
|
}
|
|
|
|
// Token: 0x060009B1 RID: 2481 RVA: 0x0000D2B4 File Offset: 0x0000B4B4
|
|
public static Matrix4x4 operator *(Matrix4x4 lhs, Matrix4x4 rhs)
|
|
{
|
|
Matrix4x4 matrix4x;
|
|
matrix4x.m00 = lhs.m00 * rhs.m00 + lhs.m01 * rhs.m10 + lhs.m02 * rhs.m20 + lhs.m03 * rhs.m30;
|
|
matrix4x.m01 = lhs.m00 * rhs.m01 + lhs.m01 * rhs.m11 + lhs.m02 * rhs.m21 + lhs.m03 * rhs.m31;
|
|
matrix4x.m02 = lhs.m00 * rhs.m02 + lhs.m01 * rhs.m12 + lhs.m02 * rhs.m22 + lhs.m03 * rhs.m32;
|
|
matrix4x.m03 = lhs.m00 * rhs.m03 + lhs.m01 * rhs.m13 + lhs.m02 * rhs.m23 + lhs.m03 * rhs.m33;
|
|
matrix4x.m10 = lhs.m10 * rhs.m00 + lhs.m11 * rhs.m10 + lhs.m12 * rhs.m20 + lhs.m13 * rhs.m30;
|
|
matrix4x.m11 = lhs.m10 * rhs.m01 + lhs.m11 * rhs.m11 + lhs.m12 * rhs.m21 + lhs.m13 * rhs.m31;
|
|
matrix4x.m12 = lhs.m10 * rhs.m02 + lhs.m11 * rhs.m12 + lhs.m12 * rhs.m22 + lhs.m13 * rhs.m32;
|
|
matrix4x.m13 = lhs.m10 * rhs.m03 + lhs.m11 * rhs.m13 + lhs.m12 * rhs.m23 + lhs.m13 * rhs.m33;
|
|
matrix4x.m20 = lhs.m20 * rhs.m00 + lhs.m21 * rhs.m10 + lhs.m22 * rhs.m20 + lhs.m23 * rhs.m30;
|
|
matrix4x.m21 = lhs.m20 * rhs.m01 + lhs.m21 * rhs.m11 + lhs.m22 * rhs.m21 + lhs.m23 * rhs.m31;
|
|
matrix4x.m22 = lhs.m20 * rhs.m02 + lhs.m21 * rhs.m12 + lhs.m22 * rhs.m22 + lhs.m23 * rhs.m32;
|
|
matrix4x.m23 = lhs.m20 * rhs.m03 + lhs.m21 * rhs.m13 + lhs.m22 * rhs.m23 + lhs.m23 * rhs.m33;
|
|
matrix4x.m30 = lhs.m30 * rhs.m00 + lhs.m31 * rhs.m10 + lhs.m32 * rhs.m20 + lhs.m33 * rhs.m30;
|
|
matrix4x.m31 = lhs.m30 * rhs.m01 + lhs.m31 * rhs.m11 + lhs.m32 * rhs.m21 + lhs.m33 * rhs.m31;
|
|
matrix4x.m32 = lhs.m30 * rhs.m02 + lhs.m31 * rhs.m12 + lhs.m32 * rhs.m22 + lhs.m33 * rhs.m32;
|
|
matrix4x.m33 = lhs.m30 * rhs.m03 + lhs.m31 * rhs.m13 + lhs.m32 * rhs.m23 + lhs.m33 * rhs.m33;
|
|
return matrix4x;
|
|
}
|
|
|
|
// Token: 0x060009B2 RID: 2482 RVA: 0x0000D72C File Offset: 0x0000B92C
|
|
public static Vector4 operator *(Matrix4x4 lhs, Vector4 vector)
|
|
{
|
|
Vector4 vector2;
|
|
vector2.x = lhs.m00 * vector.x + lhs.m01 * vector.y + lhs.m02 * vector.z + lhs.m03 * vector.w;
|
|
vector2.y = lhs.m10 * vector.x + lhs.m11 * vector.y + lhs.m12 * vector.z + lhs.m13 * vector.w;
|
|
vector2.z = lhs.m20 * vector.x + lhs.m21 * vector.y + lhs.m22 * vector.z + lhs.m23 * vector.w;
|
|
vector2.w = lhs.m30 * vector.x + lhs.m31 * vector.y + lhs.m32 * vector.z + lhs.m33 * vector.w;
|
|
return vector2;
|
|
}
|
|
|
|
// Token: 0x060009B3 RID: 2483 RVA: 0x0000D85C File Offset: 0x0000BA5C
|
|
public static bool operator ==(Matrix4x4 lhs, Matrix4x4 rhs)
|
|
{
|
|
return lhs.GetColumn(0) == rhs.GetColumn(0) && lhs.GetColumn(1) == rhs.GetColumn(1) && lhs.GetColumn(2) == rhs.GetColumn(2) && lhs.GetColumn(3) == rhs.GetColumn(3);
|
|
}
|
|
|
|
// Token: 0x060009B4 RID: 2484 RVA: 0x0000D8D8 File Offset: 0x0000BAD8
|
|
public static bool operator !=(Matrix4x4 lhs, Matrix4x4 rhs)
|
|
{
|
|
return !(lhs == rhs);
|
|
}
|
|
|
|
// Token: 0x060009B5 RID: 2485 RVA: 0x0000D8F8 File Offset: 0x0000BAF8
|
|
public Vector4 GetColumn(int index)
|
|
{
|
|
Vector4 vector;
|
|
switch (index)
|
|
{
|
|
case 0:
|
|
vector = new Vector4(this.m00, this.m10, this.m20, this.m30);
|
|
break;
|
|
case 1:
|
|
vector = new Vector4(this.m01, this.m11, this.m21, this.m31);
|
|
break;
|
|
case 2:
|
|
vector = new Vector4(this.m02, this.m12, this.m22, this.m32);
|
|
break;
|
|
case 3:
|
|
vector = new Vector4(this.m03, this.m13, this.m23, this.m33);
|
|
break;
|
|
default:
|
|
throw new IndexOutOfRangeException("Invalid column index!");
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x060009B6 RID: 2486 RVA: 0x0000D9BC File Offset: 0x0000BBBC
|
|
public Vector4 GetRow(int index)
|
|
{
|
|
Vector4 vector;
|
|
switch (index)
|
|
{
|
|
case 0:
|
|
vector = new Vector4(this.m00, this.m01, this.m02, this.m03);
|
|
break;
|
|
case 1:
|
|
vector = new Vector4(this.m10, this.m11, this.m12, this.m13);
|
|
break;
|
|
case 2:
|
|
vector = new Vector4(this.m20, this.m21, this.m22, this.m23);
|
|
break;
|
|
case 3:
|
|
vector = new Vector4(this.m30, this.m31, this.m32, this.m33);
|
|
break;
|
|
default:
|
|
throw new IndexOutOfRangeException("Invalid row index!");
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x060009B7 RID: 2487 RVA: 0x0000DA80 File Offset: 0x0000BC80
|
|
public void SetColumn(int index, Vector4 column)
|
|
{
|
|
this[0, index] = column.x;
|
|
this[1, index] = column.y;
|
|
this[2, index] = column.z;
|
|
this[3, index] = column.w;
|
|
}
|
|
|
|
// Token: 0x060009B8 RID: 2488 RVA: 0x0000DAC0 File Offset: 0x0000BCC0
|
|
public void SetRow(int index, Vector4 row)
|
|
{
|
|
this[index, 0] = row.x;
|
|
this[index, 1] = row.y;
|
|
this[index, 2] = row.z;
|
|
this[index, 3] = row.w;
|
|
}
|
|
|
|
// Token: 0x060009B9 RID: 2489 RVA: 0x0000DB00 File Offset: 0x0000BD00
|
|
public Vector3 MultiplyPoint(Vector3 point)
|
|
{
|
|
Vector3 vector;
|
|
vector.x = this.m00 * point.x + this.m01 * point.y + this.m02 * point.z + this.m03;
|
|
vector.y = this.m10 * point.x + this.m11 * point.y + this.m12 * point.z + this.m13;
|
|
vector.z = this.m20 * point.x + this.m21 * point.y + this.m22 * point.z + this.m23;
|
|
float num = this.m30 * point.x + this.m31 * point.y + this.m32 * point.z + this.m33;
|
|
num = 1f / num;
|
|
vector.x *= num;
|
|
vector.y *= num;
|
|
vector.z *= num;
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x060009BA RID: 2490 RVA: 0x0000DC30 File Offset: 0x0000BE30
|
|
public Vector3 MultiplyPoint3x4(Vector3 point)
|
|
{
|
|
Vector3 vector;
|
|
vector.x = this.m00 * point.x + this.m01 * point.y + this.m02 * point.z + this.m03;
|
|
vector.y = this.m10 * point.x + this.m11 * point.y + this.m12 * point.z + this.m13;
|
|
vector.z = this.m20 * point.x + this.m21 * point.y + this.m22 * point.z + this.m23;
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x060009BB RID: 2491 RVA: 0x0000DCF4 File Offset: 0x0000BEF4
|
|
public Vector3 MultiplyVector(Vector3 vector)
|
|
{
|
|
Vector3 vector2;
|
|
vector2.x = this.m00 * vector.x + this.m01 * vector.y + this.m02 * vector.z;
|
|
vector2.y = this.m10 * vector.x + this.m11 * vector.y + this.m12 * vector.z;
|
|
vector2.z = this.m20 * vector.x + this.m21 * vector.y + this.m22 * vector.z;
|
|
return vector2;
|
|
}
|
|
|
|
// Token: 0x060009BC RID: 2492 RVA: 0x0000DDA4 File Offset: 0x0000BFA4
|
|
public Plane TransformPlane(Plane plane)
|
|
{
|
|
Matrix4x4 inverse = this.inverse;
|
|
float x = plane.normal.x;
|
|
float y = plane.normal.y;
|
|
float z = plane.normal.z;
|
|
float distance = plane.distance;
|
|
float num = inverse.m00 * x + inverse.m10 * y + inverse.m20 * z + inverse.m30 * distance;
|
|
float num2 = inverse.m01 * x + inverse.m11 * y + inverse.m21 * z + inverse.m31 * distance;
|
|
float num3 = inverse.m02 * x + inverse.m12 * y + inverse.m22 * z + inverse.m32 * distance;
|
|
float num4 = inverse.m03 * x + inverse.m13 * y + inverse.m23 * z + inverse.m33 * distance;
|
|
return new Plane(new Vector3(num, num2, num3), num4);
|
|
}
|
|
|
|
// Token: 0x060009BD RID: 2493 RVA: 0x0000DEBC File Offset: 0x0000C0BC
|
|
public static Matrix4x4 Scale(Vector3 vector)
|
|
{
|
|
Matrix4x4 matrix4x;
|
|
matrix4x.m00 = vector.x;
|
|
matrix4x.m01 = 0f;
|
|
matrix4x.m02 = 0f;
|
|
matrix4x.m03 = 0f;
|
|
matrix4x.m10 = 0f;
|
|
matrix4x.m11 = vector.y;
|
|
matrix4x.m12 = 0f;
|
|
matrix4x.m13 = 0f;
|
|
matrix4x.m20 = 0f;
|
|
matrix4x.m21 = 0f;
|
|
matrix4x.m22 = vector.z;
|
|
matrix4x.m23 = 0f;
|
|
matrix4x.m30 = 0f;
|
|
matrix4x.m31 = 0f;
|
|
matrix4x.m32 = 0f;
|
|
matrix4x.m33 = 1f;
|
|
return matrix4x;
|
|
}
|
|
|
|
// Token: 0x060009BE RID: 2494 RVA: 0x0000DF98 File Offset: 0x0000C198
|
|
public static Matrix4x4 Translate(Vector3 vector)
|
|
{
|
|
Matrix4x4 matrix4x;
|
|
matrix4x.m00 = 1f;
|
|
matrix4x.m01 = 0f;
|
|
matrix4x.m02 = 0f;
|
|
matrix4x.m03 = vector.x;
|
|
matrix4x.m10 = 0f;
|
|
matrix4x.m11 = 1f;
|
|
matrix4x.m12 = 0f;
|
|
matrix4x.m13 = vector.y;
|
|
matrix4x.m20 = 0f;
|
|
matrix4x.m21 = 0f;
|
|
matrix4x.m22 = 1f;
|
|
matrix4x.m23 = vector.z;
|
|
matrix4x.m30 = 0f;
|
|
matrix4x.m31 = 0f;
|
|
matrix4x.m32 = 0f;
|
|
matrix4x.m33 = 1f;
|
|
return matrix4x;
|
|
}
|
|
|
|
// Token: 0x060009BF RID: 2495 RVA: 0x0000E074 File Offset: 0x0000C274
|
|
public static Matrix4x4 Rotate(Quaternion q)
|
|
{
|
|
float num = q.x * 2f;
|
|
float num2 = q.y * 2f;
|
|
float num3 = q.z * 2f;
|
|
float num4 = q.x * num;
|
|
float num5 = q.y * num2;
|
|
float num6 = q.z * num3;
|
|
float num7 = q.x * num2;
|
|
float num8 = q.x * num3;
|
|
float num9 = q.y * num3;
|
|
float num10 = q.w * num;
|
|
float num11 = q.w * num2;
|
|
float num12 = q.w * num3;
|
|
Matrix4x4 matrix4x;
|
|
matrix4x.m00 = 1f - (num5 + num6);
|
|
matrix4x.m10 = num7 + num12;
|
|
matrix4x.m20 = num8 - num11;
|
|
matrix4x.m30 = 0f;
|
|
matrix4x.m01 = num7 - num12;
|
|
matrix4x.m11 = 1f - (num4 + num6);
|
|
matrix4x.m21 = num9 + num10;
|
|
matrix4x.m31 = 0f;
|
|
matrix4x.m02 = num8 + num11;
|
|
matrix4x.m12 = num9 - num10;
|
|
matrix4x.m22 = 1f - (num4 + num5);
|
|
matrix4x.m32 = 0f;
|
|
matrix4x.m03 = 0f;
|
|
matrix4x.m13 = 0f;
|
|
matrix4x.m23 = 0f;
|
|
matrix4x.m33 = 1f;
|
|
return matrix4x;
|
|
}
|
|
|
|
// Token: 0x1700024A RID: 586
|
|
// (get) Token: 0x060009C0 RID: 2496 RVA: 0x0000E1EC File Offset: 0x0000C3EC
|
|
public static Matrix4x4 zero
|
|
{
|
|
get
|
|
{
|
|
return Matrix4x4.zeroMatrix;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700024B RID: 587
|
|
// (get) Token: 0x060009C1 RID: 2497 RVA: 0x0000E208 File Offset: 0x0000C408
|
|
public static Matrix4x4 identity
|
|
{
|
|
get
|
|
{
|
|
return Matrix4x4.identityMatrix;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060009C2 RID: 2498 RVA: 0x0000E224 File Offset: 0x0000C424
|
|
public override string ToString()
|
|
{
|
|
return UnityString.Format("{0:F5}\t{1:F5}\t{2:F5}\t{3:F5}\n{4:F5}\t{5:F5}\t{6:F5}\t{7:F5}\n{8:F5}\t{9:F5}\t{10:F5}\t{11:F5}\n{12:F5}\t{13:F5}\t{14:F5}\t{15:F5}\n", new object[]
|
|
{
|
|
this.m00, this.m01, this.m02, this.m03, this.m10, this.m11, this.m12, this.m13, this.m20, this.m21,
|
|
this.m22, this.m23, this.m30, this.m31, this.m32, this.m33
|
|
});
|
|
}
|
|
|
|
// Token: 0x060009C3 RID: 2499 RVA: 0x0000E334 File Offset: 0x0000C534
|
|
public string ToString(string format)
|
|
{
|
|
return UnityString.Format("{0}\t{1}\t{2}\t{3}\n{4}\t{5}\t{6}\t{7}\n{8}\t{9}\t{10}\t{11}\n{12}\t{13}\t{14}\t{15}\n", new object[]
|
|
{
|
|
this.m00.ToString(format),
|
|
this.m01.ToString(format),
|
|
this.m02.ToString(format),
|
|
this.m03.ToString(format),
|
|
this.m10.ToString(format),
|
|
this.m11.ToString(format),
|
|
this.m12.ToString(format),
|
|
this.m13.ToString(format),
|
|
this.m20.ToString(format),
|
|
this.m21.ToString(format),
|
|
this.m22.ToString(format),
|
|
this.m23.ToString(format),
|
|
this.m30.ToString(format),
|
|
this.m31.ToString(format),
|
|
this.m32.ToString(format),
|
|
this.m33.ToString(format)
|
|
});
|
|
}
|
|
|
|
// Token: 0x040000E5 RID: 229
|
|
public float m00;
|
|
|
|
// Token: 0x040000E6 RID: 230
|
|
public float m10;
|
|
|
|
// Token: 0x040000E7 RID: 231
|
|
public float m20;
|
|
|
|
// Token: 0x040000E8 RID: 232
|
|
public float m30;
|
|
|
|
// Token: 0x040000E9 RID: 233
|
|
public float m01;
|
|
|
|
// Token: 0x040000EA RID: 234
|
|
public float m11;
|
|
|
|
// Token: 0x040000EB RID: 235
|
|
public float m21;
|
|
|
|
// Token: 0x040000EC RID: 236
|
|
public float m31;
|
|
|
|
// Token: 0x040000ED RID: 237
|
|
public float m02;
|
|
|
|
// Token: 0x040000EE RID: 238
|
|
public float m12;
|
|
|
|
// Token: 0x040000EF RID: 239
|
|
public float m22;
|
|
|
|
// Token: 0x040000F0 RID: 240
|
|
public float m32;
|
|
|
|
// Token: 0x040000F1 RID: 241
|
|
public float m03;
|
|
|
|
// Token: 0x040000F2 RID: 242
|
|
public float m13;
|
|
|
|
// Token: 0x040000F3 RID: 243
|
|
public float m23;
|
|
|
|
// Token: 0x040000F4 RID: 244
|
|
public float m33;
|
|
|
|
// Token: 0x040000F5 RID: 245
|
|
private static readonly Matrix4x4 zeroMatrix = new Matrix4x4(new Vector4(0f, 0f, 0f, 0f), new Vector4(0f, 0f, 0f, 0f), new Vector4(0f, 0f, 0f, 0f), new Vector4(0f, 0f, 0f, 0f));
|
|
|
|
// Token: 0x040000F6 RID: 246
|
|
private static readonly Matrix4x4 identityMatrix = new Matrix4x4(new Vector4(1f, 0f, 0f, 0f), new Vector4(0f, 1f, 0f, 0f), new Vector4(0f, 0f, 1f, 0f), new Vector4(0f, 0f, 0f, 1f));
|
|
}
|
|
}
|