فهرست منبع

Remove *.cs files

Daniele Bartolini 9 سال پیش
والد
کامیت
88705bafc3

+ 0 - 44
tools/core/EngineAPI.cs

@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using System;
-
-namespace Crown
-{
-	public static class EngineAPI
-	{
-		public static string Compile(string type, string name, string platform)
-		{
-			return string.Format(@"{{""type"":""compile"","
-				+ @"""resource_type"":""{0}"","
-				+ @"""resource_name"":""{1}"","
-				+ @"""platform"":""{2}""}}"
-				, type
-				, name
-				, platform
-				);
-		}
-
-		public static string Reload(string type, string name)
-		{
-			return string.Format(@"{{""type"":""reload"","
-				+ @"""resource_type"":""{0}"","
-				+ @"""resource_name"":""{1}""}}"
-				, type
-				, name
-				);
-		}
-
-		public static string Pause()
-		{
-			return @"{""type"":""pause""}";
-		}
-
-		public static string Unpause()
-		{
-			return @"{""type"":""unpause""}";
-		}
-	}
-}

+ 0 - 43
tools/core/LocalExec.cs

@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using System.Threading;
-using System;
-
-namespace Crown
-{
-	public class LocalExec
-	{
-		public Process _process;
-
-		public LocalExec()
-		{
-			_process = new Process();
-			_process.EnableRaisingEvents = true;
-		}
-
-		public void Close()
-		{
-			if (!_process.HasExited)
-			{
-				_process.Kill();
-				_process.Close();
-			}
-		}
-
-		public void Start(string name, string args, string workdir)
-		{
-			ProcessStartInfo startInfo = new ProcessStartInfo();
-			startInfo.FileName = name;
-			startInfo.Arguments = args;
-			startInfo.WorkingDirectory = workdir;
-
-			_process.StartInfo = startInfo;
-			_process.Start();
-		}
-	}
-}

+ 0 - 35
tools/core/Lua.cs

@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using System;
-
-namespace Crown
-{
-	/// <summary>
-	/// Functions to encode C# types to Lua.
-	/// </summary>
-	public static class Lua
-	{
-		public static string FromBool(bool b)
-		{
-			return b == true ? "true" : "false";
-		}
-
-		public static string FromVector2(Vector2 v)
-		{
-			return string.Format("Vector2({0}, {1})", v.x, v.y);
-		}
-
-		public static string FromVector3(Vector3 v)
-		{
-			return string.Format("Vector3({0}, {1}, {2})", v.x, v.y, v.z);
-		}
-
-		public static string FromQuaternion(Quaternion q)
-		{
-			return string.Format("Quaternion.from_elements({0}, {1}, {2}, {3})", q.x, q.y, q.z, q.w);
-		}
-	}
-}

+ 0 - 27
tools/core/Properties/AssemblyInfo.cs

@@ -1,27 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following attributes.
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle ("core")]
-[assembly: AssemblyDescription ("")]
-[assembly: AssemblyConfiguration ("")]
-[assembly: AssemblyCompany ("")]
-[assembly: AssemblyProduct ("")]
-[assembly: AssemblyCopyright ("Copyright (c) 2012-2016 Daniele Bartolini and individual contributors. License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2")]
-[assembly: AssemblyTrademark ("")]
-[assembly: AssemblyCulture ("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion ("1.0.*")]
-
-// The following attributes are used to specify the signing key for the assembly,
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]
-

+ 0 - 307
tools/core/json/JSON.cs

@@ -1,307 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-/*
- * Public Domain Niklas Frykholm
- */
-
-using System.Collections.Generic;
-using System.Collections;
-using System.Linq;
-using System.Text;
-using System;
-
-namespace Crown
-{
-	/// <summary>
-	/// Provides functions for encoding and decoding files in the JSON format.
-	/// </summary>
-	public class JSON
-	{
-		/// <summary>
-		///  Encodes the hashtable t in the JSON format. The hash table can
-		///  contain, numbers, bools, strings, ArrayLists and Hashtables.
-		/// </summary>
-		public static string Encode(object t)
-		{
-			StringBuilder builder = new StringBuilder();
-			Write(t, builder, 0);
-			builder.AppendLine();
-			return builder.ToString();
-		}
-
-		/// <summary>
-		/// Decodes a JSON bytestream into a hash table with numbers, bools, strings,
-		/// ArrayLists and Hashtables.
-		/// </summary>
-		public static object Decode(byte[] sjson)
-		{
-			int index = 0;
-			return Parse(sjson, ref index);
-		}
-
-		/// <summary>
-		/// Convenience function for loading a file.
-		/// </summary>
-		public static Hashtable Load(string path)
-		{
-			System.IO.FileStream fs = System.IO.File.Open(path, System.IO.FileMode.Open, System.IO.FileAccess.Read);
-			byte[] bytes = new byte[fs.Length];
-			fs.Read(bytes, 0, bytes.Length);
-			fs.Close();
-			return Decode(bytes) as Hashtable;
-		}
-
-		/// <summary>
-		/// Convenience function for saving a file.
-		/// </summary>
-		public static void Save(Hashtable h, string path)
-		{
-			string s = Encode(h);
-			System.IO.FileStream fs = System.IO.File.Open(path, System.IO.FileMode.Create);
-			byte[] bytes = System.Text.Encoding.UTF8.GetBytes(s);
-			fs.Write(bytes, 0, bytes.Count());
-			fs.Close();
-		}
-
-		static void WriteNewLine(StringBuilder builder, int indentation)
-		{
-			builder.Append('\n');
-			for (int i = 0; i < indentation; ++i)
-				builder.Append('\t');
-		}
-
-		static void Write(object o, StringBuilder builder, int indentation)
-		{
-			if (o == null)
-				builder.Append("null");
-			else if (o is Boolean && (bool)o == false)
-				builder.Append("false");
-			else if (o is Boolean)
-				builder.Append("true");
-			else if (o is int)
-				builder.Append((int)o);
-			else if (o is float)
-				builder.Append((float)o);
-			else if (o is double)
-				builder.Append((double)o);
-			else if (o is string)
-				WriteString((String)o, builder);
-			else if (o is ArrayList)
-				WriteArray((ArrayList)o, builder, indentation);
-			else if (o is Hashtable)
-				WriteObject((Hashtable)o, builder, indentation);
-			else
-				throw new ArgumentException("Unknown object");
-		}
-
-		static void WriteString(String s, StringBuilder builder)
-		{
-			builder.Append('"');
-			for (int i = 0; i < s.Length; ++i)
-			{
-				Char c = s[i];
-				if (c == '"' || c == '\\')
-				{
-					builder.Append('\\');
-					builder.Append(c);
-				}
-				else if (c == '\n')
-				{
-					builder.Append('\\');
-					builder.Append('n');
-				}
-				else
-					builder.Append(c);
-			}
-			builder.Append('"');
-		}
-
-		static void WriteArray(ArrayList a, StringBuilder builder, int indentation)
-		{
-			bool write_comma = false;
-			builder.Append("[ ");
-			foreach (object item in a)
-			{
-				if (write_comma)
-					builder.Append(", ");
-				Write(item, builder, indentation + 1);
-				write_comma = true;
-			}
-			builder.Append("]");
-		}
-
-		static void WriteObject(Hashtable t, StringBuilder builder, int indentation)
-		{
-			builder.Append('{');
-			bool write_comma = false;
-			foreach (DictionaryEntry de in t)
-			{
-				if (write_comma)
-					builder.Append(", ");
-				WriteNewLine(builder, indentation);
-				Write(de.Key, builder, indentation);
-				builder.Append(" : ");
-				Write(de.Value, builder, indentation);
-				write_comma = true;
-
-			}
-			WriteNewLine(builder, indentation);
-			builder.Append('}');
-		}
-
-		static bool AtEnd(byte[] json, ref int index)
-		{
-			SkipWhitespace(json, ref index);
-			return (index >= json.Length);
-		}
-
-		static void SkipWhitespace(byte[] json, ref int index)
-		{
-			while (index < json.Length)
-			{
-				byte c = json[index];
-				if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',')
-					++index;
-				else
-					break;
-			}
-		}
-
-		static void Consume(byte[] json, ref int index, String consume)
-		{
-			SkipWhitespace(json, ref index);
-			for (int i = 0; i < consume.Length; ++i)
-			{
-				if (json[index] != consume[i])
-					throw new FormatException();
-				++index;
-			}
-		}
-
-		static object Parse(byte[] json, ref int index)
-		{
-			byte c = Next(json, ref index);
-
-			if (c == '{')
-				return ParseObject(json, ref index);
-			else if (c == '[')
-				return ParseArray(json, ref index);
-			else if (c == '"')
-				return ParseString(json, ref index);
-			else if (c == '-' || c >= '0' && c <= '9')
-				return ParseNumber(json, ref index);
-			else if (c == 't')
-			{
-				Consume(json, ref index, "true");
-				return true;
-			}
-			else if (c == 'f')
-			{
-				Consume(json, ref index, "false");
-				return false;
-			}
-			else if (c == 'n')
-			{
-				Consume(json, ref index, "null");
-				return null;
-			}
-			else
-				throw new FormatException();
-		}
-
-		static byte Next(byte[] json, ref int index)
-		{
-			SkipWhitespace(json, ref index);
-			return json[index];
-		}
-
-		static Hashtable ParseObject(byte[] json, ref int index)
-		{
-			Hashtable ht = new Hashtable();
-			Consume(json, ref index, "{");
-			SkipWhitespace(json, ref index);
-
-			while (Next(json, ref index) != '}')
-			{
-				String key = ParseString(json, ref index);
-				Consume(json, ref index, ":");
-				if (key.EndsWith("_binary"))
-					ht[key] = ParseBinary(json, ref index);
-				else
-					ht[key] = Parse(json, ref index);
-			}
-			Consume(json, ref index, "}");
-			return ht;
-		}
-
-		static ArrayList ParseArray(byte[] json, ref int index)
-		{
-			ArrayList a = new ArrayList();
-			Consume(json, ref index, "[");
-			while (Next(json, ref index) != ']')
-			{
-				object value = Parse(json, ref index);
-				a.Add(value);
-			}
-			Consume(json, ref index, "]");
-			return a;
-		}
-
-		static byte[] ParseBinary(byte[] json, ref int index)
-		{
-			List<byte> s = new List<byte>();
-
-			Consume(json, ref index, "\"");
-			while (true)
-			{
-				byte c = json[index];
-				++index;
-				if (c == '"')
-					break;
-				else if (c != '\\')
-					s.Add(c);
-				else
-				{
-					byte q = json[index];
-					++index;
-					if (q == '"' || q == '\\' || q == '/')
-						s.Add(q);
-					else if (q == 'b') s.Add((byte)'\b');
-					else if (q == 'f') s.Add((byte)'\f');
-					else if (q == 'n') s.Add((byte)'\n');
-					else if (q == 'r') s.Add((byte)'\r');
-					else if (q == 't') s.Add((byte)'\t');
-					else if (q == 'u')
-					{
-						throw new FormatException();
-					}
-					else
-					{
-						throw new FormatException();
-					}
-				}
-			}
-			return s.ToArray();
-		}
-
-		static String ParseString(byte[] json, ref int index)
-		{
-			return new UTF8Encoding().GetString(ParseBinary(json, ref index));
-		}
-
-		static Double ParseNumber(byte[] json, ref int index)
-		{
-			int end = index;
-			while ("0123456789+-.eE".IndexOf((char)json[end]) != -1)
-				++end;
-			byte[] num = new byte[end - index];
-			Array.Copy(json, index, num, 0, num.Length);
-			index = end;
-			String numstr = new UTF8Encoding().GetString(num);
-			return Double.Parse(numstr);
-		}
-	}
-}

+ 0 - 347
tools/core/json/SJSON.cs

@@ -1,347 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-/*
- * Public Domain Niklas Frykholm
- */
-
-using System.Collections.Generic;
-using System.Collections;
-using System.Linq;
-using System.Text;
-using System;
-
-namespace Crown
-{
-	/// <summary>
-	/// Provides functions for encoding and decoding files in the simplified JSON format.
-	/// </summary>
-	public class SJSON
-	{
-		/// <summary>
-		///  Encodes the Hashtable t in the simplified JSON format. The Hashtable can
-		///  contain, numbers, bools, strings, ArrayLists and Hashtables.
-		/// </summary>
-		public static string Encode(Hashtable t)
-		{
-			StringBuilder builder = new StringBuilder();
-			WriteRootObject(t, builder);
-			builder.AppendLine();
-			return builder.ToString();
-		}
-
-		/// <summary>
-		/// Encodes the object o in the simplified JSON format (not as a root object).
-		/// </summary>
-		/// <returns></returns>
-		public static string EncodeObject(object o)
-		{
-			StringBuilder builder = new StringBuilder();
-			Write(o, builder, 0);
-			return builder.ToString();
-		}
-
-		/// <summary>
-		/// Decodes a SJSON bytestream into a Hashtable with numbers, bools, strings,
-		/// ArrayLists and Hashtables.
-		/// </summary>
-		public static Hashtable Decode(byte[] sjson)
-		{
-			int index = 0;
-			return ParseRootObject(sjson, ref index);
-		}
-
-		/// <summary>
-		/// Convenience function for loading a file.
-		/// </summary>
-		public static Hashtable Load(string path)
-		{
-			System.IO.FileStream fs = System.IO.File.Open(path, System.IO.FileMode.Open, System.IO.FileAccess.Read);
-			byte[] bytes = new byte[fs.Length];
-			fs.Read(bytes, 0, bytes.Length);
-			fs.Close();
-			return Decode(bytes);
-		}
-
-		/// <summary>
-		/// Convenience function for saving a file.
-		/// </summary>
-		public static void Save(Hashtable h, string path)
-		{
-			string s = Encode(h);
-			System.IO.FileStream fs = System.IO.File.Open(path, System.IO.FileMode.Create);
-			byte[] bytes = System.Text.Encoding.UTF8.GetBytes(s);
-			fs.Write(bytes, 0, bytes.Count());
-			fs.Close();
-		}
-
-		static void WriteRootObject(Hashtable t, StringBuilder builder)
-		{
-		   WriteObjectFields(t, builder, 0);
-		}
-
-		static void WriteObjectFields(Hashtable t, StringBuilder builder, int indentation)
-		{
-			List<string> keys = t.Keys.Cast<string>().ToList();
-			keys.Sort();
-			foreach (string key in keys) {
-				WriteNewLine(builder, indentation);
-				builder.Append(key);
-				builder.Append(" = ");
-				Write(t[key], builder, indentation);
-			}
-		}
-
-		static void WriteNewLine(StringBuilder builder, int indentation)
-		{
-			builder.Append('\n');
-			for (int i = 0; i < indentation; ++i)
-				builder.Append('\t');
-		}
-
-		static void Write(object o, StringBuilder builder, int indentation)
-		{
-			if (o == null)
-				builder.Append("null");
-			else if (o is Boolean && (bool)o == false)
-				builder.Append("false");
-			else if (o is Boolean)
-				builder.Append("true");
-			else if (o is byte)
-				builder.Append((byte)o);
-			else if (o is int)
-				builder.Append((int)o);
-			else if (o is float)
-				builder.Append((float)o);
-			else if (o is double)
-				builder.Append((double)o);
-			else if (o is string)
-				WriteString((String)o, builder);
-			else if (o is ArrayList)
-				WriteArray((ArrayList)o, builder, indentation);
-			else if (o is Hashtable)
-				WriteObject((Hashtable)o, builder, indentation);
-			else
-				throw new ArgumentException("Unknown object");
-		}
-
-		static void WriteString(String s, StringBuilder builder)
-		{
-			builder.Append('"');
-			for (int i=0; i<s.Length; ++i) {
-				Char c = s[i];
-				if (c == '"' || c == '\\')
-					builder.Append('\\');
-				builder.Append(c);
-			}
-			builder.Append('"');
-		}
-
-		static void WriteArray(ArrayList a, StringBuilder builder, int indentation)
-		{
-			builder.Append('[');
-			foreach (object item in a) {
-				builder.Append(' ');
-				Write(item, builder, indentation+1);
-			}
-			builder.Append(" ]");
-		}
-
-		static void WriteObject(Hashtable t, StringBuilder builder, int indentation)
-		{
-			builder.Append('{');
-			WriteObjectFields(t, builder, indentation+1);
-			WriteNewLine(builder, indentation);
-			builder.Append('}');
-		}
-
-		static Hashtable ParseRootObject(byte [] json, ref int index)
-		{
-			Hashtable ht = new Hashtable();
-			while (!AtEnd(json, ref index)) {
-				String key = ParseIdentifier(json, ref index);
-				Consume(json, ref index, "=");
-				object value = ParseValue(json, ref index);
-				ht[key] = value;
-			}
-			return ht;
-		}
-
-		static bool AtEnd(byte [] json, ref int index)
-		{
-			SkipWhitespace(json, ref index);
-			return (index >= json.Length);
-		}
-
-		static void SkipWhitespace(byte [] json, ref int index)
-		{
-			while (index < json.Length) {
-				byte c = json[index];
-				if (c == '/')
-					SkipComment(json, ref index);
-				else if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',')
-					++index;
-				else
-					break;
-			}
-		}
-
-		static void SkipComment(byte [] json, ref int index)
-		{
-			byte next = json[index + 1];
-			if (next == '/')
-			{
-				while (index + 1 < json.Length && json[index] != '\n')
-					++index;
-				++index;
-			}
-			else if (next == '*')
-			{
-				while (index + 2 < json.Length && (json[index] != '*' || json[index + 1] != '/'))
-					++index;
-				index += 2;
-			}
-			else
-				throw new FormatException();
-		}
-
-		static String ParseIdentifier(byte [] json, ref int index)
-		{
-			SkipWhitespace(json, ref index);
-
-			if (json[index] == '"')
-				return ParseString(json, ref index);
-
-			List<byte> s = new List<byte>();
-			while (true) {
-				byte c = json[index];
-				if (c == ' ' || c == '\t' || c == '\n' || c == '=')
-					break;
-				s.Add(c);
-				++index;
-			}
-			return new UTF8Encoding().GetString(s.ToArray());
-		}
-
-		static void Consume(byte [] json, ref int index, String consume)
-		{
-			SkipWhitespace(json, ref index);
-			for (int i=0; i<consume.Length; ++i) {
-				if (json[index] != consume[i])
-					throw new FormatException();
-				++index;
-			}
-		}
-
-		static object ParseValue(byte [] json, ref int index)
-		{
-			byte c = Next(json, ref index);
-
-			if (c == '{')
-				return ParseObject(json, ref index);
-			else if (c == '[')
-				return ParseArray(json, ref index);
-			else if (c == '"')
-				return ParseString(json, ref index);
-			else if (c == '-' || c >= '0' && c <= '9')
-				return ParseNumber(json, ref index);
-			else if (c == 't')
-			{
-				Consume(json, ref index, "true");
-				return true;
-			}
-			else if (c == 'f')
-			{
-				Consume(json, ref index, "false");
-				return false;
-			}
-			else if (c == 'n')
-			{
-				Consume(json, ref index, "null");
-				return null;
-			}
-			else
-				throw new FormatException();
-		}
-
-		static byte Next(byte [] json, ref int index)
-		{
-			SkipWhitespace(json, ref index);
-			return json[index];
-		}
-
-		static Hashtable ParseObject(byte [] json, ref int index)
-		{
-			Hashtable ht = new Hashtable();
-			Consume(json, ref index, "{");
-			SkipWhitespace(json, ref index);
-
-			while (Next(json, ref index) != '}') {
-				String key = ParseIdentifier(json, ref index);
-				Consume(json, ref index, "=");
-				object value = ParseValue(json, ref index);
-				ht[key] = value;
-			}
-			Consume(json, ref index, "}");
-			return ht;
-		}
-
-		static ArrayList ParseArray(byte [] json, ref int index)
-		{
-			ArrayList a = new ArrayList();
-			Consume(json, ref index, "[");
-			while (Next(json, ref index) != ']') {
-				object value = ParseValue(json, ref index);
-				a.Add(value);
-			}
-			Consume(json, ref index, "]");
-			return a;
-		}
-
-		static String ParseString(byte[] json, ref int index)
-		{
-			List<byte> s = new List<byte>();
-
-			Consume(json, ref index, "\"");
-			while (true) {
-				byte c = json[index];
-				++index;
-				if (c == '"')
-					break;
-				else if (c != '\\')
-					s.Add(c);
-				else {
-					byte q = json[index];
-					++index;
-					if (q == '"' || q == '\\' || q == '/')
-						s.Add(q);
-					else if (q == 'b') s.Add((byte)'\b');
-					else if (q == 'f') s.Add((byte)'\f');
-					else if (q == 'n') s.Add((byte)'\n');
-					else if (q == 'r') s.Add((byte)'\r');
-					else if (q == 't') s.Add((byte)'\t');
-					else if (q == 'u')  {
-						throw new FormatException();
-					} else {
-						throw new FormatException();
-					}
-				}
-			}
-			return new UTF8Encoding().GetString(s.ToArray());
-		}
-
-		static Double ParseNumber(byte[] json, ref int index)
-		{
-			int end = index;
-			while (end < json.Length && "0123456789+-.eE".IndexOf((char)json[end]) != -1)
-				++end;
-			byte[] num = new byte[end - index];
-			Array.Copy(json, index, num, 0, num.Length);
-			index = end;
-			String numstr = new UTF8Encoding().GetString(num);
-			return Double.Parse(numstr);
-		}
-	}
-}

+ 0 - 29
tools/core/math/MathUtils.cs

@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using System;
-
-namespace Crown
-{
-	public static class MathUtils
-	{
-		public static bool Equal(double a, double b, double epsilon = 0.00001f)
-		{
-			return b <= (a + epsilon)
-				&& b >= (a - epsilon)
-				;
-		}
-
-		public static double Rad(double deg)
-		{
-			return deg * Math.PI / 180.0;
-		}
-
-		public static double Deg(double rad)
-		{
-			return rad * 180.0 / Math.PI;
-		}
-	}
-}

+ 0 - 22
tools/core/math/Matrix4x4.cs

@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using System;
-
-namespace Crown
-{
-	public struct Matrix4x4
-	{
-		public Vector4 x, y, z, t;
-
-		public Matrix4x4(Vector4 x, Vector4 y, Vector4 z, Vector4 t)
-		{
-			this.x = x;
-			this.y = y;
-			this.z = z;
-			this.t = t;
-		}
-	}
-}

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

@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using System.Collections;
-using System;
-
-namespace Crown
-{
-	public struct Quaternion
-	{
-		public double x, y, z, w;
-
-		public Quaternion(double x, double y, double z, double w)
-		{
-			this.x = x;
-			this.y = y;
-			this.z = z;
-			this.w = w;
-		}
-
-		public Quaternion(ArrayList arr)
-		{
-			this.x = (double)arr[0];
-			this.y = (double)arr[1];
-			this.z = (double)arr[2];
-			this.w = (double)arr[3];
-		}
-
-		public Quaternion(Vector3 axis, float angle)
-		{
-			double ha = angle * 0.5;
-			double sa = Math.Sin(ha);
-			double ca = Math.Cos(ha);
-			this.x = axis.x * sa;
-			this.y = axis.y * sa;
-			this.z = axis.z * sa;
-			this.w = ca;
-		}
-
-		public static Quaternion FromEuler(double rx, double ry, double rz)
-		{
-			// http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/
-			double c1 = Math.Cos(ry*0.5);
-			double s1 = Math.Sin(ry*0.5);
-			double c2 = Math.Cos(rz*0.5);
-			double s2 = Math.Sin(rz*0.5);
-			double c3 = Math.Cos(rx*0.5);
-			double s3 = Math.Sin(rx*0.5);
-			double c1c2 = c1*c2;
-			double s1s2 = s1*s2;
-
-			double nw = c1c2*c3 - s1s2*s3;
-			double nx = c1c2*s3 + s1s2*c3;
-			double ny = s1*c2*c3 + c1*s2*s3;
-			double nz = c1*s2*c3 - s1*c2*s3;
-
-			return new Quaternion(nx, ny, nz, nw);
-		}
-
-		public Vector3 ToEuler()
-		{
-			// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/
-			double test = x*y + z*w;
-			if (test > 0.499)
-			{ // singularity at north pole
-				double rx = 0.0;
-				double ry = 2.0 * Math.Atan2(x, w);
-				double rz = Math.PI*0.5;
-				return new Vector3(rx, ry, rz);
-			}
-			if (test < -0.499)
-			{ // singularity at south pole
-				double rx = +0.0;
-				double ry = -2.0 * Math.Atan2(x, w);
-				double rz = -Math.PI*0.5;
-				return new Vector3(rx, ry, rz);
-			}
-			double xx = x*x;
-			double yy = y*y;
-			double zz = z*z;
-
-			double rrx = Math.Atan2(2.0*x*w - 2.0*y*z, 1.0 - 2.0*xx - 2.0*zz);
-			double rry = Math.Atan2(2.0*y*w - 2.0*x*z, 1.0 - 2.0*yy - 2.0*zz);
-			double rrz = Math.Asin(2.0*test);
-
-			return new Vector3(rrx, rry, rrz);
-		}
-
-		public override string ToString()
-		{
-			return string.Format("{0}, {1}, {2}, {3}", x, y, z, w);
-		}
-	}
-}

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

@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using System.Collections;
-using System;
-
-namespace Crown
-{
-	public struct Vector2
-	{
-		public double x, y;
-
-		public Vector2(double x, double y)
-		{
-			this.x = x;
-			this.y = y;
-		}
-
-		public Vector2(ArrayList arr)
-		{
-			this.x = (double)arr[0];
-			this.y = (double)arr[1];
-		}
-
-		public static Vector2 operator+(Vector2 a, Vector2 b)
-		{
-			return new Vector2(a.x + b.x, a.y + b.y);
-		}
-
-		public static Vector2 operator-(Vector2 a, Vector2 b)
-		{
-			return new Vector2(a.x - b.x, a.y - b.y);
-		}
-
-		public static Vector2 operator*(Vector2 a, float k)
-		{
-			return new Vector2(a.x * k, a.y * k);
-		}
-
-		public static Vector2 operator*(float k, Vector2 a)
-		{
-			return a * k;
-		}
-
-		public override string ToString()
-		{
-			return string.Format("{0}, {1}", x, y);
-		}
-	}
-}

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

@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using System.Collections;
-using System;
-
-namespace Crown
-{
-	public struct Vector3
-	{
-		public double x, y, z;
-
-		public Vector3(double x, double y, double z)
-		{
-			this.x = x;
-			this.y = y;
-			this.z = z;
-		}
-
-		public Vector3(ArrayList arr)
-		{
-			this.x = (double)arr[0];
-			this.y = (double)arr[1];
-			this.z = (double)arr[2];
-		}
-
-		public static Vector3 operator+(Vector3 a, Vector3 b)
-		{
-			return new Vector3(a.x + b.x, a.y + b.y, a.z + b.z);
-		}
-
-		public static Vector3 operator-(Vector3 a, Vector3 b)
-		{
-			return new Vector3(a.x - b.x, a.y - b.y, a.z - b.z);
-		}
-
-		public static Vector3 operator*(Vector3 a, float k)
-		{
-			return new Vector3(a.x * k, a.y * k, a.z * k);
-		}
-
-		public static Vector3 operator*(float k, Vector3 a)
-		{
-			return a * k;
-		}
-
-		public override string ToString()
-		{
-			return string.Format("{0}, {1}, {2}", x, y, z);
-		}
-	}
-}

+ 0 - 56
tools/core/math/Vector4.cs

@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using System.Collections;
-using System;
-
-namespace Crown
-{
-	public struct Vector4
-	{
-		public double x, y, z, w;
-
-		public Vector4(double x, double y, double z, double w)
-		{
-			this.x = x;
-			this.y = y;
-			this.z = z;
-			this.w = w;
-		}
-
-		public Vector4(ArrayList arr)
-		{
-			this.x = (double)arr[0];
-			this.y = (double)arr[1];
-			this.z = (double)arr[2];
-			this.w = (double)arr[3];
-		}
-
-		public static Vector4 operator+(Vector4 a, Vector4 b)
-		{
-			return new Vector4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
-		}
-
-		public static Vector4 operator-(Vector4 a, Vector4 b)
-		{
-			return new Vector4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
-		}
-
-		public static Vector4 operator*(Vector4 a, float k)
-		{
-			return new Vector4(a.x * k, a.y * k, a.z * k, a.w * k);
-		}
-
-		public static Vector4 operator*(float k, Vector4 a)
-		{
-			return a * k;
-		}
-
-		public override string ToString()
-		{
-			return string.Format("{0}, {1}, {2}, {3}", x, y, z, w);
-		}
-	}
-}

+ 0 - 166
tools/tools.sln

@@ -1,166 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "core", "core\core.csproj", "{E591C9C0-C1CF-43F3-92C1-7E9F3B3602B9}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{E591C9C0-C1CF-43F3-92C1-7E9F3B3602B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{E591C9C0-C1CF-43F3-92C1-7E9F3B3602B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{E591C9C0-C1CF-43F3-92C1-7E9F3B3602B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{E591C9C0-C1CF-43F3-92C1-7E9F3B3602B9}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(MonoDevelopProperties) = preSolution
-		Policies = $0
-		$0.DotNetNamingPolicy = $1
-		$1.DirectoryNamespaceAssociation = None
-		$1.ResourceNamePolicy = FileFormatDefault
-		$0.TextStylePolicy = $2
-		$2.inheritsSet = null
-		$2.scope = text/x-csharp
-		$0.CSharpFormattingPolicy = $3
-		$3.AfterDelegateDeclarationParameterComma = True
-		$3.inheritsSet = Mono
-		$3.inheritsScope = text/x-csharp
-		$3.scope = text/x-csharp
-		$0.TextStylePolicy = $4
-		$4.FileWidth = 120
-		$4.TabsToSpaces = False
-		$4.inheritsSet = VisualStudio
-		$4.inheritsScope = text/plain
-		$4.scope = text/plain
-		$0.StandardHeader = $5
-		$5.Text = 
-		$5.IncludeInNewFiles = True
-		$0.NameConventionPolicy = $6
-		$6.Rules = $7
-		$7.NamingRule = $8
-		$8.Name = Namespaces
-		$8.AffectedEntity = Namespace
-		$8.VisibilityMask = VisibilityMask
-		$8.NamingStyle = PascalCase
-		$8.IncludeInstanceMembers = True
-		$8.IncludeStaticEntities = True
-		$7.NamingRule = $9
-		$9.Name = Types
-		$9.AffectedEntity = Class, Struct, Enum, Delegate
-		$9.VisibilityMask = Public
-		$9.NamingStyle = PascalCase
-		$9.IncludeInstanceMembers = True
-		$9.IncludeStaticEntities = True
-		$7.NamingRule = $10
-		$10.Name = Interfaces
-		$10.RequiredPrefixes = $11
-		$11.String = I
-		$10.AffectedEntity = Interface
-		$10.VisibilityMask = Public
-		$10.NamingStyle = PascalCase
-		$10.IncludeInstanceMembers = True
-		$10.IncludeStaticEntities = True
-		$7.NamingRule = $12
-		$12.Name = Attributes
-		$12.RequiredSuffixes = $13
-		$13.String = Attribute
-		$12.AffectedEntity = CustomAttributes
-		$12.VisibilityMask = Public
-		$12.NamingStyle = PascalCase
-		$12.IncludeInstanceMembers = True
-		$12.IncludeStaticEntities = True
-		$7.NamingRule = $14
-		$14.Name = Event Arguments
-		$14.RequiredSuffixes = $15
-		$15.String = EventArgs
-		$14.AffectedEntity = CustomEventArgs
-		$14.VisibilityMask = Public
-		$14.NamingStyle = PascalCase
-		$14.IncludeInstanceMembers = True
-		$14.IncludeStaticEntities = True
-		$7.NamingRule = $16
-		$16.Name = Exceptions
-		$16.RequiredSuffixes = $17
-		$17.String = Exception
-		$16.AffectedEntity = CustomExceptions
-		$16.VisibilityMask = VisibilityMask
-		$16.NamingStyle = PascalCase
-		$16.IncludeInstanceMembers = True
-		$16.IncludeStaticEntities = True
-		$7.NamingRule = $18
-		$18.Name = Methods
-		$18.AffectedEntity = Methods
-		$18.VisibilityMask = Protected, Public
-		$18.NamingStyle = PascalCase
-		$18.IncludeInstanceMembers = True
-		$18.IncludeStaticEntities = True
-		$7.NamingRule = $19
-		$19.Name = Static Readonly Fields
-		$19.AffectedEntity = ReadonlyField
-		$19.VisibilityMask = Protected, Public
-		$19.NamingStyle = PascalCase
-		$19.IncludeInstanceMembers = False
-		$19.IncludeStaticEntities = True
-		$7.NamingRule = $20
-		$20.Name = Fields
-		$20.AffectedEntity = Field
-		$20.VisibilityMask = Protected, Public
-		$20.NamingStyle = PascalCase
-		$20.IncludeInstanceMembers = True
-		$20.IncludeStaticEntities = True
-		$7.NamingRule = $21
-		$21.Name = ReadOnly Fields
-		$21.AffectedEntity = ReadonlyField
-		$21.VisibilityMask = Protected, Public
-		$21.NamingStyle = PascalCase
-		$21.IncludeInstanceMembers = True
-		$21.IncludeStaticEntities = False
-		$7.NamingRule = $22
-		$22.Name = Constant Fields
-		$22.AffectedEntity = ConstantField
-		$22.VisibilityMask = Protected, Public
-		$22.NamingStyle = PascalCase
-		$22.IncludeInstanceMembers = True
-		$22.IncludeStaticEntities = True
-		$7.NamingRule = $23
-		$23.Name = Properties
-		$23.AffectedEntity = Property
-		$23.VisibilityMask = Protected, Public
-		$23.NamingStyle = PascalCase
-		$23.IncludeInstanceMembers = True
-		$23.IncludeStaticEntities = True
-		$7.NamingRule = $24
-		$24.Name = Events
-		$24.AffectedEntity = Event
-		$24.VisibilityMask = Protected, Public
-		$24.NamingStyle = PascalCase
-		$24.IncludeInstanceMembers = True
-		$24.IncludeStaticEntities = True
-		$7.NamingRule = $25
-		$25.Name = Enum Members
-		$25.AffectedEntity = EnumMember
-		$25.VisibilityMask = VisibilityMask
-		$25.NamingStyle = PascalCase
-		$25.IncludeInstanceMembers = True
-		$25.IncludeStaticEntities = True
-		$7.NamingRule = $26
-		$26.Name = Parameters
-		$26.AffectedEntity = Parameter
-		$26.VisibilityMask = VisibilityMask
-		$26.NamingStyle = CamelCase
-		$26.IncludeInstanceMembers = True
-		$26.IncludeStaticEntities = True
-		$7.NamingRule = $27
-		$27.Name = Type Parameters
-		$27.RequiredPrefixes = $28
-		$28.String = T
-		$27.AffectedEntity = TypeParameter
-		$27.VisibilityMask = VisibilityMask
-		$27.NamingStyle = PascalCase
-		$27.IncludeInstanceMembers = True
-		$27.IncludeStaticEntities = True
-		$0.VersionControlPolicy = $29
-		$29.inheritsSet = Mono
-	EndGlobalSection
-EndGlobal

+ 0 - 67
tools/widgets/DoubleSpinButton.cs

@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using Gtk;
-using System;
-
-namespace Crown
-{
-	public delegate void DoubleValueChanged(object o, EventArgs args);
-
-	/// <summary>
-	/// Double spin button.
-	/// </summary>
-	public class DoubleSpinButton : Gtk.HBox
-	{
-		// Data
-		private bool _stop_emit;
-
-		// Widgets
-		private Gtk.SpinButton _x;
-
-		public double Value
-		{
-			get
-			{
-				return _x.Value;
-			}
-			set
-			{
-				_stop_emit = true;
-				_x.Value = value;
-				_stop_emit = false;
-			}
-		}
-
-		// Events
-		public event Vector2ValueChanged ValueChanged;
-
-		public DoubleSpinButton(double x, double min, double max) : base()
-		{
-			// Data
-			_stop_emit = false;
-
-			// Widgets
-			_x = new SpinButton(new Adjustment(x, min, max, 1.0, 10.0, 0.0), 1.0, 4);
-
-			_x.ValueChanged += new EventHandler(OnValueChanged);
-
-			Add(_x);
-		}
-
-		private void OnValueChanged(object o, EventArgs args)
-		{
-			if (!_stop_emit)
-				EmitValueChanged(this, args);
-		}
-
-		// Events
-		private void EmitValueChanged(object o, EventArgs args)
-		{
-			if (ValueChanged != null)
-				ValueChanged(o, args);
-		}
-	}
-}

+ 0 - 81
tools/widgets/RotationSpinButton.cs

@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using Gtk;
-using System;
-
-namespace Crown
-{
-	public delegate void RotationChanged(object o, EventArgs args);
-
-	/// <summary>
-	/// Vector3 spin button.
-	/// </summary>
-	public class RotationSpinButton : Gtk.HBox
-	{
-		// Data
-		private bool _stop_emit;
-
-		// Widgets
-		private Gtk.SpinButton _x;
-		private Gtk.SpinButton _y;
-		private Gtk.SpinButton _z;
-
-		public Quaternion Value
-		{
-			get
-			{
-				double x = MathUtils.Rad(_x.Value);
-				double y = MathUtils.Rad(_y.Value);
-				double z = MathUtils.Rad(_z.Value);
-				return Quaternion.FromEuler(x, y, z);
-			}
-			set
-			{
-				_stop_emit = true;
-				Vector3 euler = ((Quaternion)value).ToEuler();
-				_x.Value = MathUtils.Deg(euler.x);
-				_y.Value = MathUtils.Deg(euler.y);
-				_z.Value = MathUtils.Deg(euler.z);
-				_stop_emit = false;
-			}
-		}
-
-		// Events
-		public event RotationChanged ValueChanged;
-
-		public RotationSpinButton(Vector3 xyz) : base()
-		{
-			// Data
-			_stop_emit = false;
-
-			// Widgets
-			_x = new SpinButton(new Adjustment(xyz.x, -180.0, 180.0, 1.0, 10.0, 0.0), 1.0, 4);
-			_y = new SpinButton(new Adjustment(xyz.y, -180.0, 180.0, 1.0, 10.0, 0.0), 1.0, 4);
-			_z = new SpinButton(new Adjustment(xyz.z, -180.0, 180.0, 1.0, 10.0, 0.0), 1.0, 4);
-
-			_x.ValueChanged += new EventHandler(OnValueChanged);
-			_y.ValueChanged += new EventHandler(OnValueChanged);
-			_z.ValueChanged += new EventHandler(OnValueChanged);
-
-			Add(_x);
-			Add(_y);
-			Add(_z);
-		}
-
-		private void OnValueChanged(object o, EventArgs args)
-		{
-			if (!_stop_emit)
-				EmitValueChanged(this, args);
-		}
-
-		// Events
-		private void EmitValueChanged(object o, EventArgs args)
-		{
-			if (ValueChanged != null)
-				ValueChanged(o, args);
-		}
-	}
-}

+ 0 - 73
tools/widgets/Vector2SpinButton.cs

@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using Gtk;
-using System;
-
-namespace Crown
-{
-	public delegate void Vector2ValueChanged(object o, EventArgs args);
-
-	/// <summary>
-	/// Vector2 spin button.
-	/// </summary>
-	public class Vector2SpinButton : Gtk.HBox
-	{
-		// Data
-		private bool _stop_emit;
-
-		// Widgets
-		private Gtk.SpinButton _x;
-		private Gtk.SpinButton _y;
-
-		public Vector2 Value
-		{
-			get
-			{
-				return new Vector2(_x.Value, _y.Value);
-			}
-			set
-			{
-				_stop_emit = true;
-				Vector2 val = (Vector2)value;
-				_x.Value = val.x;
-				_y.Value = val.y;
-				_stop_emit = false;
-			}
-		}
-
-		// Events
-		public event Vector2ValueChanged ValueChanged;
-
-		public Vector2SpinButton(Vector2 xyz, Vector2 min, Vector2 max) : base()
-		{
-			// Data
-			_stop_emit = false;
-
-			// Widgets
-			_x = new SpinButton(new Adjustment(xyz.x, min.x, max.x, 1.0, 10.0, 0.0), 1.0, 4);
-			_y = new SpinButton(new Adjustment(xyz.y, min.y, max.y, 1.0, 10.0, 0.0), 1.0, 4);
-
-			_x.ValueChanged += new EventHandler(OnValueChanged);
-			_y.ValueChanged += new EventHandler(OnValueChanged);
-
-			Add(_x);
-			Add(_y);
-		}
-
-		private void OnValueChanged(object o, EventArgs args)
-		{
-			if (!_stop_emit)
-				EmitValueChanged(this, args);
-		}
-
-		// Events
-		private void EmitValueChanged(object o, EventArgs args)
-		{
-			if (ValueChanged != null)
-				ValueChanged(o, args);
-		}
-	}
-}

+ 0 - 78
tools/widgets/Vector3SpinButton.cs

@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using Gtk;
-using System;
-
-namespace Crown
-{
-	public delegate void Vector3ValueChanged(object o, EventArgs args);
-
-	/// <summary>
-	/// Vector3 spin button.
-	/// </summary>
-	public class Vector3SpinButton : Gtk.HBox
-	{
-		// Data
-		private bool _stop_emit;
-
-		// Widgets
-		private Gtk.SpinButton _x;
-		private Gtk.SpinButton _y;
-		private Gtk.SpinButton _z;
-
-		public Vector3 Value
-		{
-			get
-			{
-				return new Vector3(_x.Value, _y.Value, _z.Value);
-			}
-			set
-			{
-				_stop_emit = true;
-				Vector3 val = (Vector3)value;
-				_x.Value = val.x;
-				_y.Value = val.y;
-				_z.Value = val.z;
-				_stop_emit = false;
-			}
-		}
-
-		// Events
-		public event Vector3ValueChanged ValueChanged;
-
-		public Vector3SpinButton(Vector3 xyz, Vector3 min, Vector3 max) : base()
-		{
-			// Data
-			_stop_emit = false;
-
-			// Widgets
-			_x = new SpinButton(new Adjustment(xyz.x, min.x, max.x, 1.0, 10.0, 0.0), 1.0, 4);
-			_y = new SpinButton(new Adjustment(xyz.y, min.y, max.y, 1.0, 10.0, 0.0), 1.0, 4);
-			_z = new SpinButton(new Adjustment(xyz.z, min.z, max.z, 1.0, 10.0, 0.0), 1.0, 4);
-
-			_x.ValueChanged += new EventHandler(OnValueChanged);
-			_y.ValueChanged += new EventHandler(OnValueChanged);
-			_z.ValueChanged += new EventHandler(OnValueChanged);
-
-			Add(_x);
-			Add(_y);
-			Add(_z);
-		}
-
-		private void OnValueChanged(object o, EventArgs args)
-		{
-			if (!_stop_emit)
-				EmitValueChanged(this, args);
-		}
-
-		// Events
-		private void EmitValueChanged(object o, EventArgs args)
-		{
-			if (ValueChanged != null)
-				ValueChanged(o, args);
-		}
-	}
-}

+ 0 - 83
tools/widgets/Vector4SpinButton.cs

@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
- */
-
-using Gtk;
-using System;
-
-namespace Crown
-{
-	public delegate void Vector4ValueChanged(object o, EventArgs args);
-
-	/// <summary>
-	/// Vector4 spin button.
-	/// </summary>
-	public class Vector4SpinButton : Gtk.HBox
-	{
-		// Data
-		private bool _stop_emit;
-
-		// Widgets
-		private Gtk.SpinButton _x;
-		private Gtk.SpinButton _y;
-		private Gtk.SpinButton _z;
-		private Gtk.SpinButton _w;
-
-		public Vector4 Value
-		{
-			get
-			{
-				return new Vector4(_x.Value, _y.Value, _z.Value, _w.Value);
-			}
-			set
-			{
-				_stop_emit = true;
-				Vector4 val = (Vector4)value;
-				_x.Value = val.x;
-				_y.Value = val.y;
-				_z.Value = val.z;
-				_w.Value = val.w;
-				_stop_emit = false;
-			}
-		}
-
-		// Events
-		public event Vector4ValueChanged ValueChanged;
-
-		public Vector4SpinButton(Vector4 xyz, Vector4 min, Vector4 max) : base()
-		{
-			// Data
-			_stop_emit = false;
-
-			// Widgets
-			_x = new SpinButton(new Adjustment(xyz.x, min.x, max.x, 1.0, 10.0, 0.0), 1.0, 4);
-			_y = new SpinButton(new Adjustment(xyz.y, min.y, max.y, 1.0, 10.0, 0.0), 1.0, 4);
-			_z = new SpinButton(new Adjustment(xyz.z, min.z, max.z, 1.0, 10.0, 0.0), 1.0, 4);
-			_w = new SpinButton(new Adjustment(xyz.w, min.w, max.w, 1.0, 10.0, 0.0), 1.0, 4);
-
-			_x.ValueChanged += new EventHandler(OnValueChanged);
-			_y.ValueChanged += new EventHandler(OnValueChanged);
-			_z.ValueChanged += new EventHandler(OnValueChanged);
-			_w.ValueChanged += new EventHandler(OnValueChanged);
-
-			Add(_x);
-			Add(_y);
-			Add(_z);
-			Add(_w);
-		}
-
-		private void OnValueChanged(object o, EventArgs args)
-		{
-			if (!_stop_emit)
-				EmitValueChanged(this, args);
-		}
-
-		// Events
-		private void EmitValueChanged(object o, EventArgs args)
-		{
-			if (ValueChanged != null)
-				ValueChanged(o, args);
-		}
-	}
-}