{"id":713,"date":"2013-11-28T22:34:40","date_gmt":"2013-11-28T21:34:40","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?p=713"},"modified":"2013-11-28T22:34:40","modified_gmt":"2013-11-28T21:34:40","slug":"vb-net-and-xna-article-17-farseer-mouse-joint-body-from-texture","status":"publish","type":"post","link":"https:\/\/labalec.fr\/erwan\/?p=713","title":{"rendered":"VB.Net and XNA : Article 17 &#8211; Farseer mouse joint &#038; body from texture"},"content":{"rendered":"<p>In article 13, we made our first steps with Farseer Physics Engine (FPE).<br \/>\nWe had create a world and 2 objects (a floor and boxes going thru gravity).<\/p>\n<p>This time, lets create a body from a texture (no more a simple shape like a rectanle).<br \/>\nLets also add he ability to move that body around with our mouse by using a mouse joint.<\/p>\n<p>Have a look at the method CreateFromTexture in the DrawablePhysicObject class : in short, it creates a polygon from a texture.<br \/>\nHave a look at the update method where we use a FixedMouseJoint.<br \/>\nAlso, see how easy it is to add extra objects like 2 extra floors.<\/p>\n<p>Side note, finding documentation on FPE can sometimes be tedious, especially on latest 3.5 version where significant changes were introduced.<br \/>\nStill, <a href=\"http:\/\/farseerphysics.codeplex.com\/documentation\" target=\"_blank\">here<\/a> is a good start (although meant for 3.3).<br \/>\nAlso, the <a href=\"http:\/\/box2d.org\/manual.html\" target=\"_blank\">box2d manual<\/a> is usefull to understand concepts.<br \/>\nAnd to close this parenthesis around documentation, the <a href=\"http:\/\/farseerphysics.codeplex.com\/releases\/view\/110074\" target=\"_blank\">farseer samples<\/a> are very instructive as well.<\/p>\n<p>Look at the video below to illustrate all this : body from texture, mouse joint.<\/p>\n<div style=\"width: 695px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-713-1\" width=\"695\" height=\"417\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/XNA_DEMO_19-28-11-2013-22-29-35.mp4?_=1\" \/><a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/XNA_DEMO_19-28-11-2013-22-29-35.mp4\">https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/XNA_DEMO_19-28-11-2013-22-29-35.mp4<\/a><\/video><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In article 13, we made our first steps with Farseer Physics Engine (FPE). We had create a world and 2 objects (a floor and boxes going thru gravity). This time, lets create a body from a texture (no more a simple shape like a rectanle). Lets also add he ability to move that body around <a href='https:\/\/labalec.fr\/erwan\/?p=713' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,35],"tags":[],"class_list":["post-713","post","type-post","status-publish","format-standard","hentry","category-dotnet","category-xna","category-34-id","category-35-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=713"}],"version-history":[{"count":1,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/713\/revisions"}],"predecessor-version":[{"id":715,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/713\/revisions\/715"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}