{"id":2644,"date":"2012-12-25T06:11:31","date_gmt":"2012-12-24T20:11:31","guid":{"rendered":"http:\/\/www.vectorstorm.org\/?p=2644"},"modified":"2012-12-25T06:28:25","modified_gmt":"2012-12-24T20:28:25","slug":"physics","status":"publish","type":"post","link":"https:\/\/www.vectorstorm.com.au\/2012\/12\/25\/physics\/","title":{"rendered":"Physics"},"content":{"rendered":"

\"Screen<\/a>A few years back, on New Year’s Eve, Stephen \u201cIncrepare<\/a>\u201d Lavelle challenged me to create a game before the new year.\u00a0 I had about eight hours to put something together\u00a0 (I’d finished coding in time for the deadline, but arranging the Win32 version and setting up a download page took me a few minutes into the new year).\u00a0 The result of that challenge is over here<\/a>.<\/p>\n

Well, he’s made that challenge again this year, albeit he’s given me a little more warning this time;\u00a0 I have about eight days this time, instead of eight hours.\u00a0 In order to put the game into my “Game in a Week” category, I’m not actually going to start thinking about what the game should be yet;\u00a0 I’ll start on it tomorrow, which will give me a week to complete the game.<\/p>\n

So today, instead of starting on the New Years’ game, I’m just going to do some prep work.<\/p>\n

Last time, I realised that I had no way to do real 3D physics in VectorStorm (though the library is reasonably well integrated with Box2D for 2D physics), and so I kludged together my own simple collision system for that game based on the cursor selection code I wrote for MMORPG Tycoon 2.\u00a0 It worked, but I couldn’t do anything other than kill the player, in response to hitting something.\u00a0 This time, I’m going to be prepared in case I do want to make something that’s physics-enabled.\u00a0 So today I’ve been working on adding support for the Bullet Physics<\/a> library.\u00a0 The image here is of a stacked pyramid of boxes, after I’ve fired another box through the middle.<\/p>\n

This particular “firing a hole into a stacked pyramid of boxes” test is sort of the “Hello World” equivalent for physics libraries, these days.<\/p>\n

Right now the integration between Bullet and VectorStorm is embedded in game code, not in VectorStorm itself.\u00a0 Not sure whether I want to make Bullet be a VectorStorm requirement the way that SDL is, or whether it should remain something that individual games can provide for themselves.\u00a0 Need to think it over a little.\u00a0 Regardless, I do now have very simple physics support.\u00a0 Rest of the day will be adding support for non-trivial shapes (ie: non-boxes), and I might test using joints between objects as well, just in case.<\/p>\n","protected":false},"excerpt":{"rendered":"

A few years back, on New Year’s Eve, Stephen \u201cIncrepare\u201d Lavelle challenged me to create a game before the new year.\u00a0 I had about eight hours to put something together\u00a0 (I’d finished coding in time for the deadline, but arranging the Win32 version and setting up a download page took me a few minutes into…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[4,3],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/so9WK-physics","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/2644"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=2644"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/2644\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=2644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=2644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=2644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}