com.planeth.gtroids.physics.helper
Class CollisionHelper

java.lang.Object
  extended bycom.planeth.gtroids.physics.helper.CollisionHelper

public class CollisionHelper
extends java.lang.Object

Helper to check for collisions between AbstractPhysicalObjects

Author:
Andreas Grässer, gal@planet-h.com
created 23.12.2005

Constructor Summary
CollisionHelper()
           
 
Method Summary
static boolean checkCollision(AbstractPhysicalObject obj1, AbstractPhysicalObject obj2)
          Checks for collision of obj1 and obj2
Returns true, if a collision is detected
static void handleBorderCollision(AbstractAnimatedObject obj, GamePanel gamePanel)
          Handles the borderCollisions of the passed object
Changes the vel and circumferencial vel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollisionHelper

public CollisionHelper()
Method Detail

checkCollision

public static boolean checkCollision(AbstractPhysicalObject obj1,
                                     AbstractPhysicalObject obj2)
Checks for collision of obj1 and obj2
Returns true, if a collision is detected

Parameters:
obj1 - first object for the check
obj2 - second object for the check
Returns:
Returns true, if a collision is detected

handleBorderCollision

public static void handleBorderCollision(AbstractAnimatedObject obj,
                                         GamePanel gamePanel)
Handles the borderCollisions of the passed object
Changes the vel and circumferencial vel.

Parameters:
obj - the object for the check
gamePanel - the panel, where the object lives