Adding distance constraint.
diff --git a/Nima-Math-Cpp b/Nima-Math-Cpp
index 488baa0..d413bc2 160000
--- a/Nima-Math-Cpp
+++ b/Nima-Math-Cpp
@@ -1 +1 @@
-Subproject commit 488baa0dc91271fc4cd0f5086c837bf38d598007
+Subproject commit d413bc24bbbd6cf5601f72d1f33e080a462b5167
diff --git a/Source/Actor.cpp b/Source/Actor.cpp
index fde80c7..d2162ce 100644
--- a/Source/Actor.cpp
+++ b/Source/Actor.cpp
@@ -6,6 +6,7 @@
 #include "ActorScaleConstraint.hpp"
 #include "ActorTranslationConstraint.hpp"
 #include "ActorRotationConstraint.hpp"
+#include "ActorDistanceConstraint.hpp"
 #include "ActorTransformConstraint.hpp"
 #include "ActorEvent.hpp"
 #include "ActorNodeSolo.hpp"
@@ -473,6 +474,9 @@
 			case BlockType::ActorTransformConstraint:
 				component = ActorTransformConstraint::read(this, componentBlock);
 				break;
+			case BlockType::ActorDistanceConstraint:
+				component = ActorDistanceConstraint::read(this, componentBlock);
+				break;
 			default:
 				// Not handled/expected block.
 				break;
diff --git a/Source/ActorDistanceConstraint.cpp b/Source/ActorDistanceConstraint.cpp
new file mode 100644
index 0000000..7666522
--- /dev/null
+++ b/Source/ActorDistanceConstraint.cpp
@@ -0,0 +1,92 @@
+#include "ActorDistanceConstraint.hpp"
+#include "BlockReader.hpp"
+#include "ActorNode.hpp"
+
+using namespace nima;
+
+ActorDistanceConstraint::ActorDistanceConstraint() : Base(nullptr, ComponentType::ActorDistanceConstraint),
+	m_Mode(Mode::Closer),
+	m_Distance(100.0f)
+{
+
+}
+
+void ActorDistanceConstraint::copy(ActorDistanceConstraint* node, Actor* resetActor)
+{
+	Base::copy(node, resetActor);
+
+	m_Mode = node->m_Mode;
+	m_Distance = node->m_Distance;
+}
+
+ActorComponent* ActorDistanceConstraint::makeInstance(Actor* resetActor)
+{
+	ActorDistanceConstraint* instance = new ActorDistanceConstraint();
+	instance->copy(this, resetActor);
+	return instance;
+}
+
+ActorDistanceConstraint* ActorDistanceConstraint::read(Actor* actor, BlockReader* reader, ActorDistanceConstraint* constraint)
+{
+	if(constraint == nullptr)
+	{
+		constraint = new ActorDistanceConstraint();
+	}
+	Base::read(actor, reader, constraint);
+
+	constraint->m_Distance = reader->readFloat();
+	constraint->m_Mode = (Mode)reader->readByte();
+
+	return constraint;
+}
+
+void ActorDistanceConstraint::constrain(ActorNode* node)
+{
+	// TODO: Should ActorTargetedConstraint just store targets as nodes?
+    ActorNode* target = static_cast<ActorNode*>(m_Target);
+	if(target == nullptr)
+	{
+		return;
+	}
+	
+	Vec2D targetTranslation;
+	target->worldTranslation(targetTranslation);
+	
+	Vec2D ourTranslation;
+	m_Parent->worldTranslation(ourTranslation);
+
+	Vec2D toTarget;
+	Vec2D::subtract(toTarget, ourTranslation, targetTranslation);
+	float currentDistance = Vec2D::length(toTarget);
+	switch(m_Mode)
+	{
+		case Mode::Closer:
+			if(currentDistance < m_Distance)
+			{
+				return;
+			}
+			break;
+		case Mode::Further:
+			if(currentDistance > m_Distance)
+			{
+				return;
+			}
+			break;
+		default:
+			break;
+	}
+	if(currentDistance < 0.001f)
+	{
+		return;
+	}
+
+	Vec2D::scale(toTarget, toTarget, 1.0f/currentDistance);
+	Vec2D::scale(toTarget, toTarget, m_Distance);
+
+	Mat2D& world = m_Parent->mutableWorldTransform();
+	Vec2D position;
+	Vec2D::add(position, targetTranslation, toTarget);
+	Vec2D::lerp(position, ourTranslation, position, m_Strength);
+	world[4] = position[0];
+	world[5] = position[1];
+}
\ No newline at end of file
diff --git a/Source/ActorDistanceConstraint.hpp b/Source/ActorDistanceConstraint.hpp
new file mode 100644
index 0000000..181c849
--- /dev/null
+++ b/Source/ActorDistanceConstraint.hpp
@@ -0,0 +1,30 @@
+#ifndef _NIMA_ACTORDISTANCECONSTRAINT_HPP_
+#define _NIMA_ACTORDISTANCECONSTRAINT_HPP_
+
+#include "ActorTargetedConstraint.hpp"
+
+namespace nima
+{
+    class ActorDistanceConstraint : public ActorTargetedConstraint
+    {
+        typedef ActorTargetedConstraint Base;
+        private:
+            enum class Mode
+            {
+                Closer = 0,
+                Further = 1,
+                Exact = 2
+            };
+            Mode m_Mode;
+            float m_Distance;
+
+        public:
+            ActorDistanceConstraint();
+            void copy(ActorDistanceConstraint* node, Actor* resetActor);
+            ActorComponent* makeInstance(Actor* resetActor) override;
+            static ActorDistanceConstraint* read(Actor* actor, BlockReader* reader, ActorDistanceConstraint* constraint = nullptr);
+            void constrain(ActorNode* node) override;
+    };
+}
+
+#endif
\ No newline at end of file