Monthly Archives: September 2012

Collision Detection

Collision detection is necessary for simulating an accurate physics environment. Examples of common usage include prevention of objects from falling through a platform, prevention of objects from passing through each other, and prevention of anything passing outside of boundaries.

To accomplish collision detection without a sophisticated engine, games and software can utilize plane canvases with either an (x,y) or an (x,y,z) coordinate system, whether the game is two-dimensional or three-dimensional, respectively. Thus all objects have a cubic region with coordinates at every corner. So whenever the object moves, the program checks that the object’s region doesn’t intersect any other region, and if it does, then the program moves the object to the nearest sufficient open space.

For more sophisticated collision detection, object velocity, direction, acceleration, and mass must be taken into effect to be able to calculate where the object will move to after colliding, how fast it will move after, and which direction it would move in.


Humor: Physics Court

Having gone up and refused to come down, I hereby find you in violation of the law.

Physics Laws must not be broken!

Physics Engine: Box2D

Box2D Stats
Developer: Erin Catto
Cost: Free, open-source
Programming Language: C++

Box2D is is an open-source physics and graphics engine for two-dimensional games created by Erin Catto in 2006. Features include:

  • Continuous Collision Detection
  • Rigid Body Dynamics
  • Gravity
  • Friction
  • Restitution

Box2D has become the basis for many other engines, including Cocos2D for iPhone, Chipmunk, and Torque2D


Gravity is a vital portion of 3D video games and simulations, as the environment cannot mimic real physics without gravity. Without gravity, characters and objects will not be able to properly move, jump, or fall, because gravity is an essential piece of many motion equations. In most situations, a complete Physics Engine is optimal, as it factors in gravity along with other components – collision detection, rotation calculations, rigid body dynamics, Brownian motion, et cetera), however it is not required. Algorithms for gravity have been written and open sourced for many languages and can be easily found on services like GitHub, Google Code, and SourceForge.

The Force of Gravity equals 9.8 m/s2, so if a character starts falling from rest, his speed will increase according to the time elapsed squared times the force of gravity. The speed can then be used to calculate how much damage must be applied to the character, so falling for one second doesn’t hurt the player as much as falling for 4 seconds, which adds an additional dynamic to gameplay.


About this Blog
Welcome to the Unlimited Physics blog! This weekly blog will look at all kinds of awesome Physics and Physics applications.
I don’t want this blog to turn into just reviews. I see this blog analyzing different uses of physics and different kinds of physics and their benefits. However, I will look at different uses from the real world and point out what physics are being used and how.

About Me
My name is Justin Etzine, and I’m a High School Junior at Posnack in South Florida. I love technology and engineering. I’ve been programming since fifth grade, and since expanded from just computer science into engineering in general.