<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sgt. Conker &#187; Physics</title>
	<atom:link href="http://www.sgtconker.com/category/xna/physics/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sgtconker.com</link>
	<description>We are &#34;absolutely fine&#34;</description>
	<lastBuildDate>Wed, 06 Jul 2011 13:29:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Article: XNA Farseer Platform Physics Tutorial</title>
		<link>http://www.sgtconker.com/2010/09/article-xna-farseer-platform-physics-tutorial/</link>
		<comments>http://www.sgtconker.com/2010/09/article-xna-farseer-platform-physics-tutorial/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 19:48:45 +0000</pubDate>
		<dc:creator>Absolutely Fine Tutorial Contest</dc:creator>
				<category><![CDATA[2010 Contest Entries]]></category>
		<category><![CDATA[2D]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Contest]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Absolutely Fine Tutorial Contest]]></category>
		<category><![CDATA[Farseer]]></category>
		<category><![CDATA[Platformer]]></category>
		<category><![CDATA[Roy Triesscheijn]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1756</guid>
		<description><![CDATA[by Roy Triesscheijn
Today I’m going to introduce you to a neat 2D physics engine for XNA called Farseer. With the help of this 2D physics engine we are going to create a small platform ‘game’ while introducing the important concepts of Farseer like bodies, geometry, joints and springs.
By the end of the tutorial, you'll be [...]]]></description>
			<content:encoded><![CDATA[<h4 style="text-align: center;">by <span><a href="http://www.roy-t.nl">Roy Triesscheijn</a></span></h4>
<p>Today I’m going to introduce you to a neat 2D physics engine for XNA called Farseer. With the help of this 2D physics engine we are going to create a small platform ‘game’ while introducing the important concepts of Farseer like bodies, geometry, joints and springs.</p>
<p>By the end of the tutorial, you'll be able to build something like:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/iC_Y9Tq5JeU?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/iC_Y9Tq5JeU?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><span id="more-1756"></span></p>
<h2>Set-up<img src="file:///D:/Personal/Desktop/sgt%20conker%20contest/2010%20Tutorial%20contest%20entry/Pictures/SolutionExplorer.PNG" alt="" /><img src="file:///D:/Personal/Desktop/sgt%20conker%20contest/2010%20Tutorial%20contest%20entry/Pictures/see-saw.png" alt="" /><img src="file:///D:/Personal/Desktop/sgt%20conker%20contest/2010%20Tutorial%20contest%20entry/Pictures/boxboy.jpg" alt="" /><img src="file:///D:/Personal/Desktop/sgt%20conker%20contest/2010%20Tutorial%20contest%20entry/Pictures/BoxAndGround.png" alt="" /></h2>
<p>Before we can get started please download the latest stable release at <a href="http://farseerphysics.codeplex.com/">http://farseerphysics.codeplex.com</a> (at the time of writing that was 2.1.3) and extract the solution somewhere. Now also download the “Added motor to RevoluteJoint and FixedRevoluteJoint” patch at <a href="http://farseerphysics.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=70619">http://farseerphysics.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=70619</a>. You will find two files in the archive (RevoluteJoint.cs and FixedRevoluteJoint.cs) extract these and copy these over the files in “Farseer Physics 2.1.3 XNA\Dynamics\Joints”.</p>
<h2>Creating a project</h2>
<p>Now let’s fire up Visual Studio and create a new XNA 3.1 Windows Game project, call it anything you like. I’ve called it “FarseerPlatformer”. Now add the Farseer project to our solution: right click the our solution in the solution explorer and select “Add existing project”, then browse to where you’ve extracted Farseer and select the FarseerPhysicsXNA.csproj.</p>
<p style="text-align: center;"><img class="aligncenter" title="Solution Explorer" src="http://www.sgtconker.com/wp-content/uploads/contest/2010/roy/SolutionExplorer.PNG" alt="" width="261" height="326" /></p>
<p>Now add a reference to the FarseerPhysicsXNA project in your own project by right clicking the References folder in the solution explorer and choosing “Add reference”. Then select FarseerPhysicsXNA from the tab “Projects” and press ok.</p>
<p>If your solution explorer now looks like the picture on the left we’re ready to try and compile. Hit F6 on your keyboard. There should be no errors.</p>
<h2>My  first physics</h2>
<p>The physics simulator class is the heart of the Farseer physics engine and will control all our physics objects. Let’s create one!</p>
<p>Open Game1.cs and add the following using statements at the top of the file.</p>
<pre class="brush: csharp; title: ;">
using FarseerGames.FarseerPhysics;
using FarseerGames.FarseerPhysics.Dynamics;
using FarseerGames.FarseerPhysics.Factories;
using FarseerGames.FarseerPhysics.Collisions;
</pre>
<p>Now let’s create a PhysicsSimulator called physics. Add this definition at the top of the class.</p>
<pre class="brush: csharp; title: ;">
PhysicsSimulator physics;
</pre>
<p>And instantiate it by adding the following line to the end of the constructor.</p>
<pre class="brush: csharp; title: ;">
physics = new PhysicsSimulator(Vector2.UnitY * 500);
</pre>
<p>This will create a new physics simulator with a predefined gravity of (0, 500) which means that there is a constant force of strength 500 pushing everything down. 500 here is just an arbitrary number, play around with this value as much as possible to tweak the feel of your games.</p>
<p>All we need todo to make the physics simulator work is making it update every frame by adding the following line at the end of the Update method.</p>
<pre class="brush: csharp; title: ;">
physics.Update((float)gameTime.ElapsedGameTime.TotalSeconds);
</pre>
<p>So that’s it. We’re done! But well, you can’t actually see anything yet. Let’s make a very simple class called PhysicsObject. I will not put down the entire class right here, see the source code for that. However there is one method that deserves special attention:</p>
<pre class="brush: csharp; title: ;">
protected virtual void SetupPhysics(PhysicsSimulator physics,
            Vector2 position, float width, float height, float mass)
        {
            body = BodyFactory.Instance.CreateRectangleBody(physics,
                                                width, height, mass);
            body.Position = position;

            geom = GeomFactory.Instance.CreateRectangleGeom(physics,
                                                body, width, height);
            geom.FrictionCoefficient = 0.5f;
        }
</pre>
<p>In this method we create the ‘physical representation’ for our new object.  For this we need two fields: body of type Body and geom of type Geom. Body represents a handle which we can push and pull and apply all sorts of forces to. Geom (short for geometry) handles the actual collisions and friction. Both objects fire numerous events which you can handle, the most useful one is geom’s OnCollision event that we will use in the final chapter.</p>
<p>Instantiating them is very easy. Just use the apropiate factory class to get a new instances, make sure to always choose the overload that also asks for a PhysicsSimulator object so that your object is automatically registered in the simulation. Also note that the PhysicsSimulator uses the center of an object as its position, while the SpriteBatch uses the top left corner normally, take this into account when drawing by setting the origin to the center of the texture when using the SpriteBatch.<br />
Add a texture to your content project and quickly instantiate a new PhysicsObject like this:</p>
<pre class="brush: csharp; title: ;">
squareTex = Content.Load&lt;Texture2D&gt;(&quot;square&quot;);
box = new PhysicsObject(physics, new Vector2(100, 0), 64, 64, 10, squareTex);
</pre>
<p>Then add the following lines to the draw method in Game1.</p>
<pre class="brush: csharp; title: ;">
spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate,
                                              SaveStateMode.SaveState);
box.Draw(spriteBatch);
spriteBatch.End();
</pre>
<p>If you run the simulation now you should see a falling square. Nifty isn’t it?</p>
<h2>Laying grounds</h2>
<p>Now we need to make some ground that will stop our square from falling down at terminal velocity. To do this we’re going to make a static body. This means that the body is unaffected by all forces but still is in our simulation, handy for making immovable objects like ground and walls. To do this neatly we will make a new class that inherits from the PhysicsObject class. Call this class StaticPhysicsObject.<br />
Because of inheritance all we have to write in this new clas is this:</p>
<pre class="brush: csharp; title: ;">
    public class StaticPhysicsObject : PhysicsObject
    {
        public StaticPhysicsObject(PhysicsSimulator physics, Vector2 position, float width, float height, Texture2D texture)
            : base(physics, position, width, height, 1, texture)
        {
            body.IsStatic = true;
        }
    }
</pre>
<p>Note how we always pass a mass of 1, mass isn’t important for a static object.</p>
<p>Create a new field StaticPhysicsObject ground in Game1 and instantiate it in LoadContent like this:</p>
<pre class="brush: csharp; title: ;">
ground = new StaticPhysicsObject(physics, new Vector2(GraphicsDevice.Viewport.Width / 2, 500), GraphicsDevice.Viewport.Width, 64, squareTex);
</pre>
<p>Don’t forget to draw it in the Draw method.</p>
<p>You should now see a square falling down  and stopping when it hits our new ground.</p>
<p><img class="alignnone" title="Box and Ground" src="http://www.sgtconker.com/wp-content/uploads/contest/2010/roy/BoxAndGround.png" alt="" width="100%" /></p>
<h2>Joints</h2>
<p>Let’s make the simulation a bit more interesting by creating a see-saw. Quickly add two more PhysicsObjects, instantiate them like this:</p>
<pre class="brush: csharp; title: ;">
            seeSawBottom = new PhysicsObject(physics, new Vector2(175, 300), 50, 50, 1000, squareTex);
            seeSawTop = new PhysicsObject(physics, new Vector2(175, 200), 300, 30, 25, squareTex);
</pre>
<p>And write some draw code. Now let’s fire up the simulation again. You will now see our original block smash hard into our see-saw, rolling out of screen while the see-saw almost falls apart.</p>
<p>This looks awesome, however we would like the see-saw to behave as one object, so let’s introduce a joint. A joint is a way of fixing two bodies or a body and the background together (like an axel that connects a wheel to a car). There are multiple types of joints. For an explantion of the different types of joints see this page: <a href="http://www.farseergames.com/storage/farseerphysics/Manual2.1.htm#_Toc213068491">http://www.farseergames.com/storage/farseerphysics/Manual2.1.htm#_Toc213068491</a></p>
<p>We are going to create a revolute joint, that fixes two bodies together but still alows them to rotate independently, very handy for a see-saw or a wheel. To demonstate this we will create a new class called CompositePhysicsObject as below:</p>
<pre class="brush: csharp; title: ;">
public class CompositePhysicsObject
    {
        public CompositePhysicsObject(PhysicsSimulator physics, PhysicsObject poA, PhysicsObject poB, Vector2 relativeJointPosition)
        {
            this.poA = poA;
            this.poB = poB;

            joint = JointFactory.Instance.CreateRevoluteJoint(physics, poA.body, poB.body, poA.Position + relativeJointPosition);
            poA.geom.IgnoreCollisionWith(poB.geom);
            poB.geom.IgnoreCollisionWith(poA.geom);
        }

        public virtual void Draw(SpriteBatch spriteBatch)
        {
            poA.Draw(spriteBatch);
            poB.Draw(spriteBatch);
        }

        protected RevoluteJoint joint;
        protected PhysicsObject poA;
        protected PhysicsObject poB;
    }
</pre>
<p>Just as with the bodies and geoms we create a joint with a factory. Creating a revolute joint is very easy, the second body is attached to the first body at the absolute (world) position. To make it easier to create a composite physics object we are using a relative position (or offset) from the first body. Note that you will have to make sure yourself that the bodies overlap, the second body will not be moved by creating a joint. (Note: bodies don’t have to overlap to be fixed together by joints, but this will look pretty funny).</p>
<p>We also need to make sure that the geometries of both physics objects do not register colliding with each other; else we would get some very buggy results.</p>
<p>Let’s go back to the Game1 class, add a field called seeSaw of type CompositePhysicsObject and change the load content method to look like this:</p>
<pre class="brush: csharp; title: ;">
protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            squareTex = Content.Load&lt;Texture2D&gt;(&quot;square&quot;);
            box = new PhysicsObject(physics, new Vector2(100, 0), 64, 64, 10, squareTex);
            seeSawBottom = new PhysicsObject(physics, new Vector2(175, 300), 50, 50, 1000, squareTex);
            seeSawTop = new PhysicsObject(physics, new Vector2(175, 285), 300, 30, 25, squareTex);
            seeSaw = new CompositePhysicsObject(physics, seeSawTop, seeSawBottom, new Vector2(0, 15));
            ground = new StaticPhysicsObject(physics, new Vector2(GraphicsDevice.Viewport.Width / 2, 500), GraphicsDevice.Viewport.Width, 64, squareTex);
        }
</pre>
<p>Also update the drawing method:</p>
<pre class="brush: csharp; title: ;">
protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);
            spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.SaveState);
            box.Draw(spriteBatch);
            seeSaw.Draw(spriteBatch);
            ground.Draw(spriteBatch);
            spriteBatch.End();
            base.Draw(gameTime);
        }
</pre>
<p>Run, you will now have a box dropping on a fully functional see-saw.</p>
<h2>Springs</h2>
<p>You know what would be even cooler? If our see-saw would have a spring that would make our see-saw come back up again after our falling box hits it. With Farseer you can make numerous types of springs, for a full overview see the Springs section in the manual here: <a href="http://www.farseergames.com/storage/farseerphysics/Manual2.1.htm#_Toc213068498">http://www.farseergames.com/storage/farseerphysics/Manual2.1.htm#_Toc213068498</a></p>
<p>To improve our see-saw we are going to use an AngleSpring. This type of spring tries to keep two objects (or one object and the background) at a specified angle by applying a specified amount of torque (or less).</p>
<p>Let’s create a new class that inherits from our CompositePhysicsObject class. I couldn’t think of a decent name for it, so I just called it SpringPhysicsObject. This new class will compose two physics objects together (just as before) but will now also add an angle spring to try and keep two objects at a specified angle. (If you want to force two objects to always stay at a specified angle of each other you should use an angle joint, and if you want one object to always stay at a specified angle, use a fixed angle joint).</p>
<pre class="brush: csharp; title: ;">
public class SpringPhysicsObject : CompositePhysicsObject
    {
        public SpringPhysicsObject(PhysicsSimulator physics, PhysicsObject poA, PhysicsObject poB, Vector2 relativeJointPosition, float springForce, float springDampening)
            : base(physics, poA, poB, relativeJointPosition)
        {
            angleSpring = SpringFactory.Instance.CreateAngleSpring(physics, poA.body, poB.body, springForce, springDampening);
            angleSpring.MaxTorque = springForce;
        }

        protected AngleSpring angleSpring;
    }
</pre>
<p>As you can see we again don’t need to write a lot of code since inheriting from CompositePhysicsObject will already join our two bodies together. All we need to do is to create a new angle spring, as always via a factory. I think spring force and spring dampening speak for themselves. MaxTorque is the maximum amount of torque that will be applied to stay at the given angle. Note that you usually need very high values for spring force to make this work properly (just as in real life).<br />
Now that we have this new SpringPhysicsObject, replace our CompositePhysicsObject and instantiate it like this in the LoadContent method.</p>
<pre class="brush: csharp; title: ;">
seeSaw2 = new SpringPhysicsObject(physics, seeSawTop, seeSawBottom, new Vector2(0, 15), 10000000, 10000);
</pre>
<p>Also update the draw method.<br />
Now run the simulation and see how our see-saw behaves now!</p>
<p><img class="alignnone" title="See Saw" src="http://www.sgtconker.com/wp-content/uploads/contest/2010/roy/see-saw.png" alt="" width="100%" /></p>
<h2>Force</h2>
<p>Now what if we want to control the falling box? Maybe make it move a little, have it jump up and down, etc.<br />
To do this we need to apply force to our object. To demonstrate this we’re going to make a new class called Character that inherits from PhysicsObject.</p>
<pre class="brush: csharp; title: ;">
public class Character : PhysicsObject
    {
        public Character(PhysicsSimulator physics, Vector2 position, float width, float height, float mass, Texture2D texture)
            : base(physics, position, width, height, mass, texture)
        {
        }

        public virtual void Update(GameTime gameTime)
        {
            HandleInput(gameTime);
        }

        protected virtual void HandleInput(GameTime gameTime)
        {
            keyState = Keyboard.GetState();

            //Apply force in the arrow key direction
            Vector2 force = Vector2.Zero;
            if (keyState.IsKeyDown(Keys.Left))
            {
                force.X -= forcePower * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }
            if (keyState.IsKeyDown(Keys.Right))
            {
                force.X += forcePower * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }
            if (keyState.IsKeyDown(Keys.Up))
            {
                force.Y -= forcePower * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }
            if (keyState.IsKeyDown(Keys.Down))
            {
                force.Y += forcePower * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }

            body.ApplyForce(ref force);

            oldState = keyState;
        }

        public float forcePower;
        protected KeyboardState keyState;
        protected KeyboardState oldState;

    }
</pre>
<p>As you can see force is easily applied just by constructing a force vector and calling body.ApplyForce(). We pass the vector by reference so that the garbage collector doesn’t have to jump in and act too often (since Vector2 is a value type, its normally copied each time it’s passed to a different method, don’t worry too much about that right now).<br />
You can apply impulse in the same way. (Impulse is direct, useful for jumping and explosions, while force is steadily added, more useful to make a jetpack work for example).<br />
Let’s play: in Game1 replace our box of type PhysicsObject with a box of type Character. Set box.forcePower to 1000000.  Also add box.Update(gameTime); to the Update method in Game1 and make sure the box is being drawn.<br />
If you did everything correct you should now be able to control the falling box with the arrows on your keyboard.</p>
<h2>A game character</h2>
<p>Now we’ve got all of the basics covered it’s time to talk about creating a more realistic game character. Without physics you would move an object by changing its position when a key is pressed. Jumping would be done by creating two ‘fake forces’ that sent the object up and down. When using a physics engine you shouldn’t just move your character, this will make it very hard for Farseer to handle collisions because for Farseer it looks like the character just teleported a tiny amount (there are no forces, impulses or torque present). For a realistic character we need to apply forces to a body, however this causes a problem: how much force do we apply? Do we keep applying forces (e.g. the character keeps accelerating)? This sounds very unrealistic, as a normal person quickly accelerates in just a few steps and then stays at his running speed. We could do with impulses, that instantly generate movement, however stopping the character is going to be even more problematic then. And if we encounter a slope or if the friction is not set to 0 the character will slow down until the user releases and presses the move key again.<br />
Suffice it to say that I’ve been trying all sorts of stuff for two days to get a character moving the way I want it (instant start and stop, controllable air movements, steady running speed, also characters normally don’t fall over).<br />
Luckily I came across Bryan Dismas’ blog who wrote an article on this <a href="http://amazingretardo.simiansoftwerks.com/2010/02/17/platformer-character-control-farseer-physics-engine/">http://amazingretardo.simiansoftwerks.com/2010/02/17/platformer-character-control-farseer-physics-engine/</a>. He adopted this idea from Robert Dodd (<a href="http://boxycraft.wordpress.com">http://boxycraft.wordpress.com</a>) and I’m going to change it even further.</p>
<p><img src="http://www.sgtconker.com/wp-content/uploads/contest/2010/roy/boxboy.jpg" alt="Boxboy" /><br />
<em>Image by Robert Dodd</em></p>
<p>The idea is to create a character from two parts: the upper body is just a simple rectangle. The lower body is a circle/wheel that we rotate so that we can move around and climb slopes without problems. We’re going to create a slightly simpler version of this.</p>
<ul>
<li>Upper body: a rectangle body always kept up-right using a fixed angle joint.</li>
<li>Lower body: a circle connected to the upper body using a revolute joint.</li>
</ul>
<p>With the current version of Farseer this is enough to have a nice character jumping around. So let’s write some code.<br />
Create a class called CompositeCharacter which inherits from Character.<br />
The class is fairly long because I also had to add a bit of state management to make walking, jumping and moving in-air work. However for this tutorial the most important is the overloaded method SetupPhysics that is listed here below.</p>
<pre class="brush: csharp; title: ;">
protected override void SetupPhysics(PhysicsSimulator physics, Vector2 position, float width, float height, float mass)
        {
            //Create a body that is almost the size of the entire object
            //but with the bottom part cut off.
            float upperBodyHeight = height - (width / 2);
            body = BodyFactory.Instance.CreateRectangleBody(physics, width, upperBodyHeight, mass / 2);
            //also shift it up a tiny bit to keep the new object's center correct
            body.Position = position - Vector2.UnitY * (width / 4);
            centerOffset = position.Y - body.Position.Y; //remember the offset from the center for drawing

            //Now let's make sure our upperbody is always facing up.
            fixedAngleJoint = JointFactory.Instance.CreateFixedAngleJoint(physics, body);

            //Create a wheel as wide as the whole object
            wheelBody = BodyFactory.Instance.CreateCircleBody(physics, width / 2, mass / 2);
            //And position its center at the bottom of the upper body
            wheelBody.Position = body.Position + Vector2.UnitY * (upperBodyHeight / 2);

            //These two bodies together are width wide and height high <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
            //So let's connect them together.
            motor = JointFactory.Instance.CreateRevoluteJoint(physics, body, wheelBody, wheelBody.Position);
            motor.Motor_Enabled = true;
            motor.Motor_MaxTorque = 1000f; //set this higher for some more juice
            motor.Motor_Speed = 0;

            //Create geomitries.
            wheelGeom = GeomFactory.Instance.CreateCircleGeom(physics, wheelBody, width / 2, 16);
            geom = GeomFactory.Instance.CreateRectangleGeom(physics, body, width, upperBodyHeight);

            wheelGeom.IgnoreCollisionWith(geom);
            geom.IgnoreCollisionWith(wheelGeom);

            //Set the friction of the wheelGeom to float.MaxValue for fast stopping/starting
            //or set it higher to make the character slip.
            wheelGeom.FrictionCoefficient = float.MaxValue;
        }
</pre>
<p>Quite a lot is happening here, but nothing should be really new. We first create a body that is going to be the upper part of our character, we then shift its position a bit and calculate its shift from the center. (This is handy for if we want to draw our final character). A simple fixed angle joint keeps our upper body at all times.</p>
<p>We then create the lower body (wheelBody) which is sized like a wheel just as wide as our upper body. Its center is positioned at the bottom of the upper body (see the picture above again).</p>
<p>The lower body is fixed to the upper body with a revolute joint, and because we downloaded the ‘motor’ patch we can force the lower body to rotate while it stays attached to the upper body. If you think about we’ve  just created a Segway actually.<br />
Geometries are created as usual and the upper and lower bodies are told not to collide with each other.</p>
<p>Finally we set the friction of the lower body to the highest possible value. This way the movement of our character will be very responsive. You can lower the amount of friction for a different feel (be sure to play around a bit, 0.5f gives quite a funny feel).</p>
<p>Congratulations, you’re now familiar with the basics of the Farseer physics engine. Be sure to fire up the simulation and play around a bit. Maybe try to make a more complicated level with the objects you now have.</p>
<h2>Afterthoughts</h2>
<p>You now have a bit of a grasp on the techniques that the Farseer physics engine offers you. This engine could easily be extended to make even more fun physics objects, like moving platforms. However because this is a tutorial, some things in the code have been neglected, so if you would like to extend the tutorial code, please first make sure that you make some kind of base object, of which CompositePhysicsObject and PhysicsObject extend. Then make some sort of drawing manager, this will make your life a lot easier!<br />
This tutorial has shown you a few useful tricks like Polymorphism (a Character is still a PhysicsObject) which saves writing a lot of duplicate code. Make sure that you use these techniques to the max they will make your life a lot easier!<br />
I hope you’ve enjoyed this tutorial, for more of my tutorials see <a href="http://www.roy-t.nl">www.roy-t.nl</a>.</p>
<p><strong>Download sample source</strong>: <a href="http://www.sgtconker.com/wp-content/uploads/contest/2010/roy/FarseerPlatformer.zip">FarseerPlatformer.zip</a> (under the <a href="http://www.microsoft.com/opensource/licenses.mspx#Ms-PL">MS-PL License</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/09/article-xna-farseer-platform-physics-tutorial/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Matali Physics supports Windows Phone 7</title>
		<link>http://www.sgtconker.com/2010/08/matali-physics-supports-windows-phone-7/</link>
		<comments>http://www.sgtconker.com/2010/08/matali-physics-supports-windows-phone-7/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 05:44:37 +0000</pubDate>
		<dc:creator>Captain ZSquare</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[Matali]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1590</guid>
		<description><![CDATA[We received word that the latest build of Matali Physics now supports Windows Phone 7.
From our informant: Matali Physics is an advanced, cross-platform, fully managed 3D physics engine, intended for the .NET platform. The latest build of the engine introduces support for Windows Phone 7. The available demo also shows the full physical 3D UI [...]]]></description>
			<content:encoded><![CDATA[<p>We received word that the latest build of Matali Physics now supports Windows Phone 7.<br />
From our informant: <em>Matali Physics is an advanced, cross-platform, fully managed 3D physics engine, intended for the .NET platform. The latest build of the engine introduces support for Windows Phone 7. The available demo also shows the full physical 3D UI on Windows Phone 7.</em></p>
<p>You can try for yourself on the<a href="http://www.mataliphysics.com/"> Matali Physics page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/08/matali-physics-supports-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jitter Physics</title>
		<link>http://www.sgtconker.com/2010/04/jitter-physics/</link>
		<comments>http://www.sgtconker.com/2010/04/jitter-physics/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 14:54:32 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[Jitter Physics]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1409</guid>
		<description><![CDATA[Via Corporal X comes the word (well, sort of: I heard of this thing before, just were too lazy to actually post it here – looking at the news stream tells me that I am not alone on the slacker front, though) about a new, shiny and managed only physics engine named Jitter Physics. Says [...]]]></description>
			<content:encoded><![CDATA[<p>Via Corporal X comes the word (well, sort of: <a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=567661">I heard of this thing before</a>, just were too lazy to actually post it here – looking at the news stream tells me that I am not alone on the slacker front, though) about a new, shiny and managed only physics engine named <a href="http://www.jitter-physics.com/">Jitter Physics</a>. Says their PR:</p>
<blockquote cite="http://www.jitter-physics.com/"><p>Jitter is a fast and lightweight managed engine written entirely in C#. It includes it's own math framework and does not rely on third party software. The engine was written by the author of JigLibX. Jitter has some additional features including an interface following the .NET coding guidelines.</p>
</blockquote>
<p>It is currently in beta and <a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=567661&amp;whichpage=1&amp;#3632691">word is that</a> “it is about 100% faster than <a href="http://jiglibx.codeplex.com/Wikipage">JibLibX</a> but also much more stable when stacking objects. It supports more default shapes (example: cone, cylinder) and it's code is just nice <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  What is missing at the moment is vehicle and terrain support”.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/04/jitter-physics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Henge3D Physics Library for XNA</title>
		<link>http://www.sgtconker.com/2010/02/henge3d-physics-library-for-xna/</link>
		<comments>http://www.sgtconker.com/2010/02/henge3d-physics-library-for-xna/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 22:38:18 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2010/02/henge3d-physics-library-for-xna/</guid>
		<description><![CDATA[There’s a new Physics engine targeting the XNA FX (hat tip to to Nick Gravelyn for the discovery):
Project Description       Henge3D is a 3D physics library written in C# for XNA. It is implemented entirely in managed code and is compatible with the XBOX 360.      [...]]]></description>
			<content:encoded><![CDATA[<p>There’s a new <a href="http://henge3d.codeplex.com/">Physics engine targeting the XNA FX</a> (hat tip to to <a href="http://nickgravelyn.com/">Nick Gravelyn</a> for the <a href="http://twitter.com/nickgravelyn/status/9296312732">discovery</a>):</p>
<blockquote cite="http://henge3d.codeplex.com/"><p><b>Project Description</b>       <br />Henge3D is a 3D physics library written in C# for XNA. It is implemented entirely in managed code and is compatible with the XBOX 360.       <br />Overview: </p>
<ul>
<li>Rigid body simulation with collision detection, response, and approximated friction. </li>
<li>Supports collision skins consisting of arbitrary convex polyhedra, spheres, capsules and planes. Collision detection against triangle meshes is also supported. </li>
<li>Supports a number of constraints, including body point constraints, revolute joints, universal joints, prismatic joints, etc. </li>
<li>Multi-threaded collision detection and collision response. </li>
<li>Ability to import collision skins from Blender and potentially other modeling programs. </li>
<li>Supports ragdolls using collections of rigid bodies with constraints (see the Holodeck program for examples). </li>
</ul>
</blockquote>
<p align="center"><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/aFEGfdzv7zk&amp;hl=en_US&amp;fs=1&amp;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/aFEGfdzv7zk&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p align="center"><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/TqwxOYb5UGk&amp;hl=en_US&amp;fs=1&amp;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/TqwxOYb5UGk&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p align="center"><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/UQXN6hJGZbk&amp;hl=en_US&amp;fs=1&amp;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/UQXN6hJGZbk&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/02/henge3d-physics-library-for-xna/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Article : Verlet Integration Particles</title>
		<link>http://www.sgtconker.com/2009/10/article-verlet-integration-particles/</link>
		<comments>http://www.sgtconker.com/2009/10/article-verlet-integration-particles/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 23:03:23 +0000</pubDate>
		<dc:creator>Sgt. Conker</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Particles]]></category>

		<guid isPermaLink="false">http://sgt.conkerjo.com/?p=229</guid>
		<description><![CDATA[by Gorion

This article will show you what VIP's (Verlet Integration Particles) are and how to make them. If you look it up on wikipedia you can see that the math behind the concept is quite complex. While it's not in the scope of this article to explain the math, I will give you a good [...]]]></description>
			<content:encoded><![CDATA[<h4 style="text-align: center;">by Gorion</h4>
<p><img class="size-medium wp-image-269 alignright" src="http://www.sgtconker.com/wp-content/uploads/2009/10/shot4-300x174.png" alt="Tearable cloth" width="240" height="139" /><br />
This article will show you what VIP's (Verlet Integration Particles) are and how to make them. If you look it up on <a href="http://en.wikipedia.org/wiki/Verlet_integration">wikipedia</a> you can see that the math behind the concept is quite complex. While it's not in the scope of this article to explain the math, I will give you a good <a href="http://www.fisica.uniud.it/~ercolessi/md/md/node21.html">website</a> which, in my opinion, explains it really well.<br />
<span id="more-229"></span><br />
Some basic explanation first. The classical implementation of movement is:<br />
Position = OldPosition + Speed or Position += Speed * Direction<br />
Speed += Acceleration</p>
<p>The same thing but verlet integrated:<br />
Position += Position - (OldPosition + Force)</p>
<p>This means you can influence the speed with the position and the old position instead of changing the actual speed and acceleration. The advantages are that if you change 1 particle it can effect another particle just by colliding with it, no need to set the speed and acceleration after the collision. This may sound a bit vague but you will see the result soon <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . In this article I'll show you bits and pieces of code, you will have to glue it together, which should not be too hard. Also this article will explain everything in 2d, but you must understand that there is no difference between 2d and 3d. XNA makes the math really transparent so this is just as easily usable in 3d as in 2d.</p>
<p><a href="http://www.sgtconker.com/wp-content/uploads/2009/10/shot5.png"><img class="aligncenter size-medium wp-image-283" src="http://www.sgtconker.com/wp-content/uploads/2009/10/shot5-300x174.png" alt="Ropes and Bridges" width="300" height="174" /></a></p>
<p>Code for Particle.cs</p>
<pre class="brush: csharp; title: ;">
/*
* By Niels Uiterwijk. Particle which can be used in a verlet particle system
*/

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace VerletDemo.Verlet
{
    class Particle
    {
        private Vector2 position;
        private Vector2 oldPosition;
        private Vector2 force;
        #region Properties
        public Vector2 Position
        {
            get { return position; }
            set { position = value; }
        }
        public Vector2 OldPosition
        {
            get { return oldPosition; }
            set { oldPosition = value; }
        }

        public Vector2 Force
        {
            get { return force; }
            set { force = value; }
        }

        public float Y
        {
            get { return position.Y; }
            set { position.Y = value; }
        }

        public float X
        {
            get { return position.X; }
            set { position.X = value; }
        }
        #endregion

        public Particle(Vector2 pos, Vector2 oldPos, Vector2 force)
        {
            this.position = pos;
            this.oldPosition = oldPos;
            this.force = force;
        }

        public Particle(Vector2 pos, Vector2 force)
        {
            this.position = pos;
            this.oldPosition = pos;
            this.force = force;
        }
    }
}
</pre>
<p>This is the particle class, it holds the information you need later on (Position, OldPosition and Force). <span style="background-color: #ffffff">As you can see, I've choosen to not have the particle update itself. It doesn't really matter but I prefer the particle to be more of an object that cannot move itself. This is more realistic as an object in the real world doesn't move itself but an outside force does.</span></p>
<p>Now on to using the this particle, t<span style="background-color: #ffffff">he following pieces of code will give you a headstart. </span></p>
<p><span style="background-color: #ffffff;font-family: Consolas, Monaco, 'Courier New', Courier, monospace;line-height: 18px;font-size: 12px"> </span></p>
<pre class="brush: csharp; title: ;">
..
List&lt;Particle&gt; particles = new List&lt;Particle&gt;();
Vector2 gravity = new Vector2(0, -9.8f);
Vector2 damping = new Vector2(0.05f);
float friction = 0.1f;
float maxY;
float maxX;
float minY = 5.0f;
float minX = 5.0f;
..

public Game1()
{
    ...
    maxY = graphics.PreferredBackBufferHeight - 5;
    maxX = graphics.PreferredBackBufferWidth - 5;
    ...
}

protected override void Update(GameTime gameTime)
{
    if (mouse.RightClick)
    {
        //Create a new particle at the position of the mouse pointer.
        Particle tmpParticle = new Particle(mousePosition, gravity);
        particles.Add(tmpParticle);
    }

    float secs = (float)gameTime.ElapsedGameTime.TotalSeconds;
    int numParticles = particles.Count();

    Vector2 tmpPos;
    for (int i = numParticles-1; i &gt;= 0; i--)
    {
        Particle p = particles[i];

        if (input.IsMouseButtonDown(MouseButtons.LeftButton))
        {
            //Drag particle code
        }

        //Here comes the formula!
        tmpPos = p.Position;
        p.Position += p.Position - (p.OldPosition + (p.Force * damping));
        p.OldPosition = tmpPos;

        //Do some bounds checking..
        handleBounds(p);
    }

    //Constraints code
    base.Update(gameTime);
}

private void handleBounds(Particle p)
{
    //Making sure that the particle does not go out of bounds
    float overY = 0;
    if (p.Y &gt; maxY)
    overY = maxY - p.Y;
    if (p.X &gt; maxX)
    p.X = maxX;
    if (p.X &lt; minX)
    p.X = minX;
    if (p.Y &lt; minY)
    p.Y = minY;

    if (overY != 0)
    {
        //If the particle collided with the bottom we move it up and slow it down
        p.Y += overY;
        float diff = p.X - p.OldPosition.X;
        if (diff != 0)
            p.X -= (diff * friction);
    }
}

private void addParticleStick(Vector2 pos)
{
    //addParticleStick code
}

private void addParticleAnchor(Vector2 pos)
{
    //addParticleAnchor code
}

private float distance(Vector2 v1, Vector2 v2)
{
    Vector2 tmp = v1 - v2;
    return tmp.Length();
}

protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.WhiteSmoke);
    //Draw you particles..
}
</pre>
<p>I've showed the important section's. As you can see every tick the particles get updated. If you've implemented it correctly, and if you are using the same variables as me, you should see a particle, after creating it, falling to the ground and then stop near the bottom.</p>
<h2>Constraints</h2>
<p>So now that we have our particles we can add constraints to them. These constraints limit the movement of particles. The simplest constraint which excist, is an anchor constraint. This constraint keeps the particle in place, but first I'll give you the base constraint class.</p>
<p>Code for constraint:</p>
<pre class="brush: csharp; title: ;">
/*
 * By Niels Uiterwijk. An abstract class used as a base class for constraints.
 */
using Microsoft.Xna.Framework.Graphics;
namespace VerletDemo.Verlet
{
    abstract class Constraint
    {
        public abstract bool Satisfy();
        public abstract void Draw(SpriteBatch sp);
        public abstract bool Uses(Particle p);
    }
}
</pre>
<p>The function Satisify() will be called each tick to satisfy the constraints, if it returns false the system needs to remove the constraint because it did not get satisfied and if not removed might cause the whole system become unstable, this is because all particles influence each other.</p>
<pre class="brush: csharp; title: ;">
class AnchorConstraint : Constraint
{
    private Particle p = null;
    private Vector2 position = Vector2.Zero;
    public AnchorConstraint(Particle p, Vector2 pos)
    {
        this.p = p;
        this.position = pos;
    }

    public override bool Satisfy()
    {
        p.Position = position;
        p.OldPosition = position;
        return true;
    }

    public override void Draw(SpriteBatch sp)
    {

    }

    public override bool Uses(Particle p)
    {
        return (this.p == p);
    }
}
</pre>
<p>This AnchorConstraint sets the position and the old position of the particle to the position of the anchor. For this simple constraint we can simply return true.</p>
<p>Here's some updated code for Game1:</p>
<pre class="brush: csharp; title: ;">
..
List&lt;Constraint&gt; constraints = new List&lt;Constraint&gt;();
..

protected override void Update(GameTime gameTime)
{
    ..
    int numConstraints = constraints.Count();
    for (int i = numConstraints-1; i &gt;= 0; i--)
    //We run backwards so we can remove stuff.
    {
        Constraint c = constraints[i];
        if (c.Satisfy())
            continue;
        constraints.Remove(c);
    }
}

private void addParticleAnchor(Vector2 pos)
{
    Particle p = new Particle(pos, gravity);
    particles.Add(p);
    AnchorConstraint ac = new AnchorConstraint(p, pos);
    constraints.Add(ac);
}
</pre>
<p>If you place a particle with the AnchorConstraint you will notice that it will not move, as expected <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p><a href="http://www.sgtconker.com/wp-content/uploads/2009/10/shot1.png"><img class="aligncenter size-medium wp-image-267" src="http://www.sgtconker.com/wp-content/uploads/2009/10/shot1-300x174.png" alt="Anchors" width="300" height="174" /></a></p>
<p>With this simple sample I will explain how we can recreate a <a href="http://www.worldofgoo.com/">world of goo</a> like experience. <span style="background-color: #ffffff">For the constraint we are going to use, we need to keep 2 particles at a certain distance from each other.</span></p>
<p>We will have to define the 2 particle's we need to keep at bay, the length between the 2 particles and we also will define the stiffness of the constraint.</p>
<p>To do the actual "keeping at bay" we will need the difference between the 2 particles. Then we adjust the position of the particles together with the differences multiplied with the stiffness we gave the constraint.</p>
<p>Resulting code:</p>
<pre class="brush: csharp; title: ;">
Vector2 delta = p2.Position - p1.Position;
float deltaLength = delta.Length();
float difference = ((deltaLength - length) / deltaLength);
p1.Position += delta * (0.5f * stiffness * difference);
p2.Position -= delta * (0.5f * stiffness * difference);
</pre>
<p>As this constraint needs 2 particles to work, we need code that will find the 2nd particle, or even both particles to work with.</p>
<p>To do this we need to iterate over all particles and save the 2 particles which are the closest to the position of the newly generated particle. If we did not find 2 particles we are just going to create a new one and don't add a constraint. If we have found at least 1 particle we will add the constraint between the closest particle and the new particle.</p>
<p>If we did find 2 particles and the distance between them is small enough we can add the constraint between these 2 particles. So we do not create a new particle but just add the constraint between these particles.  If the distance between them is to big we create a new particle and add a constraint between particle 1, particle new and particle 2, particle new.</p>
<p>Some example code:</p>
<pre class="brush: csharp; title: ;">

Particle p1 = null;
Particle p2 = null;

//Assign 2 closest particles to p1 and p2.
..

if (p1 == null || p2 == null)
{
    tmpParticle = new Particle(pos, gravity);
    particles.Add(tmpParticle);
    if (p1 != null &amp;&amp; p2 == null)
    {
        if (distance(p1.Position, pos) &lt; maxDistance)
        {
            StickConstraint sc = new StickConstraint(p1, tmpParticle, minLengthStickConstraint, 1.0f);
            tmpConstraints.Add(sc);
        }
    }
    return;
}

float distanceP1 = distance(p1.Position, pos);
float distanceP2 = distance(p2.Position, pos);

//Need to make sure that the distance is not ridiculous, else the system might go instable.
if (distanceP1 &gt; maxDistance &amp;&amp; distanceP2 &gt; maxDistance)
{
    //We add the particle, but no constraint!
    tmpParticle = new Particle(pos, gravity);
    particle.Add(tmpParticle);
    return;
}

//Finally we founded our closest 2 particles
float length = minLengthStickConstraint;
float stiffness = minStiffnessStickConstraint;
float maxLength = length * 1.2f;
float distanceP1P2 = distanceP1 + distanceP2;

if ((p1 != null) &amp;&amp; (p2 != null) &amp;&amp; distanceP1P2 &lt; maxLength)
{
    //We can add a stick constraint between the 2 allready excisting particles
    StickConstraint sc = new StickConstraint(p1, p2, length, stiffness);
    tmpConstraints.Add(sc);
    return;
}

//We have to create a new particle
tmpParticle = new Particle(pos, gravity);
particles.Add(tmpParticle);
if (p1 != null &amp;&amp; distanceP1 &lt; maxDistance)
{
    StickConstraint sc = new StickConstraint(p1, tmpParticle, length, stiffness);
    tmpConstraints.Add(sc);
}

if (p2 != null &amp;&amp; distanceP2 &lt; maxDistance)
{
    StickConstraint sc = new StickConstraint(p2, tmpParticle, length, stiffness);
    tmpConstraints.Add(sc);
}
</pre>
<p><a href="http://www.sgtconker.com/wp-content/uploads/2009/10/shot2.png"><img class="aligncenter size-medium wp-image-268" src="http://www.sgtconker.com/wp-content/uploads/2009/10/shot2-300x174.png" alt="Pyramide" width="300" height="174" /></a></p>
<p>Now we have come to the end of this article, I hope you learned something from reading this. This is only a small introduction into the world of verlet integration, some topics we have not touched is cloth simulation, fluid simulation etc. All those awesome looking things are based on this kind of simulation. <a href="/Downloads/articles/VerletDemoSample.zip">Download</a> the sample project and have a look. The sample project uses some helper classes (for input and drawing), I won't explain those as these are not part of this article. You can always email me at nielsuiterwijk @ gmail.com</p>
<p style="text-align: center"><a href="http://www.sgtconker.com/wp-content/uploads/2009/10/shot4.png"><img class="size-medium wp-image-269 aligncenter" src="http://www.sgtconker.com/wp-content/uploads/2009/10/shot4-300x174.png" alt="Tearable cloth" width="300" height="174" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2009/10/article-verlet-integration-particles/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

