Sfoglia il codice sorgente

Refactor: Fixing mixed tabs and spaces

BearishSun 8 anni fa
parent
commit
efb1f327f6

+ 3 - 3
Source/MBansheeEngine/Math/BsRect3.cs

@@ -15,7 +15,7 @@ namespace BansheeEngine
     /// </summary>
     [StructLayout(LayoutKind.Sequential), SerializeObject]
     public struct Rect3 // Note: Must match C++ class Rect3
-	{
+    {
         /// <summary>
         /// Creates a new rectangle.
         /// </summary>
@@ -81,7 +81,7 @@ namespace BansheeEngine
         }
 
         [SerializeField]
-		private Vector3 _center;
+        private Vector3 _center;
         [SerializeField]
         private Vector3 _axisHorz;
         [SerializeField]
@@ -90,7 +90,7 @@ namespace BansheeEngine
         private float _extentHorz;
         [SerializeField]
         private float _extentVert;
-	};
+    };
 
     /** @} */
 }

+ 29 - 29
Source/MBansheeEngine/Math/Degree.cs

@@ -13,8 +13,8 @@ namespace BansheeEngine
     /// values, and conversions will be done automatically between them.
     /// </summary>
     [StructLayout(LayoutKind.Sequential), SerializeObject]
-	public struct Degree // Note: Must match C++ class Degree
-	{
+    public struct Degree // Note: Must match C++ class Degree
+    {
         [SerializeField]
         readonly float value;
 
@@ -22,10 +22,10 @@ namespace BansheeEngine
         /// Creates a new degree value.
         /// </summary>
         /// <param name="value">Value in degrees.</param>
-		public Degree(float value = 0.0f)
-	    {
-	        this.value = value;
-	    }
+        public Degree(float value = 0.0f)
+        {
+            this.value = value;
+        }
 
         /// <summary>
         /// Creates a new degree value.
@@ -61,10 +61,10 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="d">Degree value to convert.</param>
         /// <returns>Value in degrees as floating point type.</returns>
-	    public static explicit operator float(Degree d)
-	    {
+        public static explicit operator float(Degree d)
+        {
             return d.value;
-	    }
+        }
 
         /// <summary>
         /// Returns the value in degrees as a floating point type.
@@ -83,29 +83,29 @@ namespace BansheeEngine
         }
 
         public static Degree operator+(Degree a)
-	    {
-	        return a;
-	    }
+        {
+            return a;
+        }
 
-	    public static Degree operator+(Degree a, Degree b)
-	    {
-	        return new Degree(a.value + b.value);
-	    }
+        public static Degree operator+(Degree a, Degree b)
+        {
+            return new Degree(a.value + b.value);
+        }
 
         public static Degree operator+(Degree a, Radian r) 
         { 
             return new Degree (a.value + r.Degrees); 
         }
 
-	    public static Degree operator-(Degree a)
-	    {
-	        return new Degree(-a.value);
-	    }
+        public static Degree operator-(Degree a)
+        {
+            return new Degree(-a.value);
+        }
 
-	    public static Degree operator-(Degree a, Degree b)
-	    {
-	        return new Degree(a.value - b.value);
-	    }
+        public static Degree operator-(Degree a, Degree b)
+        {
+            return new Degree(a.value - b.value);
+        }
 
         public static Degree operator-(Degree a, Radian r) 
         { 
@@ -132,10 +132,10 @@ namespace BansheeEngine
             return new Degree(a.value / b.value);
         }
 
-	    public static bool operator<(Degree a, Degree b)
-	    {
-	        return a.value < b.value;
-	    }
+        public static bool operator<(Degree a, Degree b)
+        {
+            return a.value < b.value;
+        }
 
         public static bool operator>(Degree a, Degree b)
         {
@@ -186,7 +186,7 @@ namespace BansheeEngine
         {
             return value.ToString();
         }
-	};
+    };
 
     /** @} */
 }

+ 8 - 8
Source/MBansheeEngine/Math/MathEx.cs

@@ -12,14 +12,14 @@ namespace BansheeEngine
     /// Values that represent in which order are euler angles applied when used in transformations.
     /// </summary>
     public enum EulerAngleOrder
-	{
-		XYZ,
-		XZY,
-		YXZ,
-		YZX,
-		ZXY,
-		ZYX
-	};
+    {
+        XYZ,
+        XZY,
+        YXZ,
+        YZX,
+        ZXY,
+        ZYX
+    };
 
     /// <summary>
     /// Utility class providing common scalar math operations.

+ 51 - 51
Source/MBansheeEngine/Math/Matrix3.cs

@@ -19,7 +19,7 @@ namespace BansheeEngine
         /// Contains constant data that is used when calculating euler angles in a certain order.
         /// </summary>
         private struct EulerAngleOrderData
-		{
+        {
             public EulerAngleOrderData(int a, int b, int c, float sign)
             {
                 this.a = a;
@@ -28,13 +28,13 @@ namespace BansheeEngine
                 this.sign = sign;
             }
 
-			public int a, b, c;
+            public int a, b, c;
             public float sign;
-		};
+        };
 
         private static EulerAngleOrderData[] EA_LOOKUP = 
-		{ new EulerAngleOrderData(0, 1, 2, 1.0f), new EulerAngleOrderData(0, 2, 1, -1.0f), new EulerAngleOrderData(1, 0, 2, -1.0f),
-		  new EulerAngleOrderData(1, 2, 0, 1.0f), new EulerAngleOrderData(2, 0, 1,  1.0f), new EulerAngleOrderData(2, 1, 0, -1.0f) };
+        { new EulerAngleOrderData(0, 1, 2, 1.0f), new EulerAngleOrderData(0, 2, 1, -1.0f), new EulerAngleOrderData(1, 0, 2, -1.0f),
+          new EulerAngleOrderData(1, 2, 0, 1.0f), new EulerAngleOrderData(2, 0, 1,  1.0f), new EulerAngleOrderData(2, 1, 0, -1.0f) };
 
         /// <summary>
         /// A matrix with all zero values.
@@ -389,34 +389,34 @@ namespace BansheeEngine
         public Vector3 ToEulerAngles()
         {
             Radian xAngle = -MathEx.Asin(this[1, 2]);
-		    if (xAngle < MathEx.HalfPi)
-		    {
-			    if (xAngle > -MathEx.HalfPi)
-			    {
-				    Radian yAngle = MathEx.Atan2(this[0, 2], this[2, 2]);
+            if (xAngle < MathEx.HalfPi)
+            {
+                if (xAngle > -MathEx.HalfPi)
+                {
+                    Radian yAngle = MathEx.Atan2(this[0, 2], this[2, 2]);
                     Radian zAngle = MathEx.Atan2(this[1, 0], this[1, 1]);
 
                     return new Vector3(xAngle.Degrees, yAngle.Degrees, zAngle.Degrees);
-			    }
-			    else
-			    {
-				    // Note: Not an unique solution.
-			        xAngle = -MathEx.HalfPi;
+                }
+                else
+                {
+                    // Note: Not an unique solution.
+                    xAngle = -MathEx.HalfPi;
                     Radian yAngle = MathEx.Atan2(-this[0, 1], this[0, 0]);
-				    Radian zAngle = (Radian)0.0f;
+                    Radian zAngle = (Radian)0.0f;
 
                     return new Vector3(xAngle.Degrees, yAngle.Degrees, zAngle.Degrees);
-			    }
-		    }
-		    else
-		    {
-			    // Note: Not an unique solution.
+                }
+            }
+            else
+            {
+                // Note: Not an unique solution.
                 xAngle = MathEx.HalfPi;
                 Radian yAngle = MathEx.Atan2(this[0, 1], this[0, 0]);
                 Radian zAngle = (Radian)0.0f;
 
                 return new Vector3(xAngle.Degrees, yAngle.Degrees, zAngle.Degrees);
-		    }
+            }
         }
 
         /// <summary>
@@ -556,30 +556,30 @@ namespace BansheeEngine
         {
             EulerAngleOrderData l = EA_LOOKUP[(int)order];
 
-		    Matrix3[] mats = new Matrix3[3];
+            Matrix3[] mats = new Matrix3[3];
 
             float cx = MathEx.Cos(xAngle);
             float sx = MathEx.Sin(xAngle);
-		    mats[0] = new Matrix3(
-			    1.0f, 0.0f, 0.0f,
-			    0.0f, cx, -sx,
-			    0.0f, sx, cx);
+            mats[0] = new Matrix3(
+                1.0f, 0.0f, 0.0f,
+                0.0f, cx, -sx,
+                0.0f, sx, cx);
 
             float cy = MathEx.Cos(yAngle);
             float sy = MathEx.Sin(yAngle);
-		    mats[1] = new Matrix3(
-			    cy, 0.0f, sy,
-			    0.0f, 1.0f, 0.0f,
-			    -sy, 0.0f, cy);
+            mats[1] = new Matrix3(
+                cy, 0.0f, sy,
+                0.0f, 1.0f, 0.0f,
+                -sy, 0.0f, cy);
 
             float cz = MathEx.Cos(zAngle);
             float sz = MathEx.Sin(zAngle);
-		    mats[2] = new Matrix3(
-			    cz, -sz, 0.0f,
-			    sz, cz, 0.0f,
-			    0.0f, 0.0f, 1.0f);
-	
-		    return mats[l.a]*(mats[l.b]*mats[l.c]);
+            mats[2] = new Matrix3(
+                cz, -sz, 0.0f,
+                sz, cz, 0.0f,
+                0.0f, 0.0f, 1.0f);
+    
+            return mats[l.a]*(mats[l.b]*mats[l.c]);
         }
 
         /// <summary>
@@ -605,26 +605,26 @@ namespace BansheeEngine
         {
             Matrix3 m = new Matrix3();
 
-		    float cx = MathEx.Cos(xAngle);
-		    float sx = MathEx.Sin(xAngle);
+            float cx = MathEx.Cos(xAngle);
+            float sx = MathEx.Sin(xAngle);
 
-		    float cy = MathEx.Cos(yAngle);
-		    float sy = MathEx.Sin(yAngle);
+            float cy = MathEx.Cos(yAngle);
+            float sy = MathEx.Sin(yAngle);
 
             float cz = MathEx.Cos(zAngle);
-		    float sz = MathEx.Sin(zAngle);
+            float sz = MathEx.Sin(zAngle);
 
-		    m[0, 0] = cy * cz + sx * sy * sz;
-		    m[0, 1] = cz * sx * sy - cy * sz;
-		    m[0, 2] = cx * sy;
+            m[0, 0] = cy * cz + sx * sy * sz;
+            m[0, 1] = cz * sx * sy - cy * sz;
+            m[0, 2] = cx * sy;
 
-		    m[1, 0] = cx * sz;
-		    m[1, 1] = cx * cz;
-		    m[1, 2] = -sx;
+            m[1, 0] = cx * sz;
+            m[1, 1] = cx * cz;
+            m[1, 2] = -sx;
 
-		    m[2, 0] = -cz * sy + cy * sx * sz;
-		    m[2, 1] = cy * cz * sx + sy * sz;
-		    m[2, 2] = cx * cy;
+            m[2, 0] = -cz * sy + cy * sx * sz;
+            m[2, 1] = cy * cz * sx + sy * sz;
+            m[2, 2] = cx * cy;
 
             return m;
         }

+ 74 - 74
Source/MBansheeEngine/Math/Quaternion.cs

@@ -19,7 +19,7 @@ namespace BansheeEngine
         /// Contains constant data that is used when calculating euler angles in a certain order.
         /// </summary>
         private struct EulerAngleOrderData
-		{
+        {
             public EulerAngleOrderData(int a, int b, int c)
             {
                 this.a = a;
@@ -27,8 +27,8 @@ namespace BansheeEngine
                 this.c = c;
             }
 
-			public int a, b, c;
-		};
+            public int a, b, c;
+        };
 
         /// <summary>
         /// Quaternion with all zero elements.
@@ -43,8 +43,8 @@ namespace BansheeEngine
         private static readonly float epsilon = 1e-03f;
 
         private static readonly EulerAngleOrderData[] EA_LOOKUP = new EulerAngleOrderData[6]
-		    { new EulerAngleOrderData(0, 1, 2), new EulerAngleOrderData(0, 2, 1), new EulerAngleOrderData(1, 0, 2),
-		      new EulerAngleOrderData(1, 2, 0), new EulerAngleOrderData(2, 0, 1), new EulerAngleOrderData(2, 1, 0) };
+            { new EulerAngleOrderData(0, 1, 2), new EulerAngleOrderData(0, 2, 1), new EulerAngleOrderData(1, 0, 2),
+              new EulerAngleOrderData(1, 2, 0), new EulerAngleOrderData(2, 0, 1), new EulerAngleOrderData(2, 1, 0) };
 
         public float x;
         public float y;
@@ -274,12 +274,12 @@ namespace BansheeEngine
         ///                            Fallback axis should be perpendicular to both vectors.</param>
         public void SetFromToRotation(Vector3 fromDirection, Vector3 toDirection, Vector3 fallbackAxis)
         {
-		    fromDirection.Normalize();
-		    toDirection.Normalize();
+            fromDirection.Normalize();
+            toDirection.Normalize();
 
-		    float d = Vector3.Dot(fromDirection, toDirection);
+            float d = Vector3.Dot(fromDirection, toDirection);
 
-		    // If dot == 1, vectors are the same
+            // If dot == 1, vectors are the same
             if (d >= 1.0f)
             {
                 this = Identity;
@@ -287,35 +287,35 @@ namespace BansheeEngine
             }
 
             if (d < (1e-6f - 1.0f))
-		    {
-			    if (fallbackAxis != Vector3.Zero)
-			    {
-				    // Rotate 180 degrees about the fallback axis
-				    this = FromAxisAngle(fallbackAxis, MathEx.Pi);
-			    }
-			    else
-			    {
-				    // Generate an axis
-				    Vector3 axis = Vector3.Cross(Vector3.XAxis, fromDirection);
+            {
+                if (fallbackAxis != Vector3.Zero)
+                {
+                    // Rotate 180 degrees about the fallback axis
+                    this = FromAxisAngle(fallbackAxis, MathEx.Pi);
+                }
+                else
+                {
+                    // Generate an axis
+                    Vector3 axis = Vector3.Cross(Vector3.XAxis, fromDirection);
                     if (axis.SqrdLength < ((1e-06f * 1e-06f))) // Pick another if collinear
-					    axis = Vector3.Cross(Vector3.YAxis, fromDirection);
-				    axis.Normalize();
+                        axis = Vector3.Cross(Vector3.YAxis, fromDirection);
+                    axis.Normalize();
                     this = FromAxisAngle(axis, MathEx.Pi);
-			    }
-		    }
-		    else
-		    {
-			    float s = MathEx.Sqrt((1+d)*2);
-			    float invs = 1 / s;
+                }
+            }
+            else
+            {
+                float s = MathEx.Sqrt((1+d)*2);
+                float invs = 1 / s;
 
-			    Vector3 c = Vector3.Cross(fromDirection, toDirection);
+                Vector3 c = Vector3.Cross(fromDirection, toDirection);
 
-			    x = c.x * invs;
-			    y = c.y * invs;
-			    z = c.z * invs;
-			    w = s * 0.5f;
-			    Normalize();
-		    }
+                x = c.x * invs;
+                y = c.y * invs;
+                z = c.z * invs;
+                w = s * 0.5f;
+                Normalize();
+            }
         }
 
         /// <summary>
@@ -467,22 +467,22 @@ namespace BansheeEngine
         public void ToAxisAngle(out Vector3 axis, out Degree angle)
         {
             float fSqrLength = x*x+y*y+z*z;
-		    if (fSqrLength > 0.0f)
-		    {
+            if (fSqrLength > 0.0f)
+            {
                 angle = 2.0f * MathEx.Acos(w);
-			    float fInvLength = MathEx.InvSqrt(fSqrLength);
-			    axis.x = x*fInvLength;
-			    axis.y = y*fInvLength;
-			    axis.z = z*fInvLength;
-		    }
-		    else
-		    {
-			    // Angle is 0, so any axis will do
+                float fInvLength = MathEx.InvSqrt(fSqrLength);
+                axis.x = x*fInvLength;
+                axis.y = y*fInvLength;
+                axis.z = z*fInvLength;
+            }
+            else
+            {
+                // Angle is 0, so any axis will do
                 angle = (Degree)0.0f;
-			    axis.x = 1.0f;
-			    axis.y = 0.0f;
-			    axis.z = 0.0f;
-		    }
+                axis.x = 1.0f;
+                axis.y = 0.0f;
+                axis.z = 0.0f;
+            }
         }
 
         /// <summary>
@@ -496,17 +496,17 @@ namespace BansheeEngine
             Matrix3 matRot = ToRotationMatrix();
 
             xAxis.x = matRot[0, 0];
-		    xAxis.y = matRot[1, 0];
-		    xAxis.z = matRot[2, 0];
+            xAxis.y = matRot[1, 0];
+            xAxis.z = matRot[2, 0];
 
-		    yAxis.x = matRot[0, 1];
-		    yAxis.y = matRot[1, 1];
-		    yAxis.z = matRot[2, 1];
+            yAxis.x = matRot[0, 1];
+            yAxis.y = matRot[1, 1];
+            yAxis.z = matRot[2, 1];
 
-		    zAxis.x = matRot[0, 2];
-		    zAxis.y = matRot[1, 2];
-		    zAxis.z = matRot[2, 2];
-	    }
+            zAxis.x = matRot[0, 2];
+            zAxis.y = matRot[1, 2];
+            zAxis.z = matRot[2, 2];
+        }
 
     /// <summary>
     /// Converts the quaternion rotation into euler angle (pitch/yaw/roll) rotation.
@@ -595,7 +595,7 @@ namespace BansheeEngine
         }
 
         /// <summary>
-        /// Creates a quaternion that orients an object so it faces in te provided direction.
+        /// Creates a quaternion that orients an object so it faces in the provided direction.
         /// </summary>
         /// <param name="forward">Direction to orient the object towards.</param>
         /// <param name="up">Axis that determines the upward direction of the object.</param>
@@ -677,7 +677,7 @@ namespace BansheeEngine
                 quat[k] = (rotMatrix[k, i] + rotMatrix[i, k]) * root;
             }
 
-		    quat.Normalize();
+            quat.Normalize();
 
             return quat;
         }
@@ -740,27 +740,27 @@ namespace BansheeEngine
         public static Quaternion FromEuler(Degree xAngle, Degree yAngle, Degree zAngle, 
             EulerAngleOrder order = EulerAngleOrder.YXZ)
         {
-		    EulerAngleOrderData l = EA_LOOKUP[(int)order];
+            EulerAngleOrderData l = EA_LOOKUP[(int)order];
 
-		    Radian halfXAngle = xAngle * 0.5f;
-		    Radian halfYAngle = yAngle * 0.5f;
-		    Radian halfZAngle = zAngle * 0.5f;
+            Radian halfXAngle = xAngle * 0.5f;
+            Radian halfYAngle = yAngle * 0.5f;
+            Radian halfZAngle = zAngle * 0.5f;
 
-		    float cx = MathEx.Cos(halfXAngle);
-		    float sx = MathEx.Sin(halfXAngle);
+            float cx = MathEx.Cos(halfXAngle);
+            float sx = MathEx.Sin(halfXAngle);
 
-		    float cy = MathEx.Cos(halfYAngle);
-		    float sy = MathEx.Sin(halfYAngle);
+            float cy = MathEx.Cos(halfYAngle);
+            float sy = MathEx.Sin(halfYAngle);
 
-		    float cz = MathEx.Cos(halfZAngle);
-		    float sz = MathEx.Sin(halfZAngle);
+            float cz = MathEx.Cos(halfZAngle);
+            float sz = MathEx.Sin(halfZAngle);
 
-		    Quaternion[] quats = new Quaternion[3];
-		    quats[0] = new Quaternion(sx, 0.0f, 0.0f, cx);
-		    quats[1] = new Quaternion(0.0f, sy, 0.0f, cy);
-		    quats[2] = new Quaternion(0.0f, 0.0f, sz, cz);
+            Quaternion[] quats = new Quaternion[3];
+            quats[0] = new Quaternion(sx, 0.0f, 0.0f, cx);
+            quats[1] = new Quaternion(0.0f, sy, 0.0f, cy);
+            quats[2] = new Quaternion(0.0f, 0.0f, sz, cz);
 
-		    return (quats[l.a] * quats[l.b]) * quats[l.c];
+            return (quats[l.a] * quats[l.b]) * quats[l.c];
         }
 
         /// <summary>

+ 17 - 17
Source/MBansheeEngine/Math/Radian.cs

@@ -16,16 +16,16 @@ namespace BansheeEngine
     public struct Radian // Note: Must match C++ class Radian
     {
         [SerializeField]
-		readonly float value;
+        readonly float value;
 
         /// <summary>
         /// Creates a new radian value.
         /// </summary>
         /// <param name="value">Value in radians.</param>
-		public Radian(float value = 0.0f)
-	    {
-	        this.value = value;
-	    }
+        public Radian(float value = 0.0f)
+        {
+            this.value = value;
+        }
 
         /// <summary>
         /// Creates a new radian value.
@@ -83,14 +83,14 @@ namespace BansheeEngine
         }
 
         public static Radian operator +(Radian a)
-	    {
-	        return a;
-	    }
+        {
+            return a;
+        }
 
         public static Radian operator +(Radian a, Radian b)
-	    {
+        {
             return new Radian(a.value + b.value);
-	    }
+        }
 
         public static Radian operator +(Radian a, Degree d) 
         {
@@ -98,14 +98,14 @@ namespace BansheeEngine
         }
 
         public static Radian operator -(Radian a)
-	    {
+        {
             return new Radian(-a.value);
-	    }
+        }
 
         public static Radian operator -(Radian a, Radian b)
-	    {
+        {
             return new Radian(a.value - b.value);
-	    }
+        }
 
         public static Radian operator -(Radian a, Degree d) 
         {
@@ -143,9 +143,9 @@ namespace BansheeEngine
         }
 
         public static bool operator <(Radian a, Radian b)
-	    {
-	        return a.value < b.value;
-	    }
+        {
+            return a.value < b.value;
+        }
 
         public static bool operator >(Radian a, Radian b)
         {

+ 8 - 8
Source/MBansheeEngine/Math/Ray.cs

@@ -15,8 +15,8 @@ namespace BansheeEngine
     [StructLayout(LayoutKind.Sequential), SerializeObject]
     public struct Ray // Note: Must match C++ struct Ray
     {
-		public Vector3 origin;
-		public Vector3 direction;
+        public Vector3 origin;
+        public Vector3 direction;
 
         /// <summary>
         /// Creates a new ray.
@@ -35,10 +35,10 @@ namespace BansheeEngine
         /// <param name="ray">Ray to transform.</param>
         /// <param name="t">How far along the ray to retrieve the point.</param>
         /// <returns>Point along the ray <paramref name="t"/> units away from the origin.</returns>
-		public static Vector3 operator*(Ray ray, float t) 
-		{
+        public static Vector3 operator*(Ray ray, float t) 
+        {
             return ray.origin + ray.direction * t;
-		}
+        }
 
         /// <summary>
         /// Transforms the ray by the specified matrix. If the matrix is affine use
@@ -49,10 +49,10 @@ namespace BansheeEngine
         {
             Vector3 end = this * 1.0f;
 
-		    origin = matrix.Multiply(origin);
-		    end = matrix.Multiply(end);
+            origin = matrix.Multiply(origin);
+            end = matrix.Multiply(end);
 
-		    direction = Vector3.Normalize(end - origin);
+            direction = Vector3.Normalize(end - origin);
         }
 
         /// <summary>

+ 35 - 35
Source/MBansheeEngine/Math/Rect2I.cs

@@ -33,31 +33,31 @@ namespace BansheeEngine
             this.height = height;
         }
 
-		public static bool operator== (Rect2I lhs, Rect2I rhs)
-		{
-			return lhs.x == rhs.x && lhs.y == rhs.y && lhs.width == rhs.width && lhs.height == rhs.height;
-		}
+        public static bool operator== (Rect2I lhs, Rect2I rhs)
+        {
+            return lhs.x == rhs.x && lhs.y == rhs.y && lhs.width == rhs.width && lhs.height == rhs.height;
+        }
 
-		public static bool operator!= (Rect2I lhs, Rect2I rhs)
-		{
-			return !(lhs == rhs);
-		}
+        public static bool operator!= (Rect2I lhs, Rect2I rhs)
+        {
+            return !(lhs == rhs);
+        }
 
         /// <summary>
         /// Returns true if the rectangle contains the provided point.
         /// </summary>
         /// <param name="point">Point to check if it is in rectangle.</param>
         /// <returns>True if the point within rectangle bounds.</returns>
-	    public bool Contains(Vector2I point)
-	    {
-		    if(point.x >= x && point.x < (x + width))
-		    {
-			    if(point.y >= y && point.y < (y + height))
-				    return true;
-		    }
+        public bool Contains(Vector2I point)
+        {
+            if(point.x >= x && point.x < (x + width))
+            {
+                if(point.y >= y && point.y < (y + height))
+                    return true;
+            }
 
-		    return false;
-	    }
+            return false;
+        }
 
         /// <summary>
         /// Returns true if the rectangle overlaps the provided rectangle. Also returns true if the rectangles are 
@@ -65,39 +65,39 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="other">Other rectangle to compare with.</param>
         /// <returns>True if the rectangles overlap.</returns>
-	    public bool Overlaps(Rect2I other)
-	    {
-		    int otherRight = other.x + other.width;
+        public bool Overlaps(Rect2I other)
+        {
+            int otherRight = other.x + other.width;
             int myRight = x + width;
 
             int otherBottom = other.y + other.height;
             int myBottom = y + height;
 
-		    if(x < otherRight && myRight > other.x &&
-			    y < otherBottom && myBottom > other.y)
-			    return true;
+            if(x < otherRight && myRight > other.x &&
+                y < otherBottom && myBottom > other.y)
+                return true;
 
-		    return false;
-	    }
+            return false;
+        }
 
         /// <summary>
         /// Clips current rectangle so that it does not overlap the provided rectangle. After clipping no area of this
         /// rectangle will intersect the clip area.
         /// </summary>
         /// <param name="clipRect">Rectangle to clip against.</param>
-	    public void Clip(Rect2I clipRect)
-	    {
-		    int newLeft = Math.Max(x, clipRect.x);
-		    int newTop = Math.Max(y, clipRect.y);
+        public void Clip(Rect2I clipRect)
+        {
+            int newLeft = Math.Max(x, clipRect.x);
+            int newTop = Math.Max(y, clipRect.y);
 
-		    int newRight = Math.Min(x + width, clipRect.x + clipRect.width);
-		    int newBottom = Math.Min(y + height, clipRect.y + clipRect.height);
+            int newRight = Math.Min(x + width, clipRect.x + clipRect.width);
+            int newBottom = Math.Min(y + height, clipRect.y + clipRect.height);
 
-		    x = Math.Min(newLeft, newRight);
-		    y = Math.Min(newTop, newBottom);
-		    width = Math.Max(0, newRight - newLeft);
+            x = Math.Min(newLeft, newRight);
+            y = Math.Min(newTop, newBottom);
+            width = Math.Max(0, newRight - newLeft);
             height = Math.Max(0, newBottom - newTop);
-	    }
+        }
 
         /// <inheritdoc/>
         public override bool Equals(object other)

+ 3 - 3
Source/MBansheeEngine/Math/Vector2.cs

@@ -223,9 +223,9 @@ namespace BansheeEngine
         /// <param name="b">Second vector.</param>
         /// <returns>Vector consisting of maximum components of the first and second vector.</returns>
         public static Vector2 Max(Vector2 a, Vector2 b)
-		{
-			return new Vector2(MathEx.Max(a.x, b.x), MathEx.Max(a.y, b.y));
-		}
+        {
+            return new Vector2(MathEx.Max(a.x, b.x), MathEx.Max(a.y, b.y));
+        }
 
         /// <summary>
         /// Returns the minimum of all the vector components as a new vector.

+ 3 - 3
Source/MBansheeEngine/Math/Vector2I.cs

@@ -94,9 +94,9 @@ namespace BansheeEngine
         /// <param name="b">Second two dimensional point.</param>
         /// <returns>Manhattan distance between the two points.</returns>
         public static int Distance(Vector2I a, Vector2I b)
-		{
-			return Math.Abs(b.x - a.x) + Math.Abs(b.y - a.y);
-		}
+        {
+            return Math.Abs(b.x - a.x) + Math.Abs(b.y - a.y);
+        }
 
         public static Vector2I operator +(Vector2I a, Vector2I b)
         {