Abstract
In this chapter, I will discuss motion and collision. In terms of motion, I will discuss the basics of an object’s linear velocity, linear acceleration, angular velocity, and angular acceleration. I cover Newton’s three laws of motion and the new Physics class we have created to implement these laws of motion. I then discuss a hands-on example that demonstrates with a bouncing and rotating cube how to apply linear and angular acceleration to objects. Next, I cover collision detection and collision response and add code to our Physics class to implement this collision detection and collision response. I then go through a hands-on example where we add in another cube on top of the one from the previous hands-on example and demonstrate our new collision detection and response code. Finally, we create a gravity grid and then demonstrate its use by adding this grid to the previous hands-on example with the two colliding cubes.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2014 Robert Chin
About this chapter
Cite this chapter
Chin, R. (2014). Motion and Collision. In: Beginning Android 3D Game Development. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-6548-1_5
Download citation
DOI: https://doi.org/10.1007/978-1-4302-6548-1_5
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4302-6547-4
Online ISBN: 978-1-4302-6548-1
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books