Przeglądaj źródła

Add ToString() to math types

Daniele Bartolini 10 lat temu
rodzic
commit
d7d1b8c9ba

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

@@ -29,5 +29,10 @@ namespace Crown
 			this.z = axis.z * sa;
 			this.w = ca;
 		}
+
+		public override string ToString()
+		{
+			return string.Format("{0}, {1}, {2}, {3}", x, y, z, w);
+		}
 	}
 }

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

@@ -36,5 +36,10 @@ namespace Crown
 		{
 			return a * k;
 		}
+
+		public override string ToString()
+		{
+			return string.Format("{0}, {1}", x, y);
+		}
 	}
 }

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

@@ -37,5 +37,10 @@ namespace Crown
 		{
 			return a * k;
 		}
+
+		public override string ToString()
+		{
+			return string.Format("{0}, {1}, {2}", x, y, z);
+		}
 	}
 }