First, we'd like to have a simple model of a ball that can bounce off a ground, a ceiling, and walls. We'll simply use the dimensions of our movie to represent the wall and floor. A new instance of the Away3DPhysics class needs to be created. It needs to have the Away3D view passed to it so Jiglib can add the Away3D primitives to the scene when the physics primitives are created. The second parameter is the time. This is usually set to 1, but it is set to 2 here to make the simulation faster. [code]
A Body Definition consists of 2, 3, or 4 things. 1.) A Shape Definition. 2.) An (x,y) position. optional: 3.) Rotation (in radians) 4.) A pre-made Sprite object. And, that's it. Hopefully, you've learned a little something about how to implement a bit of physics into your Flash applications, and learned how and when to fake some of it. Every story has to start somewhere, and in this story we begin with our good friend Sir Isaac Newton. Newton's theories have been, and are still the primary theories studied to understand the way things happen around us. In this series of tutorials we are going to explore various aspects of physics and how they can be represented in your flash applications. We begin with gravity. |
| w_w_w_._j___a__v_a2s__.___c___o__m___ | Contact Us |
| Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
| All other trademarks are property of their respective owners. |