+ {
+ #region Private Fields
+
+ private static Vector3 zero = new Vector3(0f, 0f, 0f);
+ private static Vector3 one = new Vector3(1f, 1f, 1f);
+ private static Vector3 unitX = new Vector3(1f, 0f, 0f);
+ private static Vector3 unitY = new Vector3(0f, 1f, 0f);
+ private static Vector3 unitZ = new Vector3(0f, 0f, 1f);
+ private static Vector3 up = new Vector3(0f, 1f, 0f);
+ private static Vector3 down = new Vector3(0f, -1f, 0f);
+ private static Vector3 right = new Vector3(1f, 0f, 0f);
+ private static Vector3 left = new Vector3(-1f, 0f, 0f);
+ private static Vector3 forward = new Vector3(0f, 0f, -1f);
+ private static Vector3 backward = new Vector3(0f, 0f, 1f);
+
+ #endregion Private Fields
+
+
+ #region Public Fields
+
+ public float X;
+ public float Y;
+ public float Z;
+
+ #endregion Public Fields
+
+
+ #region Properties
+
+ public static Vector3 Zero
+ {
+ get { return zero; }
+ }
+
+ public static Vector3 One
+ {
+ get { return one; }
+ }
+
+ public static Vector3 UnitX
+ {
+ get { return unitX; }
+ }
+
+ public static Vector3 UnitY
+ {
+ get { return unitY; }
+ }
+
+ public static Vector3 UnitZ
+ {
+ get { return unitZ; }
+ }
+
+ public static Vector3 Up
+ {
+ get { return up; }
+ }
+
+ public static Vector3 Down
+ {
+ get { return down; }
+ }
+
+ public static Vector3 Right
+ {
+ get { return right; }
+ }
+
+ public static Vector3 Left
+ {
+ get { return left; }
+ }
+
+ public static Vector3 Forward
+ {
+ get { return forward; }
+ }
+
+ public static Vector3 Backward
+ {
+ get { return backward; }
+ }
+
+ #endregion Properties
+
+
+ #region Constructors
+
+ public Vector3(float x, float y, float z)
+ {
+ this.X = x;
+ this.Y = y;
+ this.Z = z;
+ }
+
+
+ public Vector3(float value)
+ {
+ this.X = value;
+ this.Y = value;
+ this.Z = value;
+ }
+
+
+ public Vector3(Vector2 value, float z)
+ {
+ this.X = value.X;
+ this.Y = value.Y;
+ this.Z = z;
+ }
+
+
+ #endregion Constructors
+
+
+ #region Public Methods
+
+ public static Vector3 Add(Vector3 value1, Vector3 value2)
+ {
+ value1.X += value2.X;
+ value1.Y += value2.Y;
+ value1.Z += value2.Z;
+ return value1;
+ }
+
+ public static void Add(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
+ {
+ result.X = value1.X + value2.X;
+ result.Y = value1.Y + value2.Y;
+ result.Z = value1.Z + value2.Z;
+ }
+
+ public static Vector3 Barycentric(Vector3 value1, Vector3 value2, Vector3 value3, float amount1, float amount2)
+ {
+ return new Vector3(
+ MathHelper.Barycentric(value1.X, value2.X, value3.X, amount1, amount2),
+ MathHelper.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2),
+ MathHelper.Barycentric(value1.Z, value2.Z, value3.Z, amount1, amount2));
+ }
+
+ public static void Barycentric(ref Vector3 value1, ref Vector3 value2, ref Vector3 value3, float amount1, float amount2, out Vector3 result)
+ {
+ result = new Vector3(
+ MathHelper.Barycentric(value1.X, value2.X, value3.X, amount1, amount2),
+ MathHelper.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2),
+ MathHelper.Barycentric(value1.Z, value2.Z, value3.Z, amount1, amount2));
+ }
+
+ public static Vector3 CatmullRom(Vector3 value1, Vector3 value2, Vector3 value3, Vector3 value4, float amount)
+ {
+ return new Vector3(
+ MathHelper.CatmullRom(value1.X, value2.X, value3.X, value4.X, amount),
+ MathHelper.CatmullRom(value1.Y, value2.Y, value3.Y, value4.Y, amount),
+ MathHelper.CatmullRom(value1.Z, value2.Z, value3.Z, value4.Z, amount));
+ }
+
+ public static void CatmullRom(ref Vector3 value1, ref Vector3 value2, ref Vector3 value3, ref Vector3 value4, float amount, out Vector3 result)
+ {
+ result = new Vector3(
+ MathHelper.CatmullRom(value1.X, value2.X, value3.X, value4.X, amount),
+ MathHelper.CatmullRom(value1.Y, value2.Y, value3.Y, value4.Y, amount),
+ MathHelper.CatmullRom(value1.Z, value2.Z, value3.Z, value4.Z, amount));
+ }
+
+ public static Vector3 Clamp(Vector3 value1, Vector3 min, Vector3 max)
+ {
+ return new Vector3(
+ MathHelper.Clamp(value1.X, min.X, max.X),
+ MathHelper.Clamp(value1.Y, min.Y, max.Y),
+ MathHelper.Clamp(value1.Z, min.Z, max.Z));
+ }
+
+ public static void Clamp(ref Vector3 value1, ref Vector3 min, ref Vector3 max, out Vector3 result)
+ {
+ result = new Vector3(
+ MathHelper.Clamp(value1.X, min.X, max.X),
+ MathHelper.Clamp(value1.Y, min.Y, max.Y),
+ MathHelper.Clamp(value1.Z, min.Z, max.Z));
+ }
+
+ public static Vector3 Cross(Vector3 vector1, Vector3 vector2)
+ {
+ Cross(ref vector1, ref vector2, out vector1);
+ return vector1;
+ }
+
+ public static void Cross(ref Vector3 vector1, ref Vector3 vector2, out Vector3 result)
+ {
+ result = new Vector3(vector1.Y * vector2.Z - vector2.Y * vector1.Z,
+ -(vector1.X * vector2.Z - vector2.X * vector1.Z),
+ vector1.X * vector2.Y - vector2.X * vector1.Y);
+ }
+
+ public static float Distance(Vector3 vector1, Vector3 vector2)
+ {
+ float result;
+ DistanceSquared(ref vector1, ref vector2, out result);
+ return (float)Math.Sqrt(result);
+ }
+
+ public static void Distance(ref Vector3 value1, ref Vector3 value2, out float result)
+ {
+ DistanceSquared(ref value1, ref value2, out result);
+ result = (float)Math.Sqrt(result);
+ }
+
+ public static float DistanceSquared(Vector3 value1, Vector3 value2)
+ {
+ float result;
+ DistanceSquared(ref value1, ref value2, out result);
+ return result;
+ }
+
+ public static void DistanceSquared(ref Vector3 value1, ref Vector3 value2, out float result)
+ {
+ result = (value1.X - value2.X) * (value1.X - value2.X) +
+ (value1.Y - value2.Y) * (value1.Y - value2.Y) +
+ (value1.Z - value2.Z) * (value1.Z - value2.Z);
+ }
+
+ public static Vector3 Divide(Vector3 value1, Vector3 value2)
+ {
+ value1.X /= value2.X;
+ value1.Y /= value2.Y;
+ value1.Z /= value2.Z;
+ return value1;
+ }
+
+ public static Vector3 Divide(Vector3 value1, float value2)
+ {
+ float factor = 1 / value2;
+ value1.X *= factor;
+ value1.Y *= factor;
+ value1.Z *= factor;
+ return value1;
+ }
+
+ public static void Divide(ref Vector3 value1, float divisor, out Vector3 result)
+ {
+ float factor = 1 / divisor;
+ result.X = value1.X * factor;
+ result.Y = value1.Y * factor;
+ result.Z = value1.Z * factor;
+ }
+
+ public static void Divide(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
+ {
+ result.X = value1.X / value2.X;
+ result.Y = value1.Y / value2.Y;
+ result.Z = value1.Z / value2.Z;
+ }
+
+ public static float Dot(Vector3 vector1, Vector3 vector2)
+ {
+ return vector1.X * vector2.X + vector1.Y * vector2.Y + vector1.Z * vector2.Z;
+ }
+
+ public static void Dot(ref Vector3 vector1, ref Vector3 vector2, out float result)
+ {
+ result = vector1.X * vector2.X + vector1.Y * vector2.Y + vector1.Z * vector2.Z;
+ }
+
+ public override bool Equals(object obj)
+ {
+ return (obj is Vector3) ? this == (Vector3)obj : false;
+ }
+
+ public bool Equals(Vector3 other)
+ {
+ return this == other;
+ }
+
+ public override int GetHashCode()
+ {
+ return (int)(this.X + this.Y + this.Z);
+ }
+
+ public static Vector3 Hermite(Vector3 value1, Vector3 tangent1, Vector3 value2, Vector3 tangent2, float amount)
+ {
+ Vector3 result = new Vector3();
+ Hermite(ref value1, ref tangent1, ref value2, ref tangent2, amount, out result);
+ return result;
+ }
+
+ public static void Hermite(ref Vector3 value1, ref Vector3 tangent1, ref Vector3 value2, ref Vector3 tangent2, float amount, out Vector3 result)
+ {
+ result.X = MathHelper.Hermite(value1.X, tangent1.X, value2.X, tangent2.X, amount);
+ result.Y = MathHelper.Hermite(value1.Y, tangent1.Y, value2.Y, tangent2.Y, amount);
+ result.Z = MathHelper.Hermite(value1.Z, tangent1.Z, value2.Z, tangent2.Z, amount);
+ }
+
+ public float Length()
+ {
+ float result;
+ DistanceSquared(ref this, ref zero, out result);
+ return (float)Math.Sqrt(result);
+ }
+
+ public float LengthSquared()
+ {
+ float result;
+ DistanceSquared(ref this, ref zero, out result);
+ return result;
+ }
+
+ public static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount)
+ {
+ return new Vector3(
+ MathHelper.Lerp(value1.X, value2.X, amount),
+ MathHelper.Lerp(value1.Y, value2.Y, amount),
+ MathHelper.Lerp(value1.Z, value2.Z, amount));
+ }
+
+ public static void Lerp(ref Vector3 value1, ref Vector3 value2, float amount, out Vector3 result)
+ {
+ result = new Vector3(
+ MathHelper.Lerp(value1.X, value2.X, amount),
+ MathHelper.Lerp(value1.Y, value2.Y, amount),
+ MathHelper.Lerp(value1.Z, value2.Z, amount));
+ }
+
+ public static Vector3 Max(Vector3 value1, Vector3 value2)
+ {
+ return new Vector3(
+ MathHelper.Max(value1.X, value2.X),
+ MathHelper.Max(value1.Y, value2.Y),
+ MathHelper.Max(value1.Z, value2.Z));
+ }
+
+ public static void Max(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
+ {
+ result = new Vector3(
+ MathHelper.Max(value1.X, value2.X),
+ MathHelper.Max(value1.Y, value2.Y),
+ MathHelper.Max(value1.Z, value2.Z));
+ }
+
+ public static Vector3 Min(Vector3 value1, Vector3 value2)
+ {
+ return new Vector3(
+ MathHelper.Min(value1.X, value2.X),
+ MathHelper.Min(value1.Y, value2.Y),
+ MathHelper.Min(value1.Z, value2.Z));
+ }
+
+ public static void Min(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
+ {
+ result = new Vector3(
+ MathHelper.Min(value1.X, value2.X),
+ MathHelper.Min(value1.Y, value2.Y),
+ MathHelper.Min(value1.Z, value2.Z));
+ }
+
+ public static Vector3 Multiply(Vector3 value1, Vector3 value2)
+ {
+ value1.X *= value2.X;
+ value1.Y *= value2.Y;
+ value1.Z *= value2.Z;
+ return value1;
+ }
+
+ public static Vector3 Multiply(Vector3 value1, float scaleFactor)
+ {
+ value1.X *= scaleFactor;
+ value1.Y *= scaleFactor;
+ value1.Z *= scaleFactor;
+ return value1;
+ }
+
+ public static void Multiply(ref Vector3 value1, float scaleFactor, out Vector3 result)
+ {
+ result.X = value1.X * scaleFactor;
+ result.Y = value1.Y * scaleFactor;
+ result.Z = value1.Z * scaleFactor;
+ }
+
+ public static void Multiply(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
+ {
+ result.X = value1.X * value2.X;
+ result.Y = value1.Y * value2.Y;
+ result.Z = value1.Z * value2.Z;
+ }
+
+ public static Vector3 Negate(Vector3 value)
+ {
+ value = new Vector3(-value.X, -value.Y, -value.Z);
+ return value;
+ }
+
+ public static void Negate(ref Vector3 value, out Vector3 result)
+ {
+ result = new Vector3(-value.X, -value.Y, -value.Z);
+ }
+
+ public void Normalize()
+ {
+ Normalize(ref this, out this);
+ }
+
+ public static Vector3 Normalize(Vector3 vector)
+ {
+ Normalize(ref vector, out vector);
+ return vector;
+ }
+
+ public static void Normalize(ref Vector3 value, out Vector3 result)
+ {
+ float factor;
+ Distance(ref value, ref zero, out factor);
+ factor = 1f / factor;
+ result.X = value.X * factor;
+ result.Y = value.Y * factor;
+ result.Z = value.Z * factor;
+ }
+
+ public static Vector3 Reflect(Vector3 vector, Vector3 normal)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static void Reflect(ref Vector3 vector, ref Vector3 normal, out Vector3 result)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static Vector3 SmoothStep(Vector3 value1, Vector3 value2, float amount)
+ {
+ return new Vector3(
+ MathHelper.SmoothStep(value1.X, value2.X, amount),
+ MathHelper.SmoothStep(value1.Y, value2.Y, amount),
+ MathHelper.SmoothStep(value1.Z, value2.Z, amount));
+ }
+
+ public static void SmoothStep(ref Vector3 value1, ref Vector3 value2, float amount, out Vector3 result)
+ {
+ result = new Vector3(
+ MathHelper.SmoothStep(value1.X, value2.X, amount),
+ MathHelper.SmoothStep(value1.Y, value2.Y, amount),
+ MathHelper.SmoothStep(value1.Z, value2.Z, amount));
+ }
+
+ public static Vector3 Subtract(Vector3 value1, Vector3 value2)
+ {
+ value1.X -= value2.X;
+ value1.Y -= value2.Y;
+ value1.Z -= value2.Z;
+ return value1;
+ }
+
+ public static void Subtract(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
+ {
+ result.X = value1.X - value2.X;
+ result.Y = value1.Y - value2.Y;
+ result.Z = value1.Z - value2.Z;
+ }
+
+ public override string ToString()
+ {
+ StringBuilder sb = new StringBuilder(32);
+ sb.Append("{X:");
+ sb.Append(this.X);
+ sb.Append(" Y:");
+ sb.Append(this.Y);
+ sb.Append(" Z:");
+ sb.Append(this.Z);
+ sb.Append("}");
+ return sb.ToString();
+ }
+
+ public static Vector3 Transform(Vector3 position, Matrix matrix)
+ {
+ Transform(ref position, ref matrix, out position);
+ return position;
+ }
+
+ public static void Transform(ref Vector3 position, ref Matrix matrix, out Vector3 result)
+ {
+ result = new Vector3((position.X * matrix.M11) + (position.Y * matrix.M21) + (position.Z * matrix.M31) + matrix.M41,
+ (position.X * matrix.M12) + (position.Y * matrix.M22) + (position.Z * matrix.M32) + matrix.M42,
+ (position.X * matrix.M13) + (position.Y * matrix.M23) + (position.Z * matrix.M33) + matrix.M43);
+ }
+
+ public static Vector3 TransformNormal(Vector3 normal, Matrix matrix)
+ {
+ TransformNormal(ref normal, ref matrix, out normal);
+ return normal;
+ }
+
+ public static void TransformNormal(ref Vector3 normal, ref Matrix matrix, out Vector3 result)
+ {
+ result = new Vector3((normal.X * matrix.M11) + (normal.Y * matrix.M21) + (normal.Z * matrix.M31),
+ (normal.X * matrix.M12) + (normal.Y * matrix.M22) + (normal.Z * matrix.M32),
+ (normal.X * matrix.M13) + (normal.Y * matrix.M23) + (normal.Z * matrix.M33));
+ }
+
+ #endregion Public methods
+
+
+ #region Operators
+
+ public static bool operator ==(Vector3 value1, Vector3 value2)
+ {
+ return value1.X == value2.X
+ && value1.Y == value2.Y
+ && value1.Z == value2.Z;
+ }
+
+ public static bool operator !=(Vector3 value1, Vector3 value2)
+ {
+ return !(value1 == value2);
+ }
+
+ public static Vector3 operator +(Vector3 value1, Vector3 value2)
+ {
+ value1.X += value2.X;
+ value1.Y += value2.Y;
+ value1.Z += value2.Z;
+ return value1;
+ }
+
+ public static Vector3 operator -(Vector3 value)
+ {
+ value = new Vector3(-value.X, -value.Y, -value.Z);
+ return value;
+ }
+
+ public static Vector3 operator -(Vector3 value1, Vector3 value2)
+ {
+ value1.X -= value2.X;
+ value1.Y -= value2.Y;
+ value1.Z -= value2.Z;
+ return value1;
+ }
+
+ public static Vector3 operator *(Vector3 value1, Vector3 value2)
+ {
+ value1.X *= value2.X;
+ value1.Y *= value2.Y;
+ value1.Z *= value2.Z;
+ return value1;
+ }
+
+ public static Vector3 operator *(Vector3 value, float scaleFactor)
+ {
+ value.X *= scaleFactor;
+ value.Y *= scaleFactor;
+ value.Z *= scaleFactor;
+ return value;
+ }
+
+ public static Vector3 operator *(float scaleFactor, Vector3 value)
+ {
+ value.X *= scaleFactor;
+ value.Y *= scaleFactor;
+ value.Z *= scaleFactor;
+ return value;
+ }
+
+ public static Vector3 operator /(Vector3 value1, Vector3 value2)
+ {
+ value1.X /= value2.X;
+ value1.Y /= value2.Y;
+ value1.Z /= value2.Z;
+ return value1;
+ }
+
+ public static Vector3 operator /(Vector3 value, float divider)
+ {
+ float factor = 1 / divider;
+ value.X *= factor;
+ value.Y *= factor;
+ value.Z *= factor;
+ return value;
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/JellyPhysics_Small/VectorTools.cs b/JellyPhysics_Small/VectorTools.cs
new file mode 100644
index 0000000..ddc9da2
--- /dev/null
+++ b/JellyPhysics_Small/VectorTools.cs
@@ -0,0 +1,444 @@
+/*
+Copyright (c) 2007 Walaber
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Xna.Framework;
+//using Microsoft.Xna.Framework.Audio;
+//using Microsoft.Xna.Framework.Graphics;
+//using Microsoft.Xna.Framework.Input;
+//using Microsoft.Xna.Framework.Content;
+
+namespace JellyPhysics
+{
+ ///
+ /// Some helpful vector tools not included in the XNA libraries.
+ ///
+ public static class VectorTools
+ {
+ ///
+ /// rotate a vector by a given angle (in radians).
+ ///
+ /// vector
+ /// angle in radians
+ /// rotated vector
+ public static Vector2 rotateVector(Vector2 vec, float angleRadians)
+ {
+ Vector2 ret = new Vector2();
+ float c = (float)Math.Cos(angleRadians);
+ float s = (float)Math.Sin(angleRadians);
+ ret.X = (c * vec.X) - (s * vec.Y);
+ ret.Y = (c * vec.Y) + (s * vec.X);
+
+ return ret;
+ }
+
+ ///
+ /// rotate a vector by a given angle (reference type version)
+ ///
+ /// vector to rotate
+ /// angle in radians
+ /// rotated vector
+ public static void rotateVector(ref Vector2 vecIn, float angleRadians, ref Vector2 vecOut)
+ {
+ float c = (float)Math.Cos(angleRadians);
+ float s = (float)Math.Sin(angleRadians);
+ vecOut.X = (c * vecIn.X) - (s * vecIn.Y);
+ vecOut.Y = (c * vecIn.Y) + (s * vecIn.X);
+ }
+
+ ///
+ /// rotate a given vector by a given angle (reference type version)
+ ///
+ /// vector to rotate
+ /// angle in radians
+ /// rotated vector
+ public static void rotateVector(ref Vector2 vecInOut, float angleRadians)
+ {
+ float originalX = vecInOut.X;
+ float originalY = vecInOut.Y;
+ float c = (float)Math.Cos(angleRadians);
+ float s = (float)Math.Sin(angleRadians);
+ vecInOut.X = (c * originalX) - (s * originalY);
+ vecInOut.Y = (c * originalY) + (s * originalX);
+ }
+
+
+ ///
+ /// reflect a vector about a normal. Normal must be a unit vector.
+ ///
+ /// vector
+ /// normal
+ /// reflected vector
+ public static Vector2 reflectVector(ref Vector2 V, ref Vector2 N)
+ {
+ Vector2 ret = V - (N * (2f * Vector2.Dot(V, N)));
+ return ret;
+ }
+
+ ///
+ /// reflect a vector about a normal. Normal must be a unit vector. (reference type version)
+ ///
+ /// vector in
+ /// normal
+ /// reflected vector out
+ public static void reflectVector(ref Vector2 V, ref Vector2 N, ref Vector2 vOut)
+ {
+ float dot;
+ Vector2.Dot(ref V, ref N, out dot);
+ vOut = V - (N * (2f * dot));
+ }
+
+ ///
+ /// get a vector perpendicular to this vector.
+ ///
+ /// vector
+ /// perpendicular vector
+ public static Vector2 getPerpendicular(Vector2 vec)
+ {
+ return new Vector2(-vec.Y, vec.X);
+ }
+
+
+ ///
+ /// get a vector perpendicular to this vector (reference type version)
+ ///
+ /// vector int
+ /// perpendicular vector out
+ public static void getPerpendicular(ref Vector2 vIn, ref Vector2 vOut)
+ {
+ vOut.X = -vIn.Y;
+ vOut.Y = vIn.X;
+ }
+
+ ///
+ /// make this vector perpendicular to itself
+ ///
+ /// vector in / out
+ public static void makePerpendicular(ref Vector2 v)
+ {
+ float tempX = v.X;
+ v.X = -v.Y;
+ v.Y = tempX;
+ }
+
+ ///
+ /// is rotating from A to B Counter-clockwise?
+ ///
+ /// vector A
+ /// vector B
+ /// true = CCW or opposite (180 degrees), false = CW
+ public static bool isCCW(Vector2 A, Vector2 B)
+ {
+ Vector2 perp = JellyPhysics.VectorTools.getPerpendicular(A);
+ float dot;
+ Vector2.Dot(ref B, ref perp, out dot);
+ return (dot >= 0.0f);
+ }
+
+ ///
+ /// is rotating from A to B Counter-Clockwise?
+ ///
+ /// vector A
+ /// vector B
+ /// true = CCW or opposite (180 degrees), false = CW
+ public static bool isCCW(ref Vector2 A, ref Vector2 B)
+ {
+ Vector2 perp = new Vector2();
+ JellyPhysics.VectorTools.getPerpendicular(ref A, ref perp);
+ float dot;
+
+ Vector2.Dot(ref B, ref perp, out dot);
+ return (dot >= 0.0f);
+ }
+
+ ///
+ /// turn a Vector2 into a Vector3 (sets Z component to zero)
+ ///
+ /// input Vector2
+ /// result Vector3
+ public static Vector3 vec3FromVec2(Vector2 vec)
+ {
+ return new Vector3(vec.X, vec.Y, 0);
+ }
+
+ ///
+ /// turn a Vector2 into a Vector3 (sets Z component to zero) (reference type version)
+ ///
+ /// input Vector2
+ /// result Vector3
+ public static Vector3 vec3FromVec2(ref Vector2 vec)
+ {
+ return new Vector3(vec.X, vec.Y, 0);
+ }
+
+ ///
+ /// turn a Vector2 into a Vector3, specifying the Z component to use.
+ ///
+ /// input Vector2
+ /// Z component
+ /// result Vector3
+ public static Vector3 vec3FromVec2(Vector2 vec, float Z)
+ {
+ return new Vector3(vec.X, vec.Y, Z);
+ }
+
+ ///
+ /// turn a Vector2 into a Vector3, specifying the Z component to use.
+ ///
+ /// input Vector2
+ /// Z component
+ /// result Vector3
+ public static Vector3 vec3FromVec2(ref Vector2 vec, float Z)
+ {
+ return new Vector3(vec.X, vec.Y, Z);
+ }
+
+
+ ///
+ /// see if 2 line segments intersect. (line AB collides with line CD)
+ ///
+ /// first point on line AB
+ /// second point on line AB
+ /// first point on line CD
+ /// second point on line CD
+ /// resulting point of intersection
+ /// distance along AB to intersection [0,1]
+ /// distance long CD to intersection [0,1]
+ /// true / false
+ public static bool lineIntersect(Vector2 ptA, Vector2 ptB, Vector2 ptC, Vector2 ptD, out Vector2 hitPt, out float Ua, out float Ub)
+ {
+ hitPt = Vector2.Zero;
+ Ua = 0f;
+ Ub = 0f;
+
+ float denom = ((ptD.Y - ptC.Y) * (ptB.X - ptA.X)) - ((ptD.X - ptC.X) * (ptB.Y - ptA.Y));
+
+ // if denom == 0, lines are parallel - being a bit generous on this one..
+ if (Math.Abs(denom) < 0.000001f)
+ return false;
+
+ float UaTop = ((ptD.X - ptC.X) * (ptA.Y - ptC.Y)) - ((ptD.Y - ptC.Y) * (ptA.X - ptC.X));
+ float UbTop = ((ptB.X - ptA.X) * (ptA.Y - ptC.Y)) - ((ptB.Y - ptA.Y) * (ptA.X - ptC.X));
+
+ Ua = UaTop / denom;
+ Ub = UbTop / denom;
+
+ if ((Ua >= 0f) && (Ua <= 1f) && (Ub >= 0f) && (Ub <= 1f))
+ {
+ // these lines intersect!
+ hitPt = ptA + ((ptB - ptA) * Ua);
+ return true;
+ }
+
+ return false;
+ }
+
+ ///
+ /// see if 2 line segments intersect. (line AB collides with line CD) (reference type version)
+ ///
+ /// first point on line AB
+ /// second point on line AB
+ /// first point on line CD
+ /// second point on line CD
+ /// resulting point of intersection
+ /// distance along AB to intersection [0,1]
+ /// distance long CD to intersection [0,1]
+ /// true / false
+ public static bool lineIntersect(ref Vector2 ptA, ref Vector2 ptB, ref Vector2 ptC, ref Vector2 ptD, out Vector2 hitPt, out float Ua, out float Ub)
+ {
+ hitPt = Vector2.Zero;
+ Ua = 0f;
+ Ub = 0f;
+
+ float denom = ((ptD.Y - ptC.Y) * (ptB.X - ptA.X)) - ((ptD.X - ptC.X) * (ptB.Y - ptA.Y));
+
+ // if denom == 0, lines are parallel - being a bit generous on this one..
+ if (Math.Abs(denom) < 0.000001f)
+ return false;
+
+ float UaTop = ((ptD.X - ptC.X) * (ptA.Y - ptC.Y)) - ((ptD.Y - ptC.Y) * (ptA.X - ptC.X));
+ float UbTop = ((ptB.X - ptA.X) * (ptA.Y - ptC.Y)) - ((ptB.Y - ptA.Y) * (ptA.X - ptC.X));
+
+ Ua = UaTop / denom;
+ Ub = UbTop / denom;
+
+ if ((Ua >= 0f) && (Ua <= 1f) && (Ub >= 0f) && (Ub <= 1f))
+ {
+ // these lines intersect!
+ hitPt = ptA + ((ptB - ptA) * Ua);
+ return true;
+ }
+
+ return false;
+ }
+
+ ///
+ /// see if 2 line segments intersect. (line AB collides with line CD) - simplified version
+ ///
+ /// first point on line AB
+ /// second point on line AB
+ /// first point on line CD
+ /// second point on line CD
+ /// resulting point of intersection
+ /// true / false
+ public static bool lineIntersect(Vector2 ptA, Vector2 ptB, Vector2 ptC, Vector2 ptD, out Vector2 hitPt)
+ {
+ float Ua;
+ float Ub;
+ return lineIntersect(ptA, ptB, ptC, ptD, out hitPt, out Ua, out Ub);
+ }
+
+ ///
+ /// see if 2 line segments intersect. (line AB collides with line CD) - simplified version (reference type version)
+ ///
+ /// first point on line AB
+ /// second point on line AB
+ /// first point on line CD
+ /// second point on line CD
+ /// resulting point of intersection
+ /// true / false
+ public static bool lineIntersect(ref Vector2 ptA, ref Vector2 ptB, ref Vector2 ptC, ref Vector2 ptD, out Vector2 hitPt)
+ {
+ float Ua;
+ float Ub;
+ return lineIntersect(ref ptA, ref ptB, ref ptC, ref ptD, out hitPt, out Ua, out Ub);
+ }
+
+
+ ///
+ /// calculate a spring force, given position, velocity, spring constant, and damping factor.
+ ///
+ /// position of point A on spring
+ /// velocity of point A on spring
+ /// position of point B on spring
+ /// velocity of point B on spring
+ /// rest distance of the springs
+ /// spring constant
+ /// coefficient for damping
+ /// spring force Vector
+ public static Vector2 calculateSpringForce(Vector2 posA, Vector2 velA, Vector2 posB, Vector2 velB, float springD, float springK, float damping)
+ {
+ Vector2 BtoA = (posA - posB);
+ float dist = BtoA.Length();
+ if (dist > 0.0001f)
+ BtoA /= dist;
+ else
+ BtoA = Vector2.Zero;
+
+ dist = springD - dist;
+
+ Vector2 relVel = velA - velB;
+ float totalRelVel = Vector2.Dot(relVel, BtoA);
+
+ return BtoA * ((dist * springK) - (totalRelVel * damping));
+ }
+
+ ///
+ /// calculate a spring force, given position, velocity, spring constant, and damping factor. (reference type version)
+ ///
+ /// position of point A on spring
+ /// velocity of point A on spring
+ /// position of point B on spring
+ /// velocity of point B on spring
+ /// rest distance of the springs
+ /// spring constant
+ /// coefficient for damping
+ /// rsulting force Vector2
+ public static void calculateSpringForce(ref Vector2 posA, ref Vector2 velA, ref Vector2 posB, ref Vector2 velB, float springD, float springK, float damping, ref Vector2 forceOut)
+ {
+ float BtoAX = (posA.X - posB.X);
+ float BtoAY = (posA.Y - posB.Y);
+
+ float dist = (float)Math.Sqrt((BtoAX * BtoAX) + (BtoAY * BtoAY));
+ if (dist > 0.0001f)
+ {
+ BtoAX /= dist;
+ BtoAY /= dist;
+ }
+ else
+ {
+ forceOut.X = 0;
+ forceOut.Y = 0;
+ return;
+ }
+
+ dist = springD - dist;
+
+ float relVelX = velA.X - velB.X;
+ float relVelY = velA.Y - velB.Y;
+
+ float totalRelVel = (relVelX * BtoAX) + (relVelY * BtoAY);
+
+ forceOut.X = BtoAX * ((dist * springK) - (totalRelVel * damping));
+ forceOut.Y = BtoAY * ((dist * springK) - (totalRelVel * damping));
+ }
+
+
+ ///
+ /// calculate a spring force, given position, velocity, spring constant, and damping factor. Allows slack in the spring. (reference type version)
+ ///
+ /// position of point A on spring
+ /// velocity of point A on spring
+ /// position of point B on spring
+ /// velocity of point B on spring
+ /// rest distance of the springs
+ /// spring constant
+ /// coefficient for damping
+ /// rsulting force Vector2
+ public static void calculateSpringForceAllowSlack(ref Vector2 posA, ref Vector2 velA, ref Vector2 posB, ref Vector2 velB, float springD, float springK, float damping, ref Vector2 forceOut)
+ {
+ float BtoAX = (posA.X - posB.X);
+ float BtoAY = (posA.Y - posB.Y);
+
+ float dist = (float)Math.Sqrt((BtoAX * BtoAX) + (BtoAY * BtoAY));
+ if (dist > 0.0001f)
+ {
+ BtoAX /= dist;
+ BtoAY /= dist;
+ }
+ else
+ {
+ forceOut.X = 0;
+ forceOut.Y = 0;
+ return;
+ }
+
+ dist = springD - dist;
+
+ if (dist > 0.0f)
+ {
+ forceOut.X = forceOut.Y = 0.0f;
+ return;
+ }
+
+ float relVelX = velA.X - velB.X;
+ float relVelY = velA.Y - velB.Y;
+
+ float totalRelVel = (relVelX * BtoAX) + (relVelY * BtoAY);
+
+ forceOut.X = BtoAX * ((dist * springK) - (totalRelVel * damping));
+ forceOut.Y = BtoAY * ((dist * springK) - (totalRelVel * damping));
+ }
+ }
+}
diff --git a/JellyPhysics_Small/bin/Debug/JellyPhysics_Small.dll b/JellyPhysics_Small/bin/Debug/JellyPhysics_Small.dll
new file mode 100644
index 0000000..892b679
Binary files /dev/null and b/JellyPhysics_Small/bin/Debug/JellyPhysics_Small.dll differ
diff --git a/JellyPhysics_Small/bin/Debug/JellyPhysics_Small.pdb b/JellyPhysics_Small/bin/Debug/JellyPhysics_Small.pdb
new file mode 100644
index 0000000..25ba7f0
Binary files /dev/null and b/JellyPhysics_Small/bin/Debug/JellyPhysics_Small.pdb differ
diff --git a/JellyPhysics_Small/bin/Release/JellyPhysics_Small.dll b/JellyPhysics_Small/bin/Release/JellyPhysics_Small.dll
new file mode 100644
index 0000000..3679fab
Binary files /dev/null and b/JellyPhysics_Small/bin/Release/JellyPhysics_Small.dll differ
diff --git a/JellyPhysics_Small/bin/Release/JellyPhysics_Small.pdb b/JellyPhysics_Small/bin/Release/JellyPhysics_Small.pdb
new file mode 100644
index 0000000..fa353d1
Binary files /dev/null and b/JellyPhysics_Small/bin/Release/JellyPhysics_Small.pdb differ
diff --git a/JellyPhysics_Small/bin/x86/Debug/JellyPhysics_Small.dll b/JellyPhysics_Small/bin/x86/Debug/JellyPhysics_Small.dll
new file mode 100644
index 0000000..ca6d53f
Binary files /dev/null and b/JellyPhysics_Small/bin/x86/Debug/JellyPhysics_Small.dll differ
diff --git a/JellyPhysics_Small/bin/x86/Debug/JellyPhysics_Small.pdb b/JellyPhysics_Small/bin/x86/Debug/JellyPhysics_Small.pdb
new file mode 100644
index 0000000..3c076b4
Binary files /dev/null and b/JellyPhysics_Small/bin/x86/Debug/JellyPhysics_Small.pdb differ
diff --git a/JellyPhysics_Small/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/JellyPhysics_Small/obj/Debug/DesignTimeResolveAssemblyReferences.cache
new file mode 100644
index 0000000..6022b8b
Binary files /dev/null and b/JellyPhysics_Small/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ
diff --git a/JellyPhysics_Small/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/JellyPhysics_Small/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..6ac463c
Binary files /dev/null and b/JellyPhysics_Small/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csproj.AssemblyReference.cache b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csproj.AssemblyReference.cache
new file mode 100644
index 0000000..95e76bc
Binary files /dev/null and b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csproj.AssemblyReference.cache differ
diff --git a/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csproj.CoreCompileInputs.cache b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..3373174
--- /dev/null
+++ b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+5d3b6fd75904d9deb22778dfbef31721ae446248
diff --git a/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csproj.FileListAbsolute.txt b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..40d014c
--- /dev/null
+++ b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csproj.FileListAbsolute.txt
@@ -0,0 +1,23 @@
+C:\DEV\tfitzran_TimLaptop\p4-mdisney\Production\Internal_Development\Apps\JellyCarReturns\JelloEditor\JellyPhysics_Small\bin\Debug\JellyPhysics_Small.dll
+C:\DEV\tfitzran_TimLaptop\p4-mdisney\Production\Internal_Development\Apps\JellyCarReturns\JelloEditor\JellyPhysics_Small\bin\Debug\JellyPhysics_Small.pdb
+C:\DEV\tfitzran_TimLaptop\p4-mdisney\Production\Internal_Development\Apps\JellyCarReturns\JelloEditor\JellyPhysics_Small\obj\Debug\ResolveAssemblyReference.cache
+C:\DEV\tfitzran_TimLaptop\p4-mdisney\Production\Internal_Development\Apps\JellyCarReturns\JelloEditor\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.dll
+C:\DEV\tfitzran_TimLaptop\p4-mdisney\Production\Internal_Development\Apps\JellyCarReturns\JelloEditor\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.pdb
+C:\Users\tfitz\OneDrive\Documents\WalaberGames\JelloEditor\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.csproj.AssemblyReference.cache
+C:\Users\tfitz\OneDrive\Documents\WalaberGames\JelloEditor\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.csproj.CoreCompileInputs.cache
+C:\Users\tfitz\OneDrive\Documents\WalaberGames\JelloEditor\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.dll
+C:\Users\tfitz\OneDrive\Documents\WalaberGames\JelloEditor\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.pdb
+C:\Users\tfitz\OneDrive\Documents\WalaberGames\JelloEditor\JellyPhysics_Small\bin\Debug\JellyPhysics_Small.dll
+C:\Users\tfitz\OneDrive\Documents\WalaberGames\JelloEditor\JellyPhysics_Small\bin\Debug\JellyPhysics_Small.pdb
+C:\Users\Adam\Desktop\JE3_Src\JellyPhysics_Small\bin\Debug\JellyPhysics_Small.dll
+C:\Users\Adam\Desktop\JE3_Src\JellyPhysics_Small\bin\Debug\JellyPhysics_Small.pdb
+C:\Users\Adam\Desktop\JE3_Src\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.csproj.AssemblyReference.cache
+C:\Users\Adam\Desktop\JE3_Src\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.csproj.CoreCompileInputs.cache
+C:\Users\Adam\Desktop\JE3_Src\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.dll
+C:\Users\Adam\Desktop\JE3_Src\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.pdb
+C:\Users\Adam\Desktop\Visual Studio Projects\JE3_Src\JellyPhysics_Small\bin\Debug\JellyPhysics_Small.dll
+C:\Users\Adam\Desktop\Visual Studio Projects\JE3_Src\JellyPhysics_Small\bin\Debug\JellyPhysics_Small.pdb
+C:\Users\Adam\Desktop\Visual Studio Projects\JE3_Src\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.csproj.AssemblyReference.cache
+C:\Users\Adam\Desktop\Visual Studio Projects\JE3_Src\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.csproj.CoreCompileInputs.cache
+C:\Users\Adam\Desktop\Visual Studio Projects\JE3_Src\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.dll
+C:\Users\Adam\Desktop\Visual Studio Projects\JE3_Src\JellyPhysics_Small\obj\Debug\JellyPhysics_Small.pdb
diff --git a/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csprojAssemblyReference.cache b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csprojAssemblyReference.cache
new file mode 100644
index 0000000..847a684
Binary files /dev/null and b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.csprojAssemblyReference.cache differ
diff --git a/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.dll b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.dll
new file mode 100644
index 0000000..892b679
Binary files /dev/null and b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.dll differ
diff --git a/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.pdb b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.pdb
new file mode 100644
index 0000000..25ba7f0
Binary files /dev/null and b/JellyPhysics_Small/obj/Debug/JellyPhysics_Small.pdb differ
diff --git a/JellyPhysics_Small/obj/Debug/Refactor/JellyPhysics_Small.dll b/JellyPhysics_Small/obj/Debug/Refactor/JellyPhysics_Small.dll
new file mode 100644
index 0000000..a93d41d
Binary files /dev/null and b/JellyPhysics_Small/obj/Debug/Refactor/JellyPhysics_Small.dll differ
diff --git a/JellyPhysics_Small/obj/Debug/ResolveAssemblyReference.cache b/JellyPhysics_Small/obj/Debug/ResolveAssemblyReference.cache
new file mode 100644
index 0000000..22d2c3b
Binary files /dev/null and b/JellyPhysics_Small/obj/Debug/ResolveAssemblyReference.cache differ
diff --git a/JellyPhysics_Small/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache b/JellyPhysics_Small/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..a3908ca
Binary files /dev/null and b/JellyPhysics_Small/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csproj.AssemblyReference.cache b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csproj.AssemblyReference.cache
new file mode 100644
index 0000000..95e76bc
Binary files /dev/null and b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csproj.AssemblyReference.cache differ
diff --git a/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csproj.CoreCompileInputs.cache b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..726dad9
--- /dev/null
+++ b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+4360721588bcc69c09a71b1bf29ecf60ed163f36
diff --git a/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csproj.FileListAbsolute.txt b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..ec46684
--- /dev/null
+++ b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csproj.FileListAbsolute.txt
@@ -0,0 +1,5 @@
+C:\Users\Adam\Desktop\Visual Studio Projects\JE3_Src\JellyPhysics_Small\bin\Release\JellyPhysics_Small.dll
+C:\Users\Adam\Desktop\Visual Studio Projects\JE3_Src\JellyPhysics_Small\bin\Release\JellyPhysics_Small.pdb
+C:\Users\Adam\Desktop\Visual Studio Projects\JE3_Src\JellyPhysics_Small\obj\Release\JellyPhysics_Small.csproj.CoreCompileInputs.cache
+C:\Users\Adam\Desktop\Visual Studio Projects\JE3_Src\JellyPhysics_Small\obj\Release\JellyPhysics_Small.dll
+C:\Users\Adam\Desktop\Visual Studio Projects\JE3_Src\JellyPhysics_Small\obj\Release\JellyPhysics_Small.pdb
diff --git a/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csprojAssemblyReference.cache b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csprojAssemblyReference.cache
new file mode 100644
index 0000000..55ef9ca
Binary files /dev/null and b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.csprojAssemblyReference.cache differ
diff --git a/JellyPhysics_Small/obj/Release/JellyPhysics_Small.dll b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.dll
new file mode 100644
index 0000000..3679fab
Binary files /dev/null and b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.dll differ
diff --git a/JellyPhysics_Small/obj/Release/JellyPhysics_Small.pdb b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.pdb
new file mode 100644
index 0000000..fa353d1
Binary files /dev/null and b/JellyPhysics_Small/obj/Release/JellyPhysics_Small.pdb differ
diff --git a/JellyPhysics_Small/obj/x86/Debug/JellyPhysics_Small.csproj.FileListAbsolute.txt b/JellyPhysics_Small/obj/x86/Debug/JellyPhysics_Small.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..f75a3fe
--- /dev/null
+++ b/JellyPhysics_Small/obj/x86/Debug/JellyPhysics_Small.csproj.FileListAbsolute.txt
@@ -0,0 +1,5 @@
+C:\DEV\tfitzran_TimLaptop\p4-mdisney\Production\Internal_Development\Apps\JellyCarReturns\JelloEditor\JellyPhysics_Small\bin\x86\Debug\JellyPhysics_Small.dll
+C:\DEV\tfitzran_TimLaptop\p4-mdisney\Production\Internal_Development\Apps\JellyCarReturns\JelloEditor\JellyPhysics_Small\bin\x86\Debug\JellyPhysics_Small.pdb
+C:\DEV\tfitzran_TimLaptop\p4-mdisney\Production\Internal_Development\Apps\JellyCarReturns\JelloEditor\JellyPhysics_Small\obj\x86\Debug\ResolveAssemblyReference.cache
+C:\DEV\tfitzran_TimLaptop\p4-mdisney\Production\Internal_Development\Apps\JellyCarReturns\JelloEditor\JellyPhysics_Small\obj\x86\Debug\JellyPhysics_Small.dll
+C:\DEV\tfitzran_TimLaptop\p4-mdisney\Production\Internal_Development\Apps\JellyCarReturns\JelloEditor\JellyPhysics_Small\obj\x86\Debug\JellyPhysics_Small.pdb
diff --git a/JellyPhysics_Small/obj/x86/Debug/JellyPhysics_Small.dll b/JellyPhysics_Small/obj/x86/Debug/JellyPhysics_Small.dll
new file mode 100644
index 0000000..ca6d53f
Binary files /dev/null and b/JellyPhysics_Small/obj/x86/Debug/JellyPhysics_Small.dll differ
diff --git a/JellyPhysics_Small/obj/x86/Debug/JellyPhysics_Small.pdb b/JellyPhysics_Small/obj/x86/Debug/JellyPhysics_Small.pdb
new file mode 100644
index 0000000..3c076b4
Binary files /dev/null and b/JellyPhysics_Small/obj/x86/Debug/JellyPhysics_Small.pdb differ
diff --git a/JellyPhysics_Small/obj/x86/Debug/Refactor/JellyPhysics_Small.dll b/JellyPhysics_Small/obj/x86/Debug/Refactor/JellyPhysics_Small.dll
new file mode 100644
index 0000000..f8b7a44
Binary files /dev/null and b/JellyPhysics_Small/obj/x86/Debug/Refactor/JellyPhysics_Small.dll differ
diff --git a/JellyPhysics_Small/obj/x86/Debug/ResolveAssemblyReference.cache b/JellyPhysics_Small/obj/x86/Debug/ResolveAssemblyReference.cache
new file mode 100644
index 0000000..22d2c3b
Binary files /dev/null and b/JellyPhysics_Small/obj/x86/Debug/ResolveAssemblyReference.cache differ
diff --git a/JellyPhysics_Small/obj/x86/Release/JellyPhysics_Small.csproj.AssemblyReference.cache b/JellyPhysics_Small/obj/x86/Release/JellyPhysics_Small.csproj.AssemblyReference.cache
new file mode 100644
index 0000000..0b0020f
Binary files /dev/null and b/JellyPhysics_Small/obj/x86/Release/JellyPhysics_Small.csproj.AssemblyReference.cache differ
diff --git a/docs/Thumbs.db b/docs/Thumbs.db
new file mode 100644
index 0000000..1ac515f
Binary files /dev/null and b/docs/Thumbs.db differ
diff --git a/docs/addedpoints.jpg b/docs/addedpoints.jpg
new file mode 100644
index 0000000..d8c5187
Binary files /dev/null and b/docs/addedpoints.jpg differ
diff --git a/docs/addedpoly.jpg b/docs/addedpoly.jpg
new file mode 100644
index 0000000..0e437fe
Binary files /dev/null and b/docs/addedpoly.jpg differ
diff --git a/docs/allpolys.jpg b/docs/allpolys.jpg
new file mode 100644
index 0000000..47ecec7
Binary files /dev/null and b/docs/allpolys.jpg differ
diff --git a/docs/dynamicstep1.jpg b/docs/dynamicstep1.jpg
new file mode 100644
index 0000000..23856eb
Binary files /dev/null and b/docs/dynamicstep1.jpg differ
diff --git a/docs/dynamicstep2.jpg b/docs/dynamicstep2.jpg
new file mode 100644
index 0000000..1ddbd85
Binary files /dev/null and b/docs/dynamicstep2.jpg differ
diff --git a/docs/dynamicstep3.jpg b/docs/dynamicstep3.jpg
new file mode 100644
index 0000000..05d7b76
Binary files /dev/null and b/docs/dynamicstep3.jpg differ
diff --git a/docs/finaleditor.jpg b/docs/finaleditor.jpg
new file mode 100644
index 0000000..3c9388a
Binary files /dev/null and b/docs/finaleditor.jpg differ
diff --git a/docs/gridsettings.jpg b/docs/gridsettings.jpg
new file mode 100644
index 0000000..301bbd6
Binary files /dev/null and b/docs/gridsettings.jpg differ
diff --git a/docs/ingame1.jpg b/docs/ingame1.jpg
new file mode 100644
index 0000000..c524268
Binary files /dev/null and b/docs/ingame1.jpg differ
diff --git a/docs/ingame2.jpg b/docs/ingame2.jpg
new file mode 100644
index 0000000..7f6d76c
Binary files /dev/null and b/docs/ingame2.jpg differ
diff --git a/docs/kinematic.jpg b/docs/kinematic.jpg
new file mode 100644
index 0000000..00311ca
Binary files /dev/null and b/docs/kinematic.jpg differ
diff --git a/docs/motionsettings.jpg b/docs/motionsettings.jpg
new file mode 100644
index 0000000..63c18e8
Binary files /dev/null and b/docs/motionsettings.jpg differ
diff --git a/docs/newobject.jpg b/docs/newobject.jpg
new file mode 100644
index 0000000..690bc35
Binary files /dev/null and b/docs/newobject.jpg differ
diff --git a/docs/quick_guide.htm b/docs/quick_guide.htm
new file mode 100644
index 0000000..597b354
--- /dev/null
+++ b/docs/quick_guide.htm
@@ -0,0 +1,200 @@
+
+
+
+
+
+JelloCar Level Editor - Quick St
+
+
+
+
+@
+JelloCar Level Editor - Quick Start Guide
+@
+INTRODUCTION
+The physics in JelloCar are all based around
+points connected into shapes. Each point in the shape has mass, and moved
+independently of the other points. The shape is maintained by spring
+forces that act along the edges, optional internal springs, and also special
+"shape matching" forces that try to return an object to its original shape.
+JelloCar Level Editor allows quick creation of
+levels for JelloCar, through a fairly user-friendly interface.
+This guide does not try to be a full users
+manual, but instead explain the basics of building levels for JelloCar.
+@
+GETTING STARTED
+ Let's make a simple level. After
+starting up the level editor, choose Options -> Grid Setup.
+Set the "Grid Size" to 15 x 15. This is the number of major lines the grid
+will be made of, not the spacing between lines.
+Now set the "major grid lines" to 1. This is the distance between major
+grid lines.
+Finally, set the "Grid Subdivisions" to 5.
+![](gridsettings.jpg)
+This will create a grid that is 15 x 15 units in size, with
+major (white) lines every 1 unit, and minor lines (grey) every 0.2 units.
+For reference, the Car in JelloCar is about 3 units long.
+NOTE: You can pan the view by dragging the mouse with the
+middle mouse button pressed, and you can zoom the view by dragging
+left/right with the right mouse button pressed.
+@
+MAKING A STATIC BODY
+First, let's make a simple, completely static platform.
+Click the "New Object" button. This creates a new object in the world, with a
+default shape:
+![](newobject.jpg)
+We will make a very simple shape for this first platform.
+Don't worry too much about the overall size, we can scale it later. We
+just need to get the basic proportions right. First, click the "Object"
+tab in the upper-right, to go into Object mode, and edit this specific object.
+Next, make sure "Snap" is checked in the Options menu.
+@
+OBJECT EDITING
+NOTE: make sure to set a globally unique name for each new body
+you create, by entering the name into the "name" field in Object edit mode.
+Object editing has 3 basic modes: Point, Spring, and
+Polygon. In Point mode, you can move, add, and remove the points that make
+up the shape of the object.
+In Point mode, left click to select a point. hold SHIFT and
+click to add a new point (it will be added in sequence after the currently
+selected point). Hold CTRL and drag to move the currently selected point.
+If "Snap" is enabled, points will snap to the nearest grid point.
+Hold SHIFT and left click a few times to make a basic platform
+shape, and also CTRL and drag to move the original 3 points, until you have a
+basic shape:
+
+![](addedpoints.jpg)
+To make an object static, you just need to set the "Mass Per
+Point" on the right to zero (0).
+@
+To make this object visible in the game, we need to define the
+polygons (triangles) that make up the shape. Click the "Polygons" radial
+button to switch to Polygon mode.
+To add a polygon, SHIFT + Click the first point in the polygon,
+and then click the 2 other points. The polygon will be drawn on-screen in
+the current object color immediately:
+![](addedpoly.jpg)
+Continue adding polys until the entire object is filled:
+![](allpolys.jpg)
+NOTE: you can remove polygons by clicking on the poly
+while holding the ALT key on the keyboard.
+@
+That is all that's necessary to make a static object. To
+recap, static objects must have the "Mass Per Point" set to zero, and should
+have polygons set to make the object visible.
+Click the "Scene" tab, to go back to scene editing mode.
+In scene mode, click to select an object. Hold SHIFT and
+drag to move the currently selected object. hold CTRL and drag to rotate
+the current object. hold ALT and drag to scale the current object.
+You can also set the position, angle, and scale directly by entering numbers
+into the boxes on the lower right. Scale the object up a bit, and place it
+where you would like.
+@
+MAKING A DYNAMIC OBJECT
+Next let's make a simple dynamic object. Click the "New
+Object" button again, select the new object, and give it a unique name.
+Add a few points to make a shape like this:
+![](dynamicstep1.jpg)
+Since this is a dynamic object, make sure to set "Mass Per
+Point" to 1 (or any positive number) to make this object dynamic.
+Now let's add some springs to help this object keep its shape.
+There are 2 kinds of springs: Edge springs - spring forces that work on the
+edges of the shape, and Internal springs - springs you add between various
+points. Click the "Springs" radio button to switch to Spring mode.
+To add a spring, hold SHIFT, and drag the mouse from 1 point to
+another. The spring settings will be set to the current "Spring K" and
+"Damping" settings in the "Spring Settings" section:
+
+![](springsettings.jpg)
+For reference, low values are around 80-100, and high values are
+around 9,000. For damping, try not to exceed values above 50, or things
+might be unstable.
+Hold SHIFT and drag to create several internal springs:
+![](dynamicstep2.jpg)
+Don't forget t set the "Edge Settings" to proper spring values
+as well. Then, choose a color for the object, and add polygons in the same
+manner as before.
+NOTE: Shape matching is a system that tries to bring an object
+back to its base shape, no matter how deformed it gets. These are also
+spring forces, so you can set the shape matching to any valid spring force.
+![](dynamicstep3.jpg)
+@
+Click on the "Scene" tab to go back into scene editing mode, and
+place the object wherever you want.
+NOTE: each object in the world can be assigned a Material, which
+defines how it interacts with other objects, and also helps with keeping the
+game running fast, by ignoring impossible collision calculations. For
+background objects that will not collide with other background objects, set the
+material to "0: Basic Ground". For dynamic objects, set it to "1: Dynamic
+Object". Material number 2 and 3 are reserved for the car, and material 4
+is reserved for background objects made from Ice (very little friction).
+Set the first, static object you made to Material 0, and the new
+dynamic object to Material 1.
+@
+KINEMATIC OBJECTS
+Finally, let's make a kinematic object. Kinematic objects
+are exactly like dynamic objects, but they are "pinned" to the world instead of
+moving freely. They can also have special movement controls like Platform
+Motion (moves back and forth along a path), and Motor (constant rotation).
+First, make a new object as before, including internal springs and polygons.
+NOTE: Kinematic motion is handled by the Shape Matching springs,
+so stiff Shape Matching springs will keep the object pinned tightly, while small
+spring forces will allow the object to stray further.
+To designate an object as kinematic, just check the checkbox:
+![](kinematic.jpg)
+To set specific motion, go back to Scene mode, and choose
+Special -> Object Motion Settings from the menu:
+
+![](motionsettings.jpg)
+You can set any combination of Platform Motion and Motor.
+NOTE: "Starting Offset" for platform motion allows you to start
+a platform midway through it's path. This should be a value between [0,1].
+@
+SCENE SETTINGS
+Some other important scene settings also need to be set.
+Click Special -> Scene Settings:
+
+![](scenesettings.jpg)
+
+Scene Name: this is the name for the level that will be shown in the main menu.
+Car Name: name of the car for this level to use. the
+default car name is "car_and_truck". This is the only car currently in the
+game.
+Spawn Position: where the car will start the level. Shown
+in the editor as a yellow circle.
+Finish Position: the target position that designates the end of
+the level. Shown in the editor as a light blue square.
+Fall Line: the Y position that designates "out of bounds"
+for the level. Shown as a purple horizontal line in the editor.
+@
+SAVING THE SCENE
+Choosing "Save" from the File menu will just save the current
+scene layout, not the individual objects in it.
+Choosing "Save all" from the File menu will save the current
+scene, as well as all objects contained in it.
+@
+MAKING THE SCENE WORK IN THE GAME
+From the File menu, choose "Publish to JelloCar". Find the
+install directory for JelloCar (defaults to C:/Program Files/JelloCar), and save
+your scene into the "Assets/Scenes" directory. The editor will
+automatically add your level to the list, and it will be available the next time
+you start JelloCar.
+@
+NOTE: Be careful that all of the objects in your scene have
+unique names, so that you don't accidentally overwrite a file being used by
+another level accidentally!
+@
+@
+![](finaleditor.jpg)
+Best times for the level will automatically be saved.
+@
+And now you should be able to see and play your scene in the
+game!
+@
+good luck!
+@
+-Walaber
+
+
+
+
diff --git a/docs/scenesettings.jpg b/docs/scenesettings.jpg
new file mode 100644
index 0000000..402415c
Binary files /dev/null and b/docs/scenesettings.jpg differ
diff --git a/docs/springsettings.jpg b/docs/springsettings.jpg
new file mode 100644
index 0000000..9c24756
Binary files /dev/null and b/docs/springsettings.jpg differ