<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>src/modules/physics/box2d/GearJoint.cpp</filename>
    </added>
    <added>
      <filename>src/modules/physics/box2d/GearJoint.h</filename>
    </added>
    <added>
      <filename>src/modules/physics/box2d/wrap_GearJoint.cpp</filename>
    </added>
    <added>
      <filename>src/modules/physics/box2d/wrap_GearJoint.h</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -73,6 +73,7 @@ namespace love
 		LOVE_PHYSICS_PRISMATIC_JOINT_ID,
 		LOVE_PHYSICS_REVOLUTE_JOINT_ID,
 		LOVE_PHYSICS_PULLEY_JOINT_ID,
+		LOVE_PHYSICS_GEAR_JOINT_ID,
 
 		// Modules.
 		LOVE_PHYSFS_ID, 
@@ -133,6 +134,7 @@ namespace love
 	const bits LOVE_PHYSICS_PRISMATIC_JOINT_BITS = (bits(1) &lt;&lt; LOVE_PHYSICS_PRISMATIC_JOINT_ID) | LOVE_PHYSICS_JOINT_BITS;
 	const bits LOVE_PHYSICS_REVOLUTE_JOINT_BITS = (bits(1) &lt;&lt; LOVE_PHYSICS_REVOLUTE_JOINT_ID) | LOVE_PHYSICS_JOINT_BITS;
 	const bits LOVE_PHYSICS_PULLEY_JOINT_BITS = (bits(1) &lt;&lt; LOVE_PHYSICS_PULLEY_JOINT_ID) | LOVE_PHYSICS_JOINT_BITS;
+	const bits LOVE_PHYSICS_GEAR_JOINT_BITS = (bits(1) &lt;&lt; LOVE_PHYSICS_GEAR_JOINT_ID) | LOVE_PHYSICS_JOINT_BITS;
 
 	// Modules.
 	const bits LOVE_PHYSFS_BITS = bits(1) &lt;&lt; LOVE_PHYSFS_ID;</diff>
      <filename>src/common/types.h</filename>
    </modified>
    <modified>
      <diff>@@ -46,6 +46,8 @@ namespace box2d
 	**/
 	class Joint : public Object
 	{
+		friend class GearJoint;
+		
 	private:
 		
 		// A Joint must be destroyed *before* the bodies it acts upon, </diff>
      <filename>src/modules/physics/box2d/Joint.h</filename>
    </modified>
    <modified>
      <diff>@@ -171,6 +171,11 @@ namespace box2d
 	{
 		return new PulleyJoint(body1, body2, groundAnchor1, groundAnchor2, anchor1, anchor2, ratio);
 	}
+
+	GearJoint * Physics::newGearJoint(Joint * joint1, Joint * joint2, float ratio)
+	{
+		return new GearJoint(joint1, joint2, ratio);
+	}
 
 } // box2d
 } // physics</diff>
      <filename>src/modules/physics/box2d/Physics.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -35,6 +35,7 @@
 #include &quot;PrismaticJoint.h&quot;
 #include &quot;RevoluteJoint.h&quot;
 #include &quot;PulleyJoint.h&quot;
+#include &quot;GearJoint.h&quot;
 
 namespace love
 {
@@ -185,6 +186,14 @@ namespace box2d
 		* @param ratio The pulley ratio.
 		**/
 		PulleyJoint * newPulleyJoint(Body * body1, Body * body2, b2Vec2 groundAnchor1, b2Vec2 groundAnchor2, b2Vec2 anchor1, b2Vec2 anchor2, float ratio);
+
+		/**
+		* Creates a new GearJoint connecting joint1 with joint2.
+		* @param joint1 The first joint.
+		* @param joint2 The second joint.
+		* @param ratio The gear ratio.
+		**/
+		GearJoint * newGearJoint(Joint * joint1, Joint * joint2, float ratio);
 
 
 	}; // Physics</diff>
      <filename>src/modules/physics/box2d/Physics.h</filename>
    </modified>
    <modified>
      <diff>@@ -191,6 +191,17 @@ namespace box2d
 		luax_newtype(L, &quot;PulleyJoint&quot;, LOVE_PHYSICS_PULLEY_JOINT_BITS, (void*)j);
 		return 1;
 	}
+	
+	int _wrap_newGearJoint(lua_State * L)
+	{
+		Joint * joint1 = luax_checktype&lt;Joint&gt;(L, 1, &quot;Joint&quot;, LOVE_PHYSICS_JOINT_BITS);
+		Joint * joint2 = luax_checktype&lt;Joint&gt;(L, 2, &quot;Joint&quot;, LOVE_PHYSICS_JOINT_BITS);
+		float ratio = (float)luaL_optnumber(L, 3, 1.0);
+
+		GearJoint * j = instance-&gt;newGearJoint(joint1, joint2, ratio);
+		luax_newtype(L, &quot;GearJoint&quot;, LOVE_PHYSICS_GEAR_JOINT_BITS, (void*)j);
+		return 1;
+	}
 
 	// List of functions to wrap.
 	static const luaL_Reg wrap_Physics_functions[] = {
@@ -204,6 +215,7 @@ namespace box2d
 		{ &quot;newRevoluteJoint&quot;, _wrap_newRevoluteJoint },
 		{ &quot;newPrismaticJoint&quot;, _wrap_newPrismaticJoint },
 		{ &quot;newPulleyJoint&quot;, _wrap_newPulleyJoint },
+		{ &quot;newGearJoint&quot;, _wrap_newGearJoint },
 		{ 0, 0 },
 	};
 
@@ -220,6 +232,7 @@ namespace box2d
 		wrap_PrismaticJoint_open,
 		wrap_RevoluteJoint_open,
 		wrap_PulleyJoint_open,
+		wrap_GearJoint_open,
 		0
 	};
 </diff>
      <filename>src/modules/physics/box2d/wrap_Physics.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -35,6 +35,7 @@
 #include &quot;wrap_PrismaticJoint.h&quot;
 #include &quot;wrap_RevoluteJoint.h&quot;
 #include &quot;wrap_PulleyJoint.h&quot;
+#include &quot;wrap_GearJoint.h&quot;
 
 namespace love
 {
@@ -52,6 +53,7 @@ namespace box2d
 	int _wrap_newRevoluteJoint(lua_State * L);
 	int _wrap_newPrismaticJoint(lua_State * L);
 	int _wrap_newPulleyJoint(lua_State * L);
+	int _wrap_newGearJoint(lua_State * L);
 	int wrap_Physics_open(lua_State * L);
 
 } // box2d</diff>
      <filename>src/modules/physics/box2d/wrap_Physics.h</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0ac19abe4a75ec14f73c30fc778df664e823a817</id>
    </parent>
  </parents>
  <author>
    <name>tenoch</name>
    <email>tenoch@3494dbca-881a-0410-bd34-8ecbaf855390</email>
  </author>
  <url>http://github.com/JackDanger/love/commit/596c98c88bde046f01d6898fda8b46013804aad6</url>
  <id>596c98c88bde046f01d6898fda8b46013804aad6</id>
  <committed-date>2009-07-22T10:21:13-07:00</committed-date>
  <authored-date>2009-07-22T10:21:13-07:00</authored-date>
  <message>Added GearJoint to love.physics


git-svn-id: https://love.svn.sf.net/svnroot/love/trunk@774 3494dbca-881a-0410-bd34-8ecbaf855390</message>
  <tree>5dc78c30093221b4d2ce0e522d96b0f676f0c59a</tree>
  <committer>
    <name>tenoch</name>
    <email>tenoch@3494dbca-881a-0410-bd34-8ecbaf855390</email>
  </committer>
</commit>
