<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>physicshelperxaml Wiki Rss Feed</title><link>http://physicshelperxaml.codeplex.com/</link><description>physicshelperxaml Wiki Rss Description</description><item><title>New Comment on "Documentation"</title><link>https://physicshelperxaml.codeplex.com/documentation?&amp;ANCHOR#C27220</link><description>I want use this with my monogame aplication.&amp;#10;I would be grateful  If you could publish a monogame-compatible version.</description><author>dingxiaohu2009</author><pubDate>Wed, 17 Apr 2013 14:14:09 GMT</pubDate><guid isPermaLink="false">New Comment on "Documentation" 20130417021409P</guid></item><item><title>New Comment on "Documentation"</title><link>http://physicshelperxaml.codeplex.com/documentation?&amp;ANCHOR#C25512</link><description>Windows 8, VS 2012. Can&amp;#39;t compile Demo.Simple or Demo.Advanced due to error 9009.&amp;#10;&amp;#10;Error&amp;#9;2&amp;#9;The command &amp;#34;C&amp;#58;&amp;#92;Users&amp;#92;user123&amp;#92;Documents&amp;#92;Visual Studio 2012&amp;#92;Projects&amp;#92;PhysicsHelper&amp;#92;Demos.Metro&amp;#92;Demo.Simple.Metro&amp;#92;..&amp;#92;..&amp;#92;CleanUsingXmlns&amp;#92;bin&amp;#92;Debug&amp;#92;CleanUsingXmlns addusing C&amp;#58;&amp;#92;Users&amp;#92;user123&amp;#92;Documents&amp;#92;Visual Studio 2012&amp;#92;Projects&amp;#92;PhysicsHelper&amp;#92;Demos.Metro&amp;#92;Demo.Simple.Metro&amp;#92;..&amp;#92;..&amp;#92;Demos.Metro&amp;#92;Demo.Simple.Metro&amp;#92; Demo.Simple,Spritehand&amp;#10;&amp;#34; exited with code 9009.&amp;#9;Demo.Simple</description><author>SQLDBATX</author><pubDate>Wed, 07 Nov 2012 15:07:46 GMT</pubDate><guid isPermaLink="false">New Comment on "Documentation" 20121107030746P</guid></item><item><title>Updated Wiki: Home</title><link>http://physicshelperxaml.codeplex.com/wikipage?version=19</link><description>&lt;div class="wikidoc"&gt;&lt;b&gt;Project Description&lt;/b&gt;&lt;br /&gt;Physics Helper XAML allows you to easily create 2D physics based games and simulations for Windows 8, Windows Phone 7 and Silverlight 5 using C# or VB. It is a port of the &lt;a href="http://physicshelper.codeplex.com"&gt;Physics Helper&lt;/a&gt; and uses the &lt;a href="http://farseerphysics.codeplex.com"&gt;Farseer Physics Engine&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Why a Separate Version?&lt;/b&gt;&lt;br /&gt;When I began porting the Physics Helper project to Windows 8, I realized that there were many breaking changes in WinRT and missing functionality such as Behaviors. It was much simpler to create a new version for Metro/WinRT and then port that new version to Windows Phone and other platforms. I think that the end result is much simpler and cleaner, as an added bonus!&lt;br /&gt;&lt;br /&gt;For more details and how to get started, see the &lt;b&gt;&lt;a href="http://physicshelperxaml.codeplex.com/documentation"&gt;Documentation page&lt;/a&gt;&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml3.png" /&gt; &lt;br /&gt;&lt;br /&gt;&lt;div class="video" style="text-align:Left"&gt;&lt;span class="player"&gt;&lt;object type="application/x-shockwave-flash" height="420px" width="600px" classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"&gt;&lt;param name="movie" value="http://www.youtube.com/v/YNa_Mnj6qwI"&gt;&lt;/param&gt;&lt;embed type="application/x-shockwave-flash" height="420px" width="600px" src="http://www.youtube.com/v/YNa_Mnj6qwI" pluginspage="http://macromedia.com/go/getflashplayer" autoplay="false" autostart="false" /&gt;&lt;/object&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="external"&gt;&lt;a href="http://www.youtube.com/v/YNa_Mnj6qwI" target="_blank"&gt;Launch in another window&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AndyBeaulieu</author><pubDate>Mon, 27 Aug 2012 19:53:37 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20120827075337P</guid></item><item><title>New Comment on "Documentation"</title><link>http://physicshelperxaml.codeplex.com/documentation?&amp;ANCHOR#C23128</link><description>This is great&amp;#33; I wonder, how can you add a camera controller to this&amp;#63;</description><author>coton61</author><pubDate>Fri, 30 Mar 2012 18:23:22 GMT</pubDate><guid isPermaLink="false">New Comment on "Documentation" 20120330062322P</guid></item><item><title>Updated Wiki: Home</title><link>http://physicshelperxaml.codeplex.com/wikipage?version=18</link><description>&lt;div class="wikidoc"&gt;&lt;b&gt;Project Description&lt;/b&gt;&lt;br /&gt;Physics Helper XAML allows you to easily create 2D physics based games and simulations for Windows 8 Metro and Windows Phone 7 using C# or VB. It is a port of the &lt;a href="http://physicshelper.codeplex.com" class="externalLink"&gt;Physics Helper&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and uses the &lt;a href="http://farseerphysics.codeplex.com" class="externalLink"&gt;Farseer Physics Engine&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Why a Separate Version?&lt;/b&gt;&lt;br /&gt;When I began porting the Physics Helper project to WinRT/Metro, I realized that there were many breaking changes in WinRT and missing functionality such as Behaviors. It was much simpler to create a new version for Metro/WinRT and then port that new version to Windows Phone and other platforms. I think that the end result is much simpler and cleaner, as an added bonus!&lt;br /&gt;&lt;br /&gt;For more details and how to get started, see the &lt;b&gt;&lt;a href="http://physicshelperxaml.codeplex.com/documentation" class="externalLink"&gt;Documentation page&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml3.png" /&gt; &lt;br /&gt;&lt;br /&gt;&lt;div class="video" style="text-align:Left"&gt;&lt;span class="player"&gt;&lt;object type="application/x-shockwave-flash" height="420px" width="600px" classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Z5WuW-1--EQ"&gt;&lt;/param&gt;&lt;embed type="application/x-shockwave-flash" height="420px" width="600px" src="http://www.youtube.com/v/Z5WuW-1--EQ" pluginspage="http://macromedia.com/go/getflashplayer" autoplay="false" autostart="false" /&gt;&lt;/object&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="external"&gt;&lt;a href="http://www.youtube.com/v/Z5WuW-1--EQ" target="_blank"&gt;Launch in another window&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AndyBeaulieu</author><pubDate>Wed, 07 Mar 2012 14:01:33 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20120307020133P</guid></item><item><title>Updated Wiki: Home</title><link>http://physicshelperxaml.codeplex.com/wikipage?version=17</link><description>&lt;div class="wikidoc"&gt;&lt;b&gt;Project Description&lt;/b&gt;&lt;br /&gt;Physics Helper XAML allows you to easily create 2D physics based games and simulations for Windows 8 Metro and Windows Phone 7 using C# or VB. It is a port of the &lt;a href="http://physicshelper.codeplex.com" class="externalLink"&gt;Physics Helper&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and uses the &lt;a href="http://farseerphysics.codeplex.com" class="externalLink"&gt;Farseer Physics Engine&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Why a Separate Version?&lt;/b&gt;&lt;br /&gt;When I began porting the Physics Helper project to WinRT/Metro, I realized that there were many breaking changes in XAML and missing functionality such as Behaviors. It was much simpler to create a new version for Metro/WinRT and then port that new version to Windows Phone and other platforms. I think that the end result is much simpler and cleaner, as an added bonus!&lt;br /&gt;&lt;br /&gt;For more details and how to get started, see the &lt;b&gt;&lt;a href="http://physicshelperxaml.codeplex.com/documentation" class="externalLink"&gt;Documentation page&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml3.png" /&gt; &lt;br /&gt;&lt;br /&gt;&lt;div class="video" style="text-align:Left"&gt;&lt;span class="player"&gt;&lt;object type="application/x-shockwave-flash" height="420px" width="600px" classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Z5WuW-1--EQ"&gt;&lt;/param&gt;&lt;embed type="application/x-shockwave-flash" height="420px" width="600px" src="http://www.youtube.com/v/Z5WuW-1--EQ" pluginspage="http://macromedia.com/go/getflashplayer" autoplay="false" autostart="false" /&gt;&lt;/object&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="external"&gt;&lt;a href="http://www.youtube.com/v/Z5WuW-1--EQ" target="_blank"&gt;Launch in another window&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AndyBeaulieu</author><pubDate>Wed, 07 Mar 2012 14:01:06 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20120307020106P</guid></item><item><title>New Comment on "Documentation"</title><link>http://physicshelperxaml.codeplex.com/documentation?&amp;ANCHOR#C21871</link><description>Can be used with visual studio 2010&amp;#63;&amp;#10;I want use this with my touch wpf aplication.&amp;#10;Hoppe can be possible.&amp;#10;If possible please can publish a guide&amp;#63;&amp;#10;Best regards.</description><author>GrobotoX</author><pubDate>Sat, 10 Dec 2011 13:14:19 GMT</pubDate><guid isPermaLink="false">New Comment on "Documentation" 20111210011419P</guid></item><item><title>New Comment on "Documentation"</title><link>http://physicshelperxaml.codeplex.com/documentation?&amp;ANCHOR#C21870</link><description>Can be used with visual studio 2010&amp;#63;&amp;#10;I want use this with my toch wpf aplication.&amp;#10;Hoppe can be possible.&amp;#10;If possible please can publish  a guide&amp;#63;&amp;#10;Best regards.</description><author>GrobotoX</author><pubDate>Sat, 10 Dec 2011 13:14:03 GMT</pubDate><guid isPermaLink="false">New Comment on "Documentation" 20111210011403P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://physicshelperxaml.codeplex.com/documentation?version=20</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Windows 8 Metro Getting Started&lt;/h1&gt;The current release was created using the Windows 8 Developer Preview Bits and Visual Studio 11 Express. Currently the easiest way to get these tools is to &lt;a href="http://msdn.microsoft.com/en-us/windows/apps/br229516" class="externalLink"&gt;download the ISO&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://www.pitorque.de/MisterGoodcat/post/Installing-Windows-8-Developer-Preview-as-bootable-VHD.aspx" class="externalLink"&gt;create a bootable VHD&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;While you do not need tablet hardware for development (you can use a PC and a mouse), you may wish to obtain a tablet because multitouch is more fun than a mouse :) Here are a couple of posts to help you with get started with tablet hardware:
&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/219/Default.aspx" class="externalLink"&gt;Installing Windows 8 on a (Windows 7) slate&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/220/Default.aspx" class="externalLink"&gt;Windows 8 remote debugging and setup&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Sample Projects&lt;/h1&gt;Once you have a development environment and hardware setup, you can &lt;a href="http://physicshelperxaml.codeplex.com/releases" class="externalLink"&gt;download the source code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and check out the sample projects inside the VS11 solution.
&lt;h2&gt;Demo.Simple&lt;/h2&gt;Set Demo.Simple as your startup project and run the solution. This shows a no-code scenario with a ragdoll and stack of blocks. Here are the main parts of the simple demo:
&lt;ul&gt;&lt;li&gt;ucBlock.xaml defines the Block sprite.&lt;/li&gt;
&lt;li&gt;ucRagDoll.xaml defines a rag doll with appendages and joints bringing them together.&lt;/li&gt;
&lt;li&gt;MainPage.xaml creates instances of ucBlock and ucRagDoll. There is one line of code in MainPage.xaml.cs which calls ScaleToObject. This allows the game canvas to scale to full screen.&lt;/li&gt;&lt;/ul&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml1.jpg" /&gt;
&lt;h2&gt;Demo.Advanced&lt;/h2&gt;Set Demo.Advanced as your startup project and run the solution. This shows how to dynamically add and delete user controls, track performance, and use nested Storyboard animations inside physics objects. Here are the main highlights of the advanced demo:
&lt;ul&gt;&lt;li&gt;the code-beind file MainPage.xaml.cs shows how to handle the TimerLoop and Collision events raised by the PhysicsCanvas.&lt;/li&gt;
&lt;li&gt;The AddAnItem method shows how to dynamically add a complex UserControl containing multiple sprites and joints.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Using Expression Blend&lt;/h1&gt;Please note that at the time of this writing, Blend 5 for Metro App Development has not been released - there is only a preliminary version supporting HTML development. When Blend 5 is released with XAML support, this section will be updated with a design-time walkthrough inside Blend.&lt;br /&gt;
&lt;h1&gt;Using Visual Studio&lt;/h1&gt;Let&amp;#39;s walk through creating a simple physics simulation using XAML inside Visual Studio.
&lt;h2&gt;Creating the Solution&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Create a new &amp;quot;Windows Metro Style&amp;quot; project in VS11 &lt;/li&gt;&lt;/ul&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml2.png" /&gt;
&lt;ul&gt;&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Farseer Physics Engine Metro\Farseer Physics Engine Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Spritehand.PhysicsHelper.Metro\Spritehand.PhysicsHelper.Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;From your main project, add References to the Farseer Physics Engine Metro and Spritehand.PhysicsHelper.Metro projects.&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Adding a Simple Physics Object&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Lets create a simple rectangle object for the &amp;quot;ground&amp;quot; of our simulation. Open MainPage.xaml and add the following namespace imports to the XAML at the top, replacing My.Project.Here with your project name:&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
    xmlns:ph=&amp;quot;using:Spritehand.FarseerHelper&amp;quot;
    xmlns:local=&amp;quot;using:*My.Project.Here*&amp;quot;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now let&amp;#39;s add in a canvas named cnvGameOuter to handle the outside of our simulation. By doing this, we can overlay text like score and lives on top of our game.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Within cnvGameOuter, we add in our PhysicsCanvas which you can think of as the Window into our Game or Simulation. We can set MousePickEnabled=&amp;quot;true&amp;quot; so that the user can move things around with gestures or the mouse.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now we can add our sprites (physics objects) into the Physics Canvas using the PhysicsSprite object. We&amp;#39;ll add in a large block for the ground and a small block to fall. To keep the &amp;quot;ground&amp;quot; sprite in place, we can set the &lt;b&gt;IsStatic&lt;/b&gt; property to True.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;block&amp;quot; Canvas.Left=&amp;quot;200&amp;quot; Canvas.Top=&amp;quot;0&amp;quot;  Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; &amp;gt;
            &amp;lt;Rectangle Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightBlue&amp;quot; /&amp;gt;
        &amp;lt;/ph:PhysicsSprite&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ground&amp;quot; Background=&amp;quot;DarkGreen&amp;quot;  Canvas.Left=&amp;quot;0&amp;quot; Canvas.Top=&amp;quot;648&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;120&amp;quot; IsStatic=&amp;quot;True&amp;quot; /&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;block&amp;quot; sprite around with your finger (or mouse).&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Shape Types&lt;/h2&gt;For the two simple PhysicsSprite objects we added above named &amp;quot;ground&amp;quot; and &amp;quot;block&amp;quot; we ended up with Rectangular shapes - because this is the default ShapeType for a PhysicsSprite. But what if we needed a circular or polygon shape? We can control this with ShapeType.
&lt;ul&gt;&lt;li&gt;Add the following PhysicsSprite definition inside the PhysicsCanvas. This defines a &amp;quot;ball&amp;quot; which has a ShapeType of Ellipse, and adds some &amp;quot;bounce&amp;quot; to the ball using RestitutionCoefficient.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ball&amp;quot; Canvas.Left=&amp;quot;350&amp;quot; Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; ShapeType=&amp;quot;Ellipse&amp;quot; RestitutionCoefficient=&amp;quot;0.8&amp;quot;&amp;gt;
    &amp;lt;Ellipse Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightYellow&amp;quot;/&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;ball&amp;quot; sprite with the mouse. Note that it is round.&lt;/li&gt;
&lt;li&gt;What if we need a more exact (polygon) shape? We can accomplish complex shapes by defining a Path element as the &lt;b&gt;first element&lt;/b&gt; in our PhysicsSprite, and setting the ShapeType to Polygon. Note that you could set the Visibility of this boundary sprite to Collapsed if you have a complex design inside the PhysicsSprite that you are defining the basic boundary for.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;ph:PhysicsSprite Height=&amp;quot;78.667&amp;quot; x:Name=&amp;quot;cnvBody&amp;quot; Width=&amp;quot;197&amp;quot; Canvas.Left=&amp;quot;10&amp;quot; Canvas.Top=&amp;quot;0&amp;quot; ShapeType=&amp;quot;Polygon&amp;quot;&amp;gt;
    &amp;lt;Path x:Name=&amp;quot;bodyBoundary&amp;quot;  Fill=&amp;quot;Red&amp;quot; Data=&amp;quot;M2,72 L196,76 L190,43 L136,28 L123,2 L84,2 L83,28 L2,32 z&amp;quot; Height=&amp;quot;75&amp;quot; 
             Canvas.Left=&amp;quot;1.5&amp;quot; Stretch=&amp;quot;Fill&amp;quot; Stroke=&amp;quot;#FF000000&amp;quot; Canvas.Top=&amp;quot;1.5&amp;quot; UseLayoutRounding=&amp;quot;False&amp;quot; Width=&amp;quot;195&amp;quot;&amp;gt;
    &amp;lt;/Path&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;To &lt;b&gt;debug&lt;/b&gt; shape types that the simulation is using visually, we can set DebugMode=&amp;quot;true&amp;quot; on the PhysicsCanvas. This draws a handy outline on top of each physics element and is handy when you are seeing collision problems.&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Accessing Farseer Objects&lt;/h2&gt;Under every PhysicsSprite is a Farseer Body and Fixture elements (to learn more about Farseer and see docs please visit &lt;a href="http://farseerphysics.codeplex.com" class="externalLink"&gt;farseerphysics.codeplex.com&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;). 
&lt;ul&gt;&lt;li&gt;All PhysicsSprites defined inside the PhysicsCanvas are accessible through the PhysicsCanvas.PhysicsObjects dictionary. We can get to the Farseer BodyObject to change things such as Mass, Restitution, and even the shape (Fixtures) of the object.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
PhysicsSprite spr = cnvGame.PhysicsObjects[&amp;quot;ball&amp;quot;];
spr.BodyObject.Restitution = 0;
&lt;/pre&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AndyBeaulieu</author><pubDate>Sun, 06 Nov 2011 21:04:31 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20111106090431P</guid></item><item><title>Updated Wiki: Home</title><link>http://physicshelperxaml.codeplex.com/wikipage?version=16</link><description>&lt;div class="wikidoc"&gt;&lt;b&gt;Project Description&lt;/b&gt;&lt;br /&gt;Physics Helper XAML allows you to easily create 2D physics based games and simulations for Windows 8 Metro and Windows Phone 7 using C# or VB. It is a port of the &lt;a href="http://physicshelper.codeplex.com" class="externalLink"&gt;Physics Helper&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and uses the &lt;a href="http://farseerphysics.codeplex.com" class="externalLink"&gt;Farseer Physics Engine&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;For more details and how to get started, see the &lt;b&gt;&lt;a href="http://physicshelperxaml.codeplex.com/documentation" class="externalLink"&gt;Documentation page&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml3.png" /&gt; &lt;br /&gt;&lt;br /&gt;&lt;div class="video" style="text-align:Left"&gt;&lt;span class="player"&gt;&lt;object type="application/x-shockwave-flash" height="420px" width="600px" classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Z5WuW-1--EQ"&gt;&lt;/param&gt;&lt;embed type="application/x-shockwave-flash" height="420px" width="600px" src="http://www.youtube.com/v/Z5WuW-1--EQ" pluginspage="http://macromedia.com/go/getflashplayer" autoplay="false" autostart="false" /&gt;&lt;/object&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="external"&gt;&lt;a href="http://www.youtube.com/v/Z5WuW-1--EQ" target="_blank"&gt;Launch in another window&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AndyBeaulieu</author><pubDate>Sun, 06 Nov 2011 21:03:46 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20111106090346P</guid></item><item><title>Updated Wiki: Home</title><link>http://physicshelperxaml.codeplex.com/wikipage?version=15</link><description>&lt;div class="wikidoc"&gt;&lt;b&gt;Project Description&lt;/b&gt;&lt;br /&gt;Physics Helper XAML allows you to easily create 2D physics based games and simulations for Windows 8 Metro Apps using C# or VB. It is a port of the &lt;a href="http://physicshelper.codeplex.com" class="externalLink"&gt;Physics Helper&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and uses the &lt;a href="http://farseerphysics.codeplex.com" class="externalLink"&gt;Farseer Physics Engine&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;For more details and how to get started, see the &lt;b&gt;&lt;a href="http://physicshelperxaml.codeplex.com/documentation" class="externalLink"&gt;Documentation page&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml3.png" /&gt; &lt;br /&gt;&lt;br /&gt;&lt;div class="video" style="text-align:Left"&gt;&lt;span class="player"&gt;&lt;object type="application/x-shockwave-flash" height="420px" width="600px" classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Z5WuW-1--EQ"&gt;&lt;/param&gt;&lt;embed type="application/x-shockwave-flash" height="420px" width="600px" src="http://www.youtube.com/v/Z5WuW-1--EQ" pluginspage="http://macromedia.com/go/getflashplayer" autoplay="false" autostart="false" /&gt;&lt;/object&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="external"&gt;&lt;a href="http://www.youtube.com/v/Z5WuW-1--EQ" target="_blank"&gt;Launch in another window&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AndyBeaulieu</author><pubDate>Sun, 06 Nov 2011 21:03:12 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20111106090312P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://physicshelperxaml.codeplex.com/documentation?version=19</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Environment Setup&lt;/h1&gt;The current release was created using the Windows 8 Developer Preview Bits and Visual Studio 11 Express. Currently the easiest way to get these tools is to &lt;a href="http://msdn.microsoft.com/en-us/windows/apps/br229516" class="externalLink"&gt;download the ISO&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://www.pitorque.de/MisterGoodcat/post/Installing-Windows-8-Developer-Preview-as-bootable-VHD.aspx" class="externalLink"&gt;create a bootable VHD&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;While you do not need tablet hardware for development (you can use a PC and a mouse), you may wish to obtain a tablet because multitouch is more fun than a mouse :) Here are a couple of posts to help you with get started with tablet hardware:
&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/219/Default.aspx" class="externalLink"&gt;Installing Windows 8 on a (Windows 7) slate&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/220/Default.aspx" class="externalLink"&gt;Windows 8 remote debugging and setup&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Sample Projects&lt;/h1&gt;Once you have a development environment and hardware setup, you can &lt;a href="http://physicshelperxaml.codeplex.com/releases" class="externalLink"&gt;download the source code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and check out the sample projects inside the VS11 solution.
&lt;h2&gt;Demo.Simple&lt;/h2&gt;Set Demo.Simple as your startup project and run the solution. This shows a no-code scenario with a ragdoll and stack of blocks. Here are the main parts of the simple demo:
&lt;ul&gt;&lt;li&gt;ucBlock.xaml defines the Block sprite.&lt;/li&gt;
&lt;li&gt;ucRagDoll.xaml defines a rag doll with appendages and joints bringing them together.&lt;/li&gt;
&lt;li&gt;MainPage.xaml creates instances of ucBlock and ucRagDoll. There is one line of code in MainPage.xaml.cs which calls ScaleToObject. This allows the game canvas to scale to full screen.&lt;/li&gt;&lt;/ul&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml1.jpg" /&gt;
&lt;h2&gt;Demo.Advanced&lt;/h2&gt;Set Demo.Advanced as your startup project and run the solution. This shows how to dynamically add and delete user controls, track performance, and use nested Storyboard animations inside physics objects. Here are the main highlights of the advanced demo:
&lt;ul&gt;&lt;li&gt;the code-beind file MainPage.xaml.cs shows how to handle the TimerLoop and Collision events raised by the PhysicsCanvas.&lt;/li&gt;
&lt;li&gt;The AddAnItem method shows how to dynamically add a complex UserControl containing multiple sprites and joints.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Using Expression Blend&lt;/h1&gt;Please note that at the time of this writing, Blend 5 for Metro App Development has not been released - there is only a preliminary version supporting HTML development. When Blend 5 is released with XAML support, this section will be updated with a design-time walkthrough inside Blend.&lt;br /&gt;
&lt;h1&gt;Using Visual Studio&lt;/h1&gt;Let&amp;#39;s walk through creating a simple physics simulation using XAML inside Visual Studio.
&lt;h2&gt;Creating the Solution&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Create a new &amp;quot;Windows Metro Style&amp;quot; project in VS11 &lt;/li&gt;&lt;/ul&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml2.png" /&gt;
&lt;ul&gt;&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Farseer Physics Engine Metro\Farseer Physics Engine Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Spritehand.PhysicsHelper.Metro\Spritehand.PhysicsHelper.Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;From your main project, add References to the Farseer Physics Engine Metro and Spritehand.PhysicsHelper.Metro projects.&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Adding a Simple Physics Object&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Lets create a simple rectangle object for the &amp;quot;ground&amp;quot; of our simulation. Open MainPage.xaml and add the following namespace imports to the XAML at the top, replacing My.Project.Here with your project name:&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
    xmlns:ph=&amp;quot;using:Spritehand.FarseerHelper&amp;quot;
    xmlns:local=&amp;quot;using:*My.Project.Here*&amp;quot;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now let&amp;#39;s add in a canvas named cnvGameOuter to handle the outside of our simulation. By doing this, we can overlay text like score and lives on top of our game.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Within cnvGameOuter, we add in our PhysicsCanvas which you can think of as the Window into our Game or Simulation. We can set MousePickEnabled=&amp;quot;true&amp;quot; so that the user can move things around with gestures or the mouse.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now we can add our sprites (physics objects) into the Physics Canvas using the PhysicsSprite object. We&amp;#39;ll add in a large block for the ground and a small block to fall. To keep the &amp;quot;ground&amp;quot; sprite in place, we can set the &lt;b&gt;IsStatic&lt;/b&gt; property to True.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;block&amp;quot; Canvas.Left=&amp;quot;200&amp;quot; Canvas.Top=&amp;quot;0&amp;quot;  Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; &amp;gt;
            &amp;lt;Rectangle Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightBlue&amp;quot; /&amp;gt;
        &amp;lt;/ph:PhysicsSprite&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ground&amp;quot; Background=&amp;quot;DarkGreen&amp;quot;  Canvas.Left=&amp;quot;0&amp;quot; Canvas.Top=&amp;quot;648&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;120&amp;quot; IsStatic=&amp;quot;True&amp;quot; /&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;block&amp;quot; sprite around with your finger (or mouse).&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Shape Types&lt;/h2&gt;For the two simple PhysicsSprite objects we added above named &amp;quot;ground&amp;quot; and &amp;quot;block&amp;quot; we ended up with Rectangular shapes - because this is the default ShapeType for a PhysicsSprite. But what if we needed a circular or polygon shape? We can control this with ShapeType.
&lt;ul&gt;&lt;li&gt;Add the following PhysicsSprite definition inside the PhysicsCanvas. This defines a &amp;quot;ball&amp;quot; which has a ShapeType of Ellipse, and adds some &amp;quot;bounce&amp;quot; to the ball using RestitutionCoefficient.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ball&amp;quot; Canvas.Left=&amp;quot;350&amp;quot; Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; ShapeType=&amp;quot;Ellipse&amp;quot; RestitutionCoefficient=&amp;quot;0.8&amp;quot;&amp;gt;
    &amp;lt;Ellipse Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightYellow&amp;quot;/&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;ball&amp;quot; sprite with the mouse. Note that it is round.&lt;/li&gt;
&lt;li&gt;What if we need a more exact (polygon) shape? We can accomplish complex shapes by defining a Path element as the &lt;b&gt;first element&lt;/b&gt; in our PhysicsSprite, and setting the ShapeType to Polygon. Note that you could set the Visibility of this boundary sprite to Collapsed if you have a complex design inside the PhysicsSprite that you are defining the basic boundary for.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;ph:PhysicsSprite Height=&amp;quot;78.667&amp;quot; x:Name=&amp;quot;cnvBody&amp;quot; Width=&amp;quot;197&amp;quot; Canvas.Left=&amp;quot;10&amp;quot; Canvas.Top=&amp;quot;0&amp;quot; ShapeType=&amp;quot;Polygon&amp;quot;&amp;gt;
    &amp;lt;Path x:Name=&amp;quot;bodyBoundary&amp;quot;  Fill=&amp;quot;Red&amp;quot; Data=&amp;quot;M2,72 L196,76 L190,43 L136,28 L123,2 L84,2 L83,28 L2,32 z&amp;quot; Height=&amp;quot;75&amp;quot; 
             Canvas.Left=&amp;quot;1.5&amp;quot; Stretch=&amp;quot;Fill&amp;quot; Stroke=&amp;quot;#FF000000&amp;quot; Canvas.Top=&amp;quot;1.5&amp;quot; UseLayoutRounding=&amp;quot;False&amp;quot; Width=&amp;quot;195&amp;quot;&amp;gt;
    &amp;lt;/Path&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;To &lt;b&gt;debug&lt;/b&gt; shape types that the simulation is using visually, we can set DebugMode=&amp;quot;true&amp;quot; on the PhysicsCanvas. This draws a handy outline on top of each physics element and is handy when you are seeing collision problems.&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Accessing Farseer Objects&lt;/h2&gt;Under every PhysicsSprite is a Farseer Body and Fixture elements (to learn more about Farseer and see docs please visit &lt;a href="http://farseerphysics.codeplex.com" class="externalLink"&gt;farseerphysics.codeplex.com&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;). 
&lt;ul&gt;&lt;li&gt;All PhysicsSprites defined inside the PhysicsCanvas are accessible through the PhysicsCanvas.PhysicsObjects dictionary. We can get to the Farseer BodyObject to change things such as Mass, Restitution, and even the shape (Fixtures) of the object.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
PhysicsSprite spr = cnvGame.PhysicsObjects[&amp;quot;ball&amp;quot;];
spr.BodyObject.Restitution = 0;
&lt;/pre&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AndyBeaulieu</author><pubDate>Mon, 26 Sep 2011 11:45:10 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20110926114510A</guid></item><item><title>Updated Wiki: Documentation</title><link>http://physicshelperxaml.codeplex.com/documentation?version=18</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Environment Setup&lt;/h1&gt;The current release was created using the Windows 8 Developer Preview Bits and Visual Studio 11 Express. Currently the easiest way to get these tools is to &lt;a href="http://msdn.microsoft.com/en-us/windows/apps/br229516" class="externalLink"&gt;download the ISO&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://www.pitorque.de/MisterGoodcat/post/Installing-Windows-8-Developer-Preview-as-bootable-VHD.aspx" class="externalLink"&gt;create a bootable VHD&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;While you do not need tablet hardware for development (you can use a PC and a mouse), you may wish to obtain a tablet because multitouch is more fun than a mouse :) Here are a couple of posts to help you with get started with tablet hardware:
&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/219/Default.aspx" class="externalLink"&gt;Installing Windows 8 on a (Windows 7) slate&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/220/Default.aspx" class="externalLink"&gt;Windows 8 remote debugging and setup&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Sample Projects&lt;/h1&gt;Once you have a development environment and hardware setup, you can &lt;a href="http://physicshelperxaml.codeplex.com/releases" class="externalLink"&gt;download the source code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and check out the sample projects inside the VS11 solution.
&lt;h2&gt;Demo.Simple&lt;/h2&gt;Set Demo.Simple as your startup project and run the solution. This shows a no-code scenario with a ragdoll and stack of blocks. Here are the main parts of the simple demo:
&lt;ul&gt;&lt;li&gt;ucBlock.xaml defines the Block sprite.&lt;/li&gt;
&lt;li&gt;ucRagDoll.xaml defines a rag doll with appendages and joints bringing them together.&lt;/li&gt;
&lt;li&gt;MainPage.xaml creates instances of ucBlock and ucRagDoll. There is one line of code in MainPage.xaml.cs which calls ScaleToObject. This allows the game canvas to scale to full screen.&lt;/li&gt;&lt;/ul&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml1.jpg" /&gt;
&lt;h2&gt;Demo.Advanced&lt;/h2&gt;Set Demo.Advanced as your startup project and run the solution. This shows how to dynamically add and delete user controls, track performance, and use nested Storyboard animations inside physics objects. Here are the main highlights of the advanced demo:
&lt;ul&gt;&lt;li&gt;the code-beind file MainPage.xaml.cs shows how to handle the TimerLoop and Collision events raised by the PhysicsCanvas.&lt;/li&gt;
&lt;li&gt;The AddAnItem method shows how to dynamically add a complex UserControl containing multiple sprites and joints.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Using Expression Blend&lt;/h1&gt;Please note that at the time of this writing, Blend 5 for Metro App Development has not been released - there is only a preliminary version supporting HTML development. When Blend 5 is released with XAML support, this section will be updated with a design-time walkthrough inside Blend.&lt;br /&gt;
&lt;h1&gt;Using Visual Studio&lt;/h1&gt;Let&amp;#39;s walk through creating a simple physics simulation using XAML inside Visual Studio.
&lt;h2&gt;Creating the Solution&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;Create a new &amp;quot;Windows Metro Style&amp;quot; project in VS11 &lt;/li&gt;&lt;/ol&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml2.png" /&gt;
&lt;ul&gt;&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Farseer Physics Engine Metro\Farseer Physics Engine Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Spritehand.PhysicsHelper.Metro\Spritehand.PhysicsHelper.Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;From your main project, add References to the Farseer Physics Engine Metro and Spritehand.PhysicsHelper.Metro projects.&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Adding a Simple Physics Object&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Lets create a simple rectangle object for the &amp;quot;ground&amp;quot; of our simulation. Open MainPage.xaml and add the following namespace imports to the XAML at the top, replacing My.Project.Here with your project name:&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
    xmlns:ph=&amp;quot;using:Spritehand.FarseerHelper&amp;quot;
    xmlns:local=&amp;quot;using:*My.Project.Here*&amp;quot;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now let&amp;#39;s add in a canvas named cnvGameOuter to handle the outside of our simulation. By doing this, we can overlay text like score and lives on top of our game.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Within cnvGameOuter, we add in our PhysicsCanvas which you can think of as the Window into our Game or Simulation. We can set MousePickEnabled=&amp;quot;true&amp;quot; so that the user can move things around with gestures or the mouse.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now we can add our sprites (physics objects) into the Physics Canvas using the PhysicsSprite object. We&amp;#39;ll add in a large block for the ground and a small block to fall. To keep the &amp;quot;ground&amp;quot; sprite in place, we can set the &lt;b&gt;IsStatic&lt;/b&gt; property to True.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;block&amp;quot; Canvas.Left=&amp;quot;200&amp;quot; Canvas.Top=&amp;quot;0&amp;quot;  Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; &amp;gt;
            &amp;lt;Rectangle Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightBlue&amp;quot; /&amp;gt;
        &amp;lt;/ph:PhysicsSprite&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ground&amp;quot; Background=&amp;quot;DarkGreen&amp;quot;  Canvas.Left=&amp;quot;0&amp;quot; Canvas.Top=&amp;quot;648&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;120&amp;quot; IsStatic=&amp;quot;True&amp;quot; /&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;block&amp;quot; sprite around with your finger (or mouse).&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Shape Types&lt;/h2&gt;For the two simple PhysicsSprite objects we added above named &amp;quot;ground&amp;quot; and &amp;quot;block&amp;quot; we ended up with Rectangular shapes - because this is the default ShapeType for a PhysicsSprite. But what if we needed a circular or polygon shape? We can control this with ShapeType.
&lt;ul&gt;&lt;li&gt;Add the following PhysicsSprite definition inside the PhysicsCanvas. This defines a &amp;quot;ball&amp;quot; which has a ShapeType of Ellipse, and adds some &amp;quot;bounce&amp;quot; to the ball using RestitutionCoefficient.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ball&amp;quot; Canvas.Left=&amp;quot;350&amp;quot; Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; ShapeType=&amp;quot;Ellipse&amp;quot; RestitutionCoefficient=&amp;quot;0.8&amp;quot;&amp;gt;
    &amp;lt;Ellipse Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightYellow&amp;quot;/&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;ball&amp;quot; sprite with the mouse. Note that it is round.&lt;/li&gt;
&lt;li&gt;What if we need a more exact (polygon) shape? We can accomplish complex shapes by defining a Path element as the &lt;b&gt;first element&lt;/b&gt; in our PhysicsSprite, and setting the ShapeType to Polygon. Note that you could set the Visibility of this boundary sprite to Collapsed if you have a complex design inside the PhysicsSprite that you are defining the basic boundary for.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;ph:PhysicsSprite Height=&amp;quot;78.667&amp;quot; x:Name=&amp;quot;cnvBody&amp;quot; Width=&amp;quot;197&amp;quot; Canvas.Left=&amp;quot;10&amp;quot; Canvas.Top=&amp;quot;0&amp;quot; ShapeType=&amp;quot;Polygon&amp;quot;&amp;gt;
    &amp;lt;Path x:Name=&amp;quot;bodyBoundary&amp;quot;  Fill=&amp;quot;Red&amp;quot; Data=&amp;quot;M2,72 L196,76 L190,43 L136,28 L123,2 L84,2 L83,28 L2,32 z&amp;quot; Height=&amp;quot;75&amp;quot; 
             Canvas.Left=&amp;quot;1.5&amp;quot; Stretch=&amp;quot;Fill&amp;quot; Stroke=&amp;quot;#FF000000&amp;quot; Canvas.Top=&amp;quot;1.5&amp;quot; UseLayoutRounding=&amp;quot;False&amp;quot; Width=&amp;quot;195&amp;quot;&amp;gt;
    &amp;lt;/Path&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;To &lt;b&gt;debug&lt;/b&gt; shape types that the simulation is using visually, we can set DebugMode=&amp;quot;true&amp;quot; on the PhysicsCanvas. This draws a handy outline on top of each physics element and is handy when you are seeing collision problems.&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Accessing Farseer Objects&lt;/h2&gt;Under every PhysicsSprite is a Farseer Body and Fixture elements (to learn more about Farseer and see docs please visit &lt;a href="http://farseerphysics.codeplex.com" class="externalLink"&gt;farseerphysics.codeplex.com&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;). 
&lt;ul&gt;&lt;li&gt;All PhysicsSprites defined inside the PhysicsCanvas are accessible through the PhysicsCanvas.PhysicsObjects dictionary. We can get to the Farseer BodyObject to change things such as Mass, Restitution, and even the shape (Fixtures) of the object.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
PhysicsSprite spr = cnvGame.PhysicsObjects[&amp;quot;ball&amp;quot;];
spr.BodyObject.Restitution = 0;
&lt;/pre&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AndyBeaulieu</author><pubDate>Mon, 26 Sep 2011 11:43:56 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20110926114356A</guid></item><item><title>Updated Wiki: Documentation</title><link>http://physicshelperxaml.codeplex.com/documentation?version=17</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Environment Setup&lt;/h1&gt;The current release was created using the Windows 8 Developer Preview Bits and Visual Studio 11 Express. Currently the easiest way to get these tools is to &lt;a href="http://msdn.microsoft.com/en-us/windows/apps/br229516" class="externalLink"&gt;download the ISO&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://www.pitorque.de/MisterGoodcat/post/Installing-Windows-8-Developer-Preview-as-bootable-VHD.aspx" class="externalLink"&gt;create a bootable VHD&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;While you do not need tablet hardware for development (you can use a PC and a mouse), you may wish to obtain a tablet because multitouch is more fun than a mouse :) Here are a couple of posts to help you with get started with tablet hardware:
&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/219/Default.aspx" class="externalLink"&gt;Installing Windows 8 on a (Windows 7) slate&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/220/Default.aspx" class="externalLink"&gt;Windows 8 remote debugging and setup&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Sample Projects&lt;/h1&gt;Once you have a development environment and hardware setup, you can &lt;a href="http://physicshelperxaml.codeplex.com/releases" class="externalLink"&gt;download the source code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and check out the sample projects inside the VS11 solution.
&lt;h2&gt;Demo.Simple&lt;/h2&gt;Set Demo.Simple as your startup project and run the solution. This shows a no-code scenario with a ragdoll and stack of blocks. Here are the main parts of the simple demo:
&lt;ul&gt;&lt;li&gt;ucBlock.xaml defines the Block sprite.&lt;/li&gt;
&lt;li&gt;ucRagDoll.xaml defines a rag doll with appendages and joints bringing them together.&lt;/li&gt;
&lt;li&gt;MainPage.xaml creates instances of ucBlock and ucRagDoll. There is one line of code in MainPage.xaml.cs which calls ScaleToObject. This allows the game canvas to scale to full screen.&lt;/li&gt;&lt;/ul&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml1.jpg" /&gt;
&lt;h2&gt;Demo.Advanced&lt;/h2&gt;Set Demo.Advanced as your startup project and run the solution. This shows how to dynamically add and delete user controls, track performance, and use nested Storyboard animations inside physics objects. Here are the main highlights of the advanced demo:
&lt;ul&gt;&lt;li&gt;the code-beind file MainPage.xaml.cs shows how to handle the TimerLoop and Collision events raised by the PhysicsCanvas.&lt;/li&gt;
&lt;li&gt;The AddAnItem method shows how to dynamically add a complex UserControl containing multiple sprites and joints.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Using Expression Blend&lt;/h1&gt;Please note that at the time of this writing, Blend 5 for Metro App Development has not been released - there is only a preliminary version supporting HTML development. When Blend 5 is released with XAML support, this section will be updated with a design-time walkthrough inside Blend.&lt;br /&gt;
&lt;h1&gt;Using Visual Studio&lt;/h1&gt;Let&amp;#39;s walk through creating a simple physics simulation using XAML inside Visual Studio.
&lt;h2&gt;Creating the Solution&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;Create a new &amp;quot;Windows Metro Style&amp;quot; project in VS11 &lt;/li&gt;&lt;/ol&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml2.png" /&gt;
&lt;ul&gt;&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Farseer Physics Engine Metro\Farseer Physics Engine Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Spritehand.PhysicsHelper.Metro\Spritehand.PhysicsHelper.Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;From your main project, add References to the Farseer Physics Engine Metro and Spritehand.PhysicsHelper.Metro projects.&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Adding a Simple Physics Object&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Lets create a simple rectangle object for the &amp;quot;ground&amp;quot; of our simulation. Open MainPage.xaml and add the following namespace imports to the XAML at the top, replacing My.Project.Here with your project name:&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
    xmlns:ph=&amp;quot;using:Spritehand.FarseerHelper&amp;quot;
    xmlns:local=&amp;quot;using:*My.Project.Here*&amp;quot;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now let&amp;#39;s add in a canvas named cnvGameOuter to handle the outside of our simulation. By doing this, we can overlay text like score and lives on top of our game.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Within cnvGameOuter, we add in our PhysicsCanvas which you can think of as the Window into our Game or Simulation. We can set MousePickEnabled=&amp;quot;true&amp;quot; so that the user can move things around with gestures or the mouse.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now we can add our sprites (physics objects) into the Physics Canvas using the PhysicsSprite object. We&amp;#39;ll add in a large block for the ground and a small block to fall. To keep the &amp;quot;ground&amp;quot; sprite in place, we can set the &lt;b&gt;IsStatic&lt;/b&gt; property to True.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;block&amp;quot; Canvas.Left=&amp;quot;200&amp;quot; Canvas.Top=&amp;quot;0&amp;quot;  Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; &amp;gt;
            &amp;lt;Rectangle Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightBlue&amp;quot; /&amp;gt;
        &amp;lt;/ph:PhysicsSprite&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ground&amp;quot; Background=&amp;quot;DarkGreen&amp;quot;  Canvas.Left=&amp;quot;0&amp;quot; Canvas.Top=&amp;quot;648&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;120&amp;quot; IsStatic=&amp;quot;True&amp;quot; /&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;block&amp;quot; sprite around with your finger (or mouse).&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Shape Types&lt;/h2&gt;For the two simple PhysicsSprite objects we added above named &amp;quot;ground&amp;quot; and &amp;quot;block&amp;quot; we ended up with Rectangular shapes - because this is the default ShapeType for a PhysicsSprite. But what if we needed a circular or polygon shape? We can control this with ShapeType.
&lt;ul&gt;&lt;li&gt;Add the following PhysicsSprite definition inside the PhysicsCanvas. This defines a &amp;quot;ball&amp;quot; which has a ShapeType of Ellipse, and adds some &amp;quot;bounce&amp;quot; to the ball using RestitutionCoefficient.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ball&amp;quot; Canvas.Left=&amp;quot;350&amp;quot; Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; ShapeType=&amp;quot;Ellipse&amp;quot; RestitutionCoefficient=&amp;quot;0.8&amp;quot;&amp;gt;
    &amp;lt;Ellipse Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightYellow&amp;quot;/&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;ball&amp;quot; sprite with the mouse. Note that it is round.&lt;/li&gt;
&lt;li&gt;What if we need a more exact (polygon) shape? We can accomplish complex shapes by defining a Path element as the &lt;b&gt;first element&lt;/b&gt; in our PhysicsSprite, and setting the ShapeType to Polygon. Note that you could set the Visibility of this boundary sprite to Collapsed if you have a complex design inside the PhysicsSprite that you are defining the basic boundary for.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
ph:PhysicsSprite Height=&amp;quot;78.667&amp;quot; x:Name=&amp;quot;cnvBody&amp;quot; Width=&amp;quot;197&amp;quot; Canvas.Left=&amp;quot;10&amp;quot; Canvas.Top=&amp;quot;0&amp;quot; ShapeType=&amp;quot;Polygon&amp;quot;&amp;gt;
    &amp;lt;Path x:Name=&amp;quot;bodyBoundary&amp;quot;  Fill=&amp;quot;Red&amp;quot; Data=&amp;quot;M2,72 L196,76 L190,43 L136,28 L123,2 L84,2 L83,28 L2,32 z&amp;quot; Height=&amp;quot;75&amp;quot; Canvas.Left=&amp;quot;1.5&amp;quot; Stretch=&amp;quot;Fill&amp;quot; Stroke=&amp;quot;#FF000000&amp;quot; Canvas.Top=&amp;quot;1.5&amp;quot; UseLayoutRounding=&amp;quot;False&amp;quot; Width=&amp;quot;195&amp;quot;&amp;gt;
    &amp;lt;/Path&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;To &lt;b&gt;debug&lt;/b&gt; shape types that the simulation is using visually, we can set DebugMode=&amp;quot;true&amp;quot; on the PhysicsCanvas. This draws a handy outline on top of each physics element and is handy when you are seeing collision problems.&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Accessing Farseer Objects&lt;/h2&gt;Under every PhysicsSprite is a Farseer Body and Fixture elements (to learn more about Farseer and see docs please visit &lt;a href="http://farseerphysics.codeplex.com" class="externalLink"&gt;farseerphysics.codeplex.com&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;). 
&lt;ul&gt;&lt;li&gt;All PhysicsSprites defined inside the PhysicsCanvas are accessible through the PhysicsCanvas.PhysicsObjects dictionary. We can get to the Farseer BodyObject to change things such as Mass, Restitution, and even the shape (Fixtures) of the object.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
PhysicsSprite spr = cnvGame.PhysicsObjects[&amp;quot;ball&amp;quot;];
spr.BodyObject.Restitution = 0;
&lt;/pre&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AndyBeaulieu</author><pubDate>Sat, 24 Sep 2011 15:36:31 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20110924033631P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://physicshelperxaml.codeplex.com/documentation?version=16</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Environment Setup&lt;/h1&gt;The current release was created using the Windows 8 Developer Preview Bits and Visual Studio 11 Express. Currently the easiest way to get these tools is to &lt;a href="http://msdn.microsoft.com/en-us/windows/apps/br229516" class="externalLink"&gt;download the ISO&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://www.pitorque.de/MisterGoodcat/post/Installing-Windows-8-Developer-Preview-as-bootable-VHD.aspx" class="externalLink"&gt;create a bootable VHD&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;While you do not need tablet hardware for development (you can use a PC and a mouse), you may wish to obtain a tablet because multitouch is more fun than a mouse :) Here are a couple of posts to help you with get started with tablet hardware:
&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/219/Default.aspx" class="externalLink"&gt;Installing Windows 8 on a (Windows 7) slate&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/220/Default.aspx" class="externalLink"&gt;Windows 8 remote debugging and setup&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Sample Projects&lt;/h1&gt;Once you have a development environment and hardware setup, you can &lt;a href="http://physicshelperxaml.codeplex.com/releases" class="externalLink"&gt;download the source code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and check out the sample projects inside the VS11 solution.
&lt;h2&gt;Demo.Simple&lt;/h2&gt;Set Demo.Simple as your startup project and run the solution. This shows a no-code scenario with a ragdoll and stack of blocks. Here are the main parts of the simple demo:
&lt;ul&gt;&lt;li&gt;ucBlock.xaml defines the Block sprite.&lt;/li&gt;
&lt;li&gt;ucRagDoll.xaml defines a rag doll with appendages and joints bringing them together.&lt;/li&gt;
&lt;li&gt;MainPage.xaml creates instances of ucBlock and ucRagDoll. There is one line of code in MainPage.xaml.cs which calls ScaleToObject. This allows the game canvas to scale to full screen.&lt;/li&gt;&lt;/ul&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml1.jpg" /&gt;
&lt;h2&gt;Demo.Advanced&lt;/h2&gt;Set Demo.Advanced as your startup project and run the solution. This shows how to dynamically add and delete user controls, track performance, and use nested Storyboard animations inside physics objects. Here are the main highlights of the advanced demo:
&lt;ul&gt;&lt;li&gt;the code-beind file MainPage.xaml.cs shows how to handle the TimerLoop and Collision events raised by the PhysicsCanvas.&lt;/li&gt;
&lt;li&gt;The AddAnItem method shows how to dynamically add a complex UserControl containing multiple sprites and joints.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Using Expression Blend&lt;/h1&gt;Please note that at the time of this writing, Blend 5 for Metro App Development has not been released - there is only a preliminary version supporting HTML development. When Blend 5 is released with XAML support, this section will be updated with a design-time walkthrough inside Blend.&lt;br /&gt;
&lt;h1&gt;Using Visual Studio&lt;/h1&gt;Let&amp;#39;s walkthrough creating a simple physics simulation using XAML inside Visual Studio.
&lt;h2&gt;Creating the Solution&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;Create a new &amp;quot;Windows Metro Style&amp;quot; project in VS11 &lt;/li&gt;&lt;/ol&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml2.png" /&gt;
&lt;ul&gt;&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Farseer Physics Engine Metro\Farseer Physics Engine Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Spritehand.PhysicsHelper.Metro\Spritehand.PhysicsHelper.Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;From your main project, add References to the Farseer Physics Engine Metro and Spritehand.PhysicsHelper.Metro projects.&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Adding a Simple Physics Object&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Lets create a simple rectangle object for the &amp;quot;ground&amp;quot; of our simulation. Open MainPage.xaml and add the following namespace imports to the XAML at the top, replacing My.Project.Here with your project name:&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
    xmlns:ph=&amp;quot;using:Spritehand.FarseerHelper&amp;quot;
    xmlns:local=&amp;quot;using:*My.Project.Here*&amp;quot;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now let&amp;#39;s add in a canvas named cnvGameOuter to handle the outside of our simulation. By doing this, we can overlay text like score and lives on top of our game.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Within cnvGameOuter, we add in our PhysicsCanvas which you can think of as the Window into our Game or Simulation. We can set MousePickEnabled=&amp;quot;true&amp;quot; so that the user can move things around with gestures or the mouse.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now we can add our sprites (physics objects) into the Physics Canvas using the PhysicsSprite object. We&amp;#39;ll add in a large block for the ground and a small block to fall. To keep the &amp;quot;ground&amp;quot; sprite in place, we can set the &lt;b&gt;IsStatic&lt;/b&gt; property to True.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;block&amp;quot; Canvas.Left=&amp;quot;200&amp;quot; Canvas.Top=&amp;quot;0&amp;quot;  Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; &amp;gt;
            &amp;lt;Rectangle Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightBlue&amp;quot; /&amp;gt;
        &amp;lt;/ph:PhysicsSprite&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ground&amp;quot; Background=&amp;quot;DarkGreen&amp;quot;  Canvas.Left=&amp;quot;0&amp;quot; Canvas.Top=&amp;quot;648&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;120&amp;quot; IsStatic=&amp;quot;True&amp;quot; /&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;block&amp;quot; sprite around with your finger (or mouse).&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Shape Types&lt;/h2&gt;For the two simple PhysicsSprite objects we added above named &amp;quot;ground&amp;quot; and &amp;quot;block&amp;quot; we ended up with Rectangular shapes - because this is the default ShapeType for a PhysicsSprite. But what if we needed a circular or polygon shape? We can control this with ShapeType.
&lt;ul&gt;&lt;li&gt;Add the following PhysicsSprite definition inside the PhysicsCanvas. This defines a &amp;quot;ball&amp;quot; which has a ShapeType of Ellipse, and adds some &amp;quot;bounce&amp;quot; to the ball using RestitutionCoefficient.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ball&amp;quot; Canvas.Left=&amp;quot;350&amp;quot; Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; ShapeType=&amp;quot;Ellipse&amp;quot; RestitutionCoefficient=&amp;quot;0.8&amp;quot;&amp;gt;
    &amp;lt;Ellipse Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightYellow&amp;quot;/&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;ball&amp;quot; sprite with the mouse. Note that it is round.&lt;/li&gt;
&lt;li&gt;What if we need a more exact (polygon) shape? We can accomplish complex shapes by defining a Path element as the &lt;b&gt;first element&lt;/b&gt; in our PhysicsSprite, and setting the ShapeType to Polygon. Note that you could set the Visibility of this boundary sprite to Collapsed if you have a complex design inside the PhysicsSprite that you are defining the basic boundary for.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
ph:PhysicsSprite Height=&amp;quot;78.667&amp;quot; x:Name=&amp;quot;cnvBody&amp;quot; Width=&amp;quot;197&amp;quot; Canvas.Left=&amp;quot;10&amp;quot; Canvas.Top=&amp;quot;0&amp;quot; ShapeType=&amp;quot;Polygon&amp;quot;&amp;gt;
    &amp;lt;Path x:Name=&amp;quot;bodyBoundary&amp;quot;  Fill=&amp;quot;Red&amp;quot; Data=&amp;quot;M2,72 L196,76 L190,43 L136,28 L123,2 L84,2 L83,28 L2,32 z&amp;quot; Height=&amp;quot;75&amp;quot; Canvas.Left=&amp;quot;1.5&amp;quot; Stretch=&amp;quot;Fill&amp;quot; Stroke=&amp;quot;#FF000000&amp;quot; Canvas.Top=&amp;quot;1.5&amp;quot; UseLayoutRounding=&amp;quot;False&amp;quot; Width=&amp;quot;195&amp;quot;&amp;gt;
    &amp;lt;/Path&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;To &lt;b&gt;debug&lt;/b&gt; shape types that the simulation is using visually, we can set DebugMode=&amp;quot;true&amp;quot; on the PhysicsCanvas. This draws a handy outline on top of each physics element and is handy when you are seeing collision problems.&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Accessing Farseer Objects&lt;/h2&gt;Under every PhysicsSprite is a Farseer Body and Fixture elements (to learn more about Farseer and see docs please visit &lt;a href="http://farseerphysics.codeplex.com" class="externalLink"&gt;farseerphysics.codeplex.com&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;). 
&lt;ul&gt;&lt;li&gt;All PhysicsSprites defined inside the PhysicsCanvas are accessible through the PhysicsCanvas.PhysicsObjects dictionary. We can get to the Farseer BodyObject to change things such as Mass, Restitution, and even the shape (Fixtures) of the object.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
PhysicsSprite spr = cnvGame.PhysicsObjects[&amp;quot;ball&amp;quot;];
spr.BodyObject.Restitution = 0;
&lt;/pre&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AndyBeaulieu</author><pubDate>Sat, 24 Sep 2011 15:36:20 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20110924033620P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://physicshelperxaml.codeplex.com/documentation?version=15</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Environment Setup&lt;/h1&gt;The current release was created using the Windows 8 Developer Preview Bits and Visual Studio 11 Express. Currently the easiest way to get these tools is to &lt;a href="http://msdn.microsoft.com/en-us/windows/apps/br229516" class="externalLink"&gt;download the ISO&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://www.pitorque.de/MisterGoodcat/post/Installing-Windows-8-Developer-Preview-as-bootable-VHD.aspx" class="externalLink"&gt;create a bootable VHD&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;While you do not need tablet hardware for development (you can use a PC and a mouse), you may wish to obtain a tablet because multitouch is more fun than a mouse :) Here are a couple of posts to help you with get started with tablet hardware:
&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/219/Default.aspx" class="externalLink"&gt;Installing Windows 8 on a (Windows 7) slate&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.andybeaulieu.com/Home/tabid/67/EntryID/220/Default.aspx" class="externalLink"&gt;Windows 8 remote debugging and setup&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Sample Projects&lt;/h1&gt;Once you have a development environment and hardware setup, you can &lt;a href="http://physicshelperxaml.codeplex.com/releases" class="externalLink"&gt;download the source code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and check out the sample projects inside the VS11 solution.
&lt;h2&gt;Demo.Simple&lt;/h2&gt;Set Demo.Simple as your startup project and run the solution. This shows a no-code scenario with a ragdoll and stack of blocks. Here are the main parts of the simple demo:
&lt;ul&gt;&lt;li&gt;ucBlock.xaml defines the Block sprite.&lt;/li&gt;
&lt;li&gt;ucRagDoll.xaml defines a rag doll with appendages and joints bringing them together.&lt;/li&gt;
&lt;li&gt;MainPage.xaml creates instances of ucBlock and ucRagDoll. There is one line of code in MainPage.xaml.cs which calls ScaleToObject. This allows the game canvas to scale to full screen.&lt;/li&gt;&lt;/ul&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml1.jpg" /&gt;
&lt;h2&gt;Demo.Advanced&lt;/h2&gt;Set Demo.Advanced as your startup project and run the solution. This shows how to dynamically add and delete user controls, track performance, and use nested Storyboard animations inside physics objects. Here are the main highlights of the advanced demo:
&lt;ul&gt;&lt;li&gt;the code-beind file MainPage.xaml.cs shows how to handle the TimerLoop and Collision events raised by the PhysicsCanvas.&lt;/li&gt;
&lt;li&gt;The AddAnItem method shows how to dynamically add a complex UserControl containing multiple sprites and joints.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Using Expression Blend&lt;/h1&gt;Please note that at the time of this writing, Blend 5 for Metro App Development has not been released - there is only a preliminary version supporting HTML development. When Blend 5 is released with XAML support, this section will be updated with a design-time walkthrough inside Blend.&lt;br /&gt;
&lt;h1&gt;Getting Started&lt;/h1&gt;Let&amp;#39;s walkthrough creating a simple physics simulation.
&lt;h2&gt;Creating the Solution&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;Create a new &amp;quot;Windows Metro Style&amp;quot; project in VS11 &lt;/li&gt;&lt;/ol&gt;
&lt;img src="http://www.andybeaulieu.com/downloads/physicshelperxaml2.png" /&gt;
&lt;ul&gt;&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Farseer Physics Engine Metro\Farseer Physics Engine Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Right-click the solution and select &amp;quot;Add Existing Project&amp;quot;. 
&lt;ul&gt;&lt;li&gt;Browse to \PhysicsHelperXaml\Spritehand.PhysicsHelper.Metro\Spritehand.PhysicsHelper.Metro.csproj in the Physics Helper XAML ZIP download.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;From your main project, add References to the Farseer Physics Engine Metro and Spritehand.PhysicsHelper.Metro projects.&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Adding a Simple Physics Object&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Lets create a simple rectangle object for the &amp;quot;ground&amp;quot; of our simulation. Open MainPage.xaml and add the following namespace imports to the XAML at the top, replacing My.Project.Here with your project name:&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
    xmlns:ph=&amp;quot;using:Spritehand.FarseerHelper&amp;quot;
    xmlns:local=&amp;quot;using:*My.Project.Here*&amp;quot;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now let&amp;#39;s add in a canvas named cnvGameOuter to handle the outside of our simulation. By doing this, we can overlay text like score and lives on top of our game.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Within cnvGameOuter, we add in our PhysicsCanvas which you can think of as the Window into our Game or Simulation. We can set MousePickEnabled=&amp;quot;true&amp;quot; so that the user can move things around with gestures or the mouse.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Now we can add our sprites (physics objects) into the Physics Canvas using the PhysicsSprite object. We&amp;#39;ll add in a large block for the ground and a small block to fall. To keep the &amp;quot;ground&amp;quot; sprite in place, we can set the &lt;b&gt;IsStatic&lt;/b&gt; property to True.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;Canvas x:Name=&amp;quot;cnvGameOuter&amp;quot;  &amp;gt;

    &amp;lt;ph:PhysicsCanvas x:Name=&amp;quot;cnvGame&amp;quot; Background=&amp;quot;CornflowerBlue&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;768&amp;quot; MousePickEnabled=&amp;quot;true&amp;quot;&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;block&amp;quot; Canvas.Left=&amp;quot;200&amp;quot; Canvas.Top=&amp;quot;0&amp;quot;  Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; &amp;gt;
            &amp;lt;Rectangle Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightBlue&amp;quot; /&amp;gt;
        &amp;lt;/ph:PhysicsSprite&amp;gt;

        &amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ground&amp;quot; Background=&amp;quot;DarkGreen&amp;quot;  Canvas.Left=&amp;quot;0&amp;quot; Canvas.Top=&amp;quot;648&amp;quot;  Width=&amp;quot;1366&amp;quot; Height=&amp;quot;120&amp;quot; IsStatic=&amp;quot;True&amp;quot; /&amp;gt;

    &amp;lt;/ph:PhysicsCanvas&amp;gt;

&amp;lt;/Canvas&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;block&amp;quot; sprite around with your finger (or mouse).&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Shape Types&lt;/h2&gt;For the two simple PhysicsSprite objects we added above named &amp;quot;ground&amp;quot; and &amp;quot;block&amp;quot; we ended up with Rectangular shapes - because this is the default ShapeType for a PhysicsSprite. But what if we needed a circular or polygon shape? We can control this with ShapeType.
&lt;ul&gt;&lt;li&gt;Add the following PhysicsSprite definition inside the PhysicsCanvas. This defines a &amp;quot;ball&amp;quot; which has a ShapeType of Ellipse, and adds some &amp;quot;bounce&amp;quot; to the ball using RestitutionCoefficient.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
&amp;lt;ph:PhysicsSprite x:Name=&amp;quot;ball&amp;quot; Canvas.Left=&amp;quot;350&amp;quot; Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; ShapeType=&amp;quot;Ellipse&amp;quot; RestitutionCoefficient=&amp;quot;0.8&amp;quot;&amp;gt;
    &amp;lt;Ellipse Width=&amp;quot;100&amp;quot; Height=&amp;quot;100&amp;quot; Fill=&amp;quot;LightYellow&amp;quot;/&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Run the project and try moving the &amp;quot;ball&amp;quot; sprite with the mouse. Note that it is round.&lt;/li&gt;
&lt;li&gt;What if we need a more exact (polygon) shape? We can accomplish complex shapes by defining a Path element as the &lt;b&gt;first element&lt;/b&gt; in our PhysicsSprite, and setting the ShapeType to Polygon. Note that you could set the Visibility of this boundary sprite to Collapsed if you have a complex design inside the PhysicsSprite that you are defining the basic boundary for.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
ph:PhysicsSprite Height=&amp;quot;78.667&amp;quot; x:Name=&amp;quot;cnvBody&amp;quot; Width=&amp;quot;197&amp;quot; Canvas.Left=&amp;quot;10&amp;quot; Canvas.Top=&amp;quot;0&amp;quot; ShapeType=&amp;quot;Polygon&amp;quot;&amp;gt;
    &amp;lt;Path x:Name=&amp;quot;bodyBoundary&amp;quot;  Fill=&amp;quot;Red&amp;quot; Data=&amp;quot;M2,72 L196,76 L190,43 L136,28 L123,2 L84,2 L83,28 L2,32 z&amp;quot; Height=&amp;quot;75&amp;quot; Canvas.Left=&amp;quot;1.5&amp;quot; Stretch=&amp;quot;Fill&amp;quot; Stroke=&amp;quot;#FF000000&amp;quot; Canvas.Top=&amp;quot;1.5&amp;quot; UseLayoutRounding=&amp;quot;False&amp;quot; Width=&amp;quot;195&amp;quot;&amp;gt;
    &amp;lt;/Path&amp;gt;
&amp;lt;/ph:PhysicsSprite&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;To &lt;b&gt;debug&lt;/b&gt; shape types that the simulation is using visually, we can set DebugMode=&amp;quot;true&amp;quot; on the PhysicsCanvas. This draws a handy outline on top of each physics element and is handy when you are seeing collision problems.&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Accessing Farseer Objects&lt;/h2&gt;Under every PhysicsSprite is a Farseer Body and Fixture elements (to learn more about Farseer and see docs please visit &lt;a href="http://farseerphysics.codeplex.com" class="externalLink"&gt;farseerphysics.codeplex.com&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;). 
&lt;ul&gt;&lt;li&gt;All PhysicsSprites defined inside the PhysicsCanvas are accessible through the PhysicsCanvas.PhysicsObjects dictionary. We can get to the Farseer BodyObject to change things such as Mass, Restitution, and even the shape (Fixtures) of the object.&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
PhysicsSprite spr = cnvGame.PhysicsObjects[&amp;quot;ball&amp;quot;];
spr.BodyObject.Restitution = 0;
&lt;/pre&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AndyBeaulieu</author><pubDate>Sat, 24 Sep 2011 15:35:52 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20110924033552P</guid></item></channel></rss>