{"id":4188,"date":"2013-01-12T17:21:40","date_gmt":"2013-01-12T11:51:40","guid":{"rendered":"http:\/\/www.browserspace.com\/?p=4188"},"modified":"2023-01-13T12:45:51","modified_gmt":"2023-01-13T07:15:51","slug":"weld-joint-box2d-javascript","status":"publish","type":"post","link":"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/","title":{"rendered":"How to make a Weld Joint in Box2D in Javascript"},"content":{"rendered":"<h3>Weld joint in box2d<\/h3>\n<p>The weld joint can be used to join to bodies tightly at a common point. Here is an example <\/p>\n<p>A weld joint is created like this<\/p>\t\t<div class=\"display-ad-unit mobile-wide bsa\" style=\"background:#fff3f3; height:315px;\">\n\n<!-- BinaryTides_S2S_InContent_ROS_Pos1 -->\n<style>\n\t@media only screen and (min-width: 0px) and (min-height: 0px) {\n\t\tdiv[id^=\"bsa-zone_1611170977806-3_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n\t@media only screen and (min-width: 640px) and (min-height: 480px) {\n\t\tdiv[id^=\"bsa-zone_1611170977806-3_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n<\/style>\n<div id=\"bsa-zone_1611170977806-3_123456\"><\/div>\n\n\n<\/div>\n<!-- Time: 1.0967254638672E-5, Pos: 168, Key: ad_unit_1 -->\n\n\n<pre class=\"source-code\" >\/\/create distance joint between b and c\r\nvar joint_def = new b2WeldJointDef();\r\njoint_def.bodyA = b;\r\njoint_def.bodyB = c;\r\n    \r\n\/\/connect the centers - center in local coordinate - relative to body is 0,0\r\njoint_def.localAnchorA = new b2Vec2(-0.5, -0.5);\r\njoint_def.localAnchorB = new b2Vec2(0.5, 0.5);\r\n   \r\n\/\/difference in angle of each body\r\njoint_def.referenceAngle = 0 * Math.PI \/ 3;\r\n    \r\n\/\/add the joint to the world\r\nworld.CreateJoint(joint_def);<\/pre>\n<p>The joint definition needs to know the bodies to connect and the coordinates on each of them where the weld is to be done. It also has a referenceAngle parameter that defines the angle between the 2 bodies after being welded. Play with the referenceAngle to see the effect.<\/p>\n<h3>Source<\/h3>\n<pre class=\"source-code\" >\/**\r\n\tWeld Joint in box2d in javascript\r\n\tSilver Moon (m00n.silv3r@gmail.com)\r\n*\/\r\nvar b2Vec2 = Box2D.Common.Math.b2Vec2\r\n\t, b2AABB = Box2D.Collision.b2AABB\r\n\t, b2BodyDef = Box2D.Dynamics.b2BodyDef\r\n\t, b2Body = Box2D.Dynamics.b2Body\r\n\t, b2FixtureDef = Box2D.Dynamics.b2FixtureDef\r\n\t, b2Fixture = Box2D.Dynamics.b2Fixture\r\n\t, b2World = Box2D.Dynamics.b2World\r\n\t, b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape\r\n\t, b2CircleShape = Box2D.Collision.Shapes.b2CircleShape\r\n\t, b2DebugDraw = Box2D.Dynamics.b2DebugDraw\r\n\t, b2MouseJointDef =  Box2D.Dynamics.Joints.b2MouseJointDef\r\n\t, b2WeldJointDef =  Box2D.Dynamics.Joints.b2WeldJointDef\r\n\t, b2Shape = Box2D.Collision.Shapes.b2Shape\r\n\t;\r\n\r\nvar world;\r\nvar ctx;\r\nvar canvas_width;\r\nvar canvas_height;\r\nvar mouse_pressed = false;\r\nvar mouse_joint = false;\r\nvar mouse_x, mouse_y;\r\n\r\n\/\/box2d to canvas scale , therefor 1 metre of box2d = 30px of canvas :)\r\nvar scale = 30;\r\n\r\n\/\/Draw a world - this method is called in a loop to redraw the world\r\nfunction draw_world(world, context) \r\n{\r\n\t\/\/convert the canvas coordinate directions to cartesian coordinate direction by translating and scaling\r\n\tctx.save();\r\n\tctx.translate(0 , canvas_height);\r\n\tctx.scale(1 , -1);\r\n\tworld.DrawDebugData();\r\n\tctx.restore();\r\n\t\r\n\tctx.font = &#039;bold 18px arial&#039;;\r\n\tctx.textAlign = &#039;center&#039;;\r\n\tctx.fillStyle = &#039;#fff&#039;;\r\n\tctx.fillText(&#039;Box2d Weld Joint example in Javascript&#039;, canvas_width\/2, 20);\r\n\tctx.font = &#039;bold 14px arial&#039;;\r\n\tctx.fillText(&#039;Click on any object and drag it&#039;, canvas_width\/2, 40);\r\n}\r\n\r\n\/\/Create box2d world object\r\nfunction createWorld() \r\n{\r\n\t\/\/Gravity vector x, y - 10 m\/s2 - thats earth!!\r\n\tvar gravity = new b2Vec2(0, -10);\r\n\t\r\n\tworld = new b2World(gravity , true );\r\n\t\r\n\t\/\/setup debug draw\r\n\tvar debugDraw = new b2DebugDraw();\r\n\tdebugDraw.SetSprite(document.getElementById(&amp;quot;canvas&amp;quot;).getContext(&amp;quot;2d&amp;quot;));\r\n\tdebugDraw.SetDrawScale(scale);\r\n\tdebugDraw.SetFillAlpha(0.5);\r\n\tdebugDraw.SetLineThickness(1.0);\r\n\tdebugDraw.SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit);\r\n\t\r\n\tworld.SetDebugDraw(debugDraw);\r\n\t\r\n\t\/\/create some objects\r\n\tground = createBox(world, 8.5, 2, 16 , 1, {type : b2Body.b2_staticBody});\r\n\tvar a = createBox(world, 6.50, 3.80, 1 , 1);\r\n\tvar b = createBox(world, 10.50, 3.80, 1 , 1);\r\n\tvar c = createBox(world, 10.50, 3.80, 1 , 1);\r\n\r\n\t\/\/create distance joint between b and c\r\n\tvar joint_def = new b2WeldJointDef();\r\n\tjoint_def.bodyA = b;\r\n\tjoint_def.bodyB = c;\r\n\t\r\n\t\/\/connect the centers - center in local coordinate - relative to body is 0,0\r\n\tjoint_def.localAnchorA = new b2Vec2(-0.5, -0.5);\r\n\tjoint_def.localAnchorB = new b2Vec2(0.5, 0.5);\r\n\t\r\n\t\/\/difference in angle of each body\r\n\tjoint_def.referenceAngle = 0 * Math.PI \/ 3;\r\n\t\r\n\t\/\/add the joint to the world\r\n\tworld.CreateJoint(joint_def);\r\n\t\r\n\tvar a = createBall(world, 3.50, 3.80, 2);\r\n\tvar b = createBox(world, 10.50, 3.80, 1 , 1);\r\n\t\r\n\t\/\/create distance joint between b and c\r\n\tjoint_def.bodyA = a;\r\n\tjoint_def.bodyB = b;\r\n\t\r\n\t\/\/connect the centers - center in local coordinate - relative to body is 0,0\r\n\tjoint_def.localAnchorA = new b2Vec2(2, 0);\r\n\tjoint_def.localAnchorB = new b2Vec2(0, 0);\r\n\tworld.CreateJoint(joint_def);\r\n\t\r\n\tvar b = createBox(world, 10.50, 3.80, 1 , 1);\r\n\t\r\n\t\/\/create distance joint between b and c\r\n\tjoint_def.bodyA = a;\r\n\tjoint_def.bodyB = b;\r\n\t\r\n\t\/\/connect the centers - center in local coordinate - relative to body is 0,0\r\n\tjoint_def.localAnchorA = new b2Vec2(0, 2);\r\n\tjoint_def.localAnchorB = new b2Vec2(0, 0);\r\n\tworld.CreateJoint(joint_def);\r\n\t\r\n\tvar b = createBox(world, 10.50, 3.80, 1 , 1);\r\n\t\r\n\t\/\/create distance joint between b and c\r\n\tjoint_def.bodyA = a;\r\n\tjoint_def.bodyB = b;\r\n\t\r\n\t\/\/connect the centers - center in local coordinate - relative to body is 0,0\r\n\tjoint_def.localAnchorA = new b2Vec2(-2, 0);\r\n\tjoint_def.localAnchorB = new b2Vec2(0, 0);\r\n\tworld.CreateJoint(joint_def);\r\n\t\r\n\tvar b = createBox(world, 10.50, 3.80, 1 , 1);\r\n\t\r\n\t\/\/create distance joint between b and c\r\n\tjoint_def.bodyA = a;\r\n\tjoint_def.bodyB = b;\r\n\t\r\n\t\/\/connect the centers - center in local coordinate - relative to body is 0,0\r\n\tjoint_def.localAnchorA = new b2Vec2(0, -2);\r\n\tjoint_def.localAnchorB = new b2Vec2(0, 0);\r\n\tworld.CreateJoint(joint_def);\r\n\t\r\n\treturn world;\r\n}\t\t\r\n\r\n\/\/Function to create a round ball, sphere like object\r\nfunction createBall(world, x, y, radius, options) \r\n{\r\n\t \/\/default setting\r\n\toptions = $.extend(true, {\r\n\t\t&#039;density&#039; : 1.0 ,\r\n\t\t&#039;friction&#039; : 1.0 ,\r\n\t\t&#039;restitution&#039; : 0.5 ,\r\n\t\t\r\n\t\t&#039;type&#039; : b2Body.b2_dynamicBody\r\n\t}, options);\r\n\t\r\n\tvar body_def = new b2BodyDef();\r\n\tvar fix_def = new b2FixtureDef();\r\n\t\r\n\tfix_def.density = options.density || 1.0;\r\n\tfix_def.friction = 0.5;\r\n\tfix_def.restitution = 0.5;\r\n\t\r\n\tvar shape = new b2CircleShape(radius);\r\n\tfix_def.shape = shape;\r\n\t\r\n\tbody_def.position.Set(x , y);\r\n\t\r\n\tbody_def.linearDamping = 0.0;\r\n\tbody_def.angularDamping = 0.0;\r\n\t\r\n\tbody_def.type = b2Body.b2_dynamicBody;\r\n\tbody_def.userData = options.user_data;\r\n\t\r\n\tvar b = world.CreateBody( body_def );\r\n\tb.CreateFixture(fix_def);\r\n\t\r\n\treturn b;\r\n}\r\n\r\n\/\/Create standard boxes of given height , width at x,y\r\nfunction createBox(world, x, y, width, height, options) \r\n{\r\n\t \/\/default setting\r\n\toptions = $.extend(true, {\r\n\t\t&#039;density&#039; : 1.0 ,\r\n\t\t&#039;friction&#039; : 1.0 ,\r\n\t\t&#039;restitution&#039; : 0.5 ,\r\n\t\t\r\n\t\t&#039;type&#039; : b2Body.b2_dynamicBody\r\n\t}, options);\r\n      \r\n    var body_def = new b2BodyDef();\r\n\tvar fix_def = new b2FixtureDef();\r\n\t\r\n\tfix_def.density = options.density;\r\n\tfix_def.friction = options.friction;\r\n\tfix_def.restitution = options.restitution;\r\n\t\r\n\tfix_def.shape = new b2PolygonShape();\r\n\t\t\r\n\tfix_def.shape.SetAsBox( width\/2 , height\/2 );\r\n\t\r\n\tbody_def.position.Set(x , y);\r\n\t\r\n\tbody_def.type = options.type;\r\n\tbody_def.userData = options.user_data;\r\n\t\r\n\tvar b = world.CreateBody( body_def );\r\n\tvar f = b.CreateFixture(fix_def);\r\n\t\r\n\treturn b;\r\n}\r\n\r\n\/*\r\n\tThis method will draw the world again and again\r\n\tcalled by settimeout , self looped\r\n*\/\r\nfunction step() \r\n{\r\n\tvar fps = 60;\r\n\tvar timeStep = 1.0\/(fps * 0.8);\r\n\t\r\n\t\/\/move the box2d world ahead\r\n\tworld.Step(timeStep , 8 , 3);\r\n\tworld.ClearForces();\r\n\t\r\n\t\/\/redraw the world\r\n\tdraw_world(world , ctx);\r\n\t\r\n\t\/\/call this function again after 1\/60 seconds or 16.7ms\r\n\tsetTimeout(step , 1000 \/ fps);\r\n}\r\n\r\n\/\/Convert coordinates in canvas to box2d world\r\nfunction get_real(p)\r\n{\r\n\treturn new b2Vec2(p.x + 0, canvas_height_m - p.y);\r\n}\r\n\r\nfunction GetBodyAtMouse(includeStatic)\r\n{\r\n\tvar mouse_p = new b2Vec2(mouse_x, mouse_y);\r\n\t\r\n\tvar aabb = new b2AABB();\r\n\taabb.lowerBound.Set(mouse_x - 0.001, mouse_y - 0.001);\r\n\taabb.upperBound.Set(mouse_x + 0.001, mouse_y + 0.001);\r\n\t\r\n\tvar body = null;\r\n\t\r\n\t\/\/ Query the world for overlapping shapes.\r\n\tfunction GetBodyCallback(fixture)\r\n\t{\r\n\t\tvar shape = fixture.GetShape();\r\n\t\t\r\n\t\tif (fixture.GetBody().GetType() != b2Body.b2_staticBody || includeStatic)\r\n\t\t{\r\n\t\t\tvar inside = shape.TestPoint(fixture.GetBody().GetTransform(), mouse_p);\r\n\t\t\t\r\n\t\t\tif (inside)\r\n\t\t\t{\r\n\t\t\t\tbody = fixture.GetBody();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\tworld.QueryAABB(GetBodyCallback, aabb);\r\n\treturn body;\r\n}\r\n\r\n\/\/ main entry point\r\n$(function() \r\n{\r\n\t\/\/first create the world\r\n\tworld = createWorld();\r\n\t\r\n\tvar canvas = $(&#039;#canvas&#039;);\r\n\tctx = canvas.get(0).getContext(&#039;2d&#039;);\r\n\t\r\n\t\/\/get internal dimensions of the canvas\r\n\tcanvas_width = parseInt(canvas.attr(&#039;width&#039;));\r\n\tcanvas_height = parseInt(canvas.attr(&#039;height&#039;));\r\n\tcanvas_height_m = canvas_height \/ scale;\r\n\t\r\n\t\/\/If mouse is moving over the thing\r\n\t$(canvas).mousemove(function(e) \r\n\t{\r\n\t\tvar p = get_real(new b2Vec2(e.pageX\/scale, e.pageY\/scale))\r\n\t\t\r\n\t\tmouse_x = p.x;\r\n\t\tmouse_y = p.y;\r\n\t\t\r\n\t\tif(mouse_pressed &amp;amp;&amp;amp; !mouse_joint)\r\n\t\t{\r\n\t\t\tvar body = GetBodyAtMouse();\r\n\t\t\t\r\n\t\t\tif(body)\r\n\t\t\t{\r\n\t\t\t\t\/\/if joint exists then create\r\n\t\t\t\tvar def = new b2MouseJointDef();\r\n\t\t\t\t\r\n\t\t\t\tdef.bodyA = ground;\r\n\t\t\t\tdef.bodyB = body;\r\n\t\t\t\tdef.target = p;\r\n\t\t\t\t\r\n\t\t\t\tdef.collideConnected = true;\r\n\t\t\t\tdef.maxForce = 1000 * body.GetMass();\r\n\t\t\t\tdef.dampingRatio = 0;\r\n\t\t\t\t\r\n\t\t\t\tmouse_joint = world.CreateJoint(def);\r\n\t\t\t\t\r\n\t\t\t\tbody.SetAwake(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t\/\/nothing\r\n\t\t}\r\n\t\t\r\n\t\tif(mouse_joint)\r\n\t\t{\r\n\t\t\tmouse_joint.SetTarget(p);\r\n\t\t}\r\n\t});\r\n\t\r\n\t$(canvas).mousedown(function() \r\n\t{\r\n\t\t\/\/flag to indicate if mouse is pressed or not\r\n\t\tmouse_pressed = true;\r\n\t});\r\n\t\r\n\t\/*\r\n\t\tWhen mouse button is release, mark pressed as false and delete the mouse joint if it exists\r\n\t*\/\r\n\t$(canvas).mouseup(function() \r\n\t{\r\n\t\tmouse_pressed = false;\r\n\t\t\r\n\t\tif(mouse_joint)\r\n\t\t{\r\n\t\t\tworld.DestroyJoint(mouse_joint);\r\n\t\t\tmouse_joint = false;\r\n\t\t}\r\n\t});\r\n\t\r\n\t\/\/start stepping\r\n\tstep();\r\n});<\/pre>\t\t<div class=\"display-ad-unit mobile-wide bsa\" style=\"background:#fff3f3; height:315px;\">\n\n\n<!-- BinaryTides_S2S_InContent_ROS_Pos2 -->\n<style>\n\t@media only screen and (min-width: 0px) and (min-height: 0px) {\n\t\tdiv[id^=\"bsa-zone_1611334361252-4_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n\t@media only screen and (min-width: 640px) and (min-height: 480px) {\n\t\tdiv[id^=\"bsa-zone_1611334361252-4_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n<\/style>\n<div id=\"bsa-zone_1611334361252-4_123456\"><\/div>\n\n\n<\/div>\n<!-- Time: 0.0013411045074463, Pos: 10411, Key: ad_unit_2 -->\n\n\n<h3>Resources<\/h3>\n<p>Download box2d javascript port here<br \/>\n<a href=\"http:\/\/code.google.com\/p\/box2dweb\/\">http:\/\/code.google.com\/p\/box2dweb\/<\/a><\/p>\n<p>For documentation check the flash reference<br \/>\n<a href=\"http:\/\/www.box2dflash.org\/docs\/2.1a\/reference\/\">http:\/\/www.box2dflash.org\/docs\/2.1a\/reference\/<\/a><\/p>\n\n<!-- SMARTADDR: No ad unit (ad_unit_3) was added at location: 13911. Content Length: 11331 -->\n<!-- SMARTADDR: No ad unit (ad_unit_4) was added at location: 13911. Content Length: 11426 -->\n<!-- SMARTADDR: No ad unit (ad_unit_5) was added at location: 13911. Content Length: 11521 -->","protected":false},"excerpt":{"rendered":"<p>Weld joint in box2d The weld joint can be used to join to bodies tightly at a common point. Here is an example A weld joint is created like this \/\/create distance joint between b and c var joint_def = new b2WeldJointDef(); joint_def.bodyA = b; joint_def.bodyB = c; \/\/connect the centers &#8211; center in local&#8230; <span class=\"read-more\"><a href=\"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":14487,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[543,545],"tags":[],"class_list":["post-4188","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-box2d-game-programming","category-javascript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to make a Weld Joint in Box2D in Javascript - BinaryTides<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Silver Moon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/\",\"url\":\"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/\",\"name\":\"How to make a Weld Joint in Box2D in Javascript - BinaryTides\",\"isPartOf\":{\"@id\":\"https:\/\/www.binarytides.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/01\/box2d-javascript-banner.jpg\",\"datePublished\":\"2013-01-12T11:51:40+00:00\",\"dateModified\":\"2023-01-13T07:15:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/#primaryimage\",\"url\":\"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/01\/box2d-javascript-banner.jpg\",\"contentUrl\":\"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/01\/box2d-javascript-banner.jpg\",\"width\":1920,\"height\":1080,\"caption\":\"Box2D Banner\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.binarytides.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to make a Weld Joint in Box2D in Javascript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.binarytides.com\/#website\",\"url\":\"https:\/\/www.binarytides.com\/\",\"name\":\"BinaryTides\",\"description\":\"News, Technology, Entertainment and more\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.binarytides.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd\",\"name\":\"Silver Moon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.binarytides.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g\",\"caption\":\"Silver Moon\"},\"description\":\"A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at binarytides@gmail.com.\",\"url\":\"https:\/\/www.binarytides.com\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to make a Weld Joint in Box2D in Javascript - BinaryTides","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/","twitter_misc":{"Written by":"Silver Moon","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/","url":"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/","name":"How to make a Weld Joint in Box2D in Javascript - BinaryTides","isPartOf":{"@id":"https:\/\/www.binarytides.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/#primaryimage"},"image":{"@id":"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/01\/box2d-javascript-banner.jpg","datePublished":"2013-01-12T11:51:40+00:00","dateModified":"2023-01-13T07:15:51+00:00","author":{"@id":"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd"},"breadcrumb":{"@id":"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/#primaryimage","url":"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/01\/box2d-javascript-banner.jpg","contentUrl":"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/01\/box2d-javascript-banner.jpg","width":1920,"height":1080,"caption":"Box2D Banner"},{"@type":"BreadcrumbList","@id":"https:\/\/www.binarytides.com\/weld-joint-box2d-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.binarytides.com\/"},{"@type":"ListItem","position":2,"name":"How to make a Weld Joint in Box2D in Javascript"}]},{"@type":"WebSite","@id":"https:\/\/www.binarytides.com\/#website","url":"https:\/\/www.binarytides.com\/","name":"BinaryTides","description":"News, Technology, Entertainment and more","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.binarytides.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd","name":"Silver Moon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.binarytides.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g","caption":"Silver Moon"},"description":"A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at binarytides@gmail.com.","url":"https:\/\/www.binarytides.com\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts\/4188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/comments?post=4188"}],"version-history":[{"count":1,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts\/4188\/revisions"}],"predecessor-version":[{"id":14486,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts\/4188\/revisions\/14486"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/media\/14487"}],"wp:attachment":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/media?parent=4188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/categories?post=4188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/tags?post=4188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}