Daniele Bartolini 10 лет назад
Родитель
Сommit
764285302e
3 измененных файлов с 24 добавлено и 0 удалено
  1. 9 0
      tools/core/math/Quaternion.cs
  2. 7 0
      tools/core/math/Vector2.cs
  3. 8 0
      tools/core/math/Vector3.cs

+ 9 - 0
tools/core/math/Quaternion.cs

@@ -3,6 +3,7 @@
  * License: https://github.com/taylor001/crown/blob/master/LICENSE
  * License: https://github.com/taylor001/crown/blob/master/LICENSE
  */
  */
 
 
+using System.Collections;
 using System;
 using System;
 
 
 namespace Crown
 namespace Crown
@@ -19,6 +20,14 @@ namespace Crown
 			this.w = w;
 			this.w = w;
 		}
 		}
 
 
+		public Quaternion(ArrayList arr)
+		{
+			this.x = (float)(double)arr[0];
+			this.y = (float)(double)arr[1];
+			this.z = (float)(double)arr[2];
+			this.w = (float)(double)arr[3];
+		}
+
 		public Quaternion(Vector3 axis, float angle)
 		public Quaternion(Vector3 axis, float angle)
 		{
 		{
 			float ha = angle * 0.5f;
 			float ha = angle * 0.5f;

+ 7 - 0
tools/core/math/Vector2.cs

@@ -3,6 +3,7 @@
  * License: https://github.com/taylor001/crown/blob/master/LICENSE
  * License: https://github.com/taylor001/crown/blob/master/LICENSE
  */
  */
 
 
+using System.Collections;
 using System;
 using System;
 
 
 namespace Crown
 namespace Crown
@@ -17,6 +18,12 @@ namespace Crown
 			this.y = y;
 			this.y = y;
 		}
 		}
 
 
+		public Vector2(ArrayList arr)
+		{
+			this.x = (float)(double)arr[0];
+			this.y = (float)(double)arr[1];
+		}
+
 		public static Vector2 operator+(Vector2 a, Vector2 b)
 		public static Vector2 operator+(Vector2 a, Vector2 b)
 		{
 		{
 			return new Vector2(a.x + b.x, a.y + b.y);
 			return new Vector2(a.x + b.x, a.y + b.y);

+ 8 - 0
tools/core/math/Vector3.cs

@@ -3,6 +3,7 @@
  * License: https://github.com/taylor001/crown/blob/master/LICENSE
  * License: https://github.com/taylor001/crown/blob/master/LICENSE
  */
  */
 
 
+using System.Collections;
 using System;
 using System;
 
 
 namespace Crown
 namespace Crown
@@ -18,6 +19,13 @@ namespace Crown
 			this.z = z;
 			this.z = z;
 		}
 		}
 
 
+		public Vector3(ArrayList arr)
+		{
+			this.x = (float)(double)arr[0];
+			this.y = (float)(double)arr[1];
+			this.z = (float)(double)arr[2];
+		}
+
 		public static Vector3 operator+(Vector3 a, Vector3 b)
 		public static Vector3 operator+(Vector3 a, Vector3 b)
 		{
 		{
 			return new Vector3(a.x + b.x, a.y + b.y, a.z + b.z);
 			return new Vector3(a.x + b.x, a.y + b.y, a.z + b.z);