- 1、本文档共84页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
BOX英文版——Part1
HOME
ABOUT
Box2D 2.1a Tutorial – Part 1
Posted by?Allan Bishop?on Wednesday, July 14, 2010 ·?View Comments?
Physics engines are arguably one of the most engaging elements in interactive media. Not only do they add visual realism but they also allow a greater interactive experience.The Flash platform has a multitude of physics engine libraries available but the one I will be focusing on is?Box2D 2.1a?- arguably the most powerful and feature rich physics engine of them all.
A little background info: Box2D is the brainchild of Erin Catto,?Blizzard’s Principle Software Engineer. Box2D is in fact written in C++, but such is its popularity it spawned many ports with ActionScript 3 being no exception. In charge of the manual porting to ActionScript 3 has been?BorisTheBrave?who has kept up with Erin’s updates. With the release of 2.1 emerged a new port, created by?Jesse Sternberg,?who leveraged Alchemy to generate AS3 code from the C++ version. He has also made a framework?WCK?to allow developers to create Box2D objects by using the Flash IDE to layout the various elements.
However, for now, I will be focusing on BorisTheBrave’s port which you can download from?here.
Box2D can be fairly intimidating to begin developing with due to its sheer scale so we are going to ease into it. I have based my following tutorial heavily on Box2D manual’s Hello World?tutorial, the major changes being all the code examples are written in AS3 and a few minor creative liberties that I have taken. Make sure you are familiar with the following definitions from the Box2D manual:
shape: A 2D geometrical object, such as a circle or polygon.
rigid body: A chunk of matter that is so strong that the distance between any two bits of matter on the chunk is completely constant. They are hard like a diamond. In the following discussion we use body interchangeably with rigid body.
fixture: A fixture binds a shape to a body and adds material properties such as density, friction, and restitution.
world: A
文档评论(0)