{"id":414,"date":"2009-09-22T22:19:34","date_gmt":"2009-09-23T05:19:34","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=2239"},"modified":"2009-09-22T22:19:34","modified_gmt":"2009-09-23T05:19:34","slug":"quickbox2d-joint-skinning","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=414","title":{"rendered":"QuickBox2D Joint Skinning"},"content":{"rendered":"<p>Well&#8230; while on the topic of skinning I figured I&#8217;d post something I&#8217;ve been meaning to post for awhile. Currently, joint skinning leaves something to be desired in QuickBox2D. This is because I haven&#8217;t had the need to skin many joints &#8230; and also because with joints like pulley, prismatic, revolute etc&#8230; I&#8217;m not entirely sure what the best skinning solution even is&#8230; For instance, on a pulley you probably don&#8217;t want three duplicate MovieClips used for the skin. Anyway, early on in my Box2D experimentation I needed distance joint skins so that feature has been around since maybe alpha 108&#8230;<\/p>\n<p>It&#8217;s pretty simple, Check out the demo and code below:<\/p>\n<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nimport com.actionsnippet.qbox.*;\r\n \r\n&#x5B;SWF(width = 800, height = 600, backgroundColor = 0xFFFFFF, frameRate=60)]\r\n\r\nvar sim:QuickBox2D = new QuickBox2D(this, {debug:false});\r\n\r\nsim.createStageWalls({fillColor:0xFFFFFF});\r\n \r\nvar circleA:QuickObject = sim.addCircle({x:3, y:3, radius:1, skin:CircleSkin});\r\nvar circleB:QuickObject = sim.addCircle({x:6, y:6, radius:0.5, skin:CircleSkin});\r\n\r\nsim.addJoint({type:&quot;distance&quot;, a:circleA.body, b:circleB.body, skin:JointSkin});\r\n\r\nsim.start();\r\nsim.mouseDrag();\r\n<\/pre>\n<p><a data-asruffle-linked=\"true\" href=\"http:\/\/www.actionsnippet.com\/swfs\/skinning\/distance_joint_skin.html\" target=\"blank\"><br \/>\nCheck out the swf here&#8230;<br \/>\n<img decoding=\"async\" src=\"https:\/\/actionsnippet.com\/wp-content\/joint_skin.gif\" \/><\/a> <span class=\"asruffle-link\" data-swf=\"{&quot;url&quot;:&quot;https:\\\/\\\/actionsnippet.com\\\/swfs\\\/skinning\\\/distance_joint_skin.swf&quot;,&quot;title&quot;:&quot;distance joint skin&quot;,&quot;width&quot;:800,&quot;height&quot;:600,&quot;missing&quot;:false,&quot;allowScriptAccess&quot;:false,&quot;backgroundColor&quot;:&quot;#ffffff&quot;}\"><button type=\"button\" hidden aria-expanded=\"false\">Play demo<span class=\"screen-reader-text\">: distance joint skin<\/span><\/button><\/span><\/p>\n<p><a href=\"http:\/\/www.actionsnippet.com\/swfs\/skinning\/distance_joint_skin.fla\">Download the fla here&#8230;<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well&#8230; while on the topic of skinning I figured I&#8217;d post something I&#8217;ve been meaning to post for awhile. Currently, joint skinning leaves something to be desired in QuickBox2D. This is because I haven&#8217;t had the need to skin many joints &#8230; and also because with joints like pulley, prismatic, revolute etc&#8230; I&#8217;m not entirely [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,12],"tags":[3,15,4,16],"class_list":["post-414","post","type-post","status-publish","format-standard","hentry","category-box2d","category-quickbox2d","tag-actionscript","tag-box2d","tag-flash","tag-quickbox2d"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=414"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/414\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}