edu.gatech.cs2335.lemmings.physics
Class PhysicsEngine

java.lang.Object
  extended byedu.gatech.cs2335.lemmings.physics.PhysicsEngine

public class PhysicsEngine
extends java.lang.Object

The Physics Engine. This takes care of calculating movement due to gravity or velocity in addition to taking care of World Collision Detection. Revision History: v1.7 (2004-04-13) - Added code for climbers, gliders, and floaters v1.6a (2004-04-13) - VLAD: I updated the ray-tracing code for the J direction, so that when the lemming or whatever hits the ground, the first component is not -1, but rather just the negative of the real value. The real value cannot be negative, so that's fine. That fixes the bug, where the lemming dies but doesn't really reach ground visually. v1.5a(2004-04-12) - Negative Gravity now works v1.5 (2004-04-12) - Rewrote most of Physics Engine, PMD should shut the hell up now. Added Particle calculations, fixed rayTracing when falling up, calculations now work for crazy Gravity settings up to around 11, above that and strange things happen. Velocities will work at any value, so long as gravity is not too wild a number. Currently, a negative gravity causes problems. v1.1 (2004-04-01) - Updated stuff so the lemmings' animation is handled correctly upon reversing direction.

Version:
1.7
Author:
Jose Caban

Constructor Summary
PhysicsEngine()
           
 
Method Summary
 void calculateNextPoint(java.util.List poList)
          Iterate through the list of Physics Objects and calculate their next Positions
 void calculateNextPoint(PhysicsObject po)
          Calculates the next point for the Physics Object
 java.awt.image.BufferedImage getCurrentMap()
          get CurrentMap
static PhysicsEngine getInstance()
          Method getInstance
static java.awt.image.BufferedImage getUnbreakableMap()
          Method getUnbreakableMap
 void setCurrentMap(java.awt.image.BufferedImage aMap)
          Set the current gameplay level
static void setUnbreakableMap(java.awt.image.BufferedImage unbreakableMap)
          Method setUnbreakableMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhysicsEngine

public PhysicsEngine()
Method Detail

getInstance

public static PhysicsEngine getInstance()
Method getInstance

Returns:
the Physics Engine instance

getCurrentMap

public java.awt.image.BufferedImage getCurrentMap()
get CurrentMap

Returns:
BufferedImage , currentMap

getUnbreakableMap

public static java.awt.image.BufferedImage getUnbreakableMap()
Method getUnbreakableMap

Returns:
BufferedImage , unbreakable image

setCurrentMap

public void setCurrentMap(java.awt.image.BufferedImage aMap)
Set the current gameplay level

Parameters:
aMap - the new game level

setUnbreakableMap

public static void setUnbreakableMap(java.awt.image.BufferedImage unbreakableMap)
Method setUnbreakableMap

Parameters:
unbreakableMap - unbreakable image.

calculateNextPoint

public void calculateNextPoint(PhysicsObject po)
Calculates the next point for the Physics Object

Parameters:
po - the Physics object to calculate the next point for

calculateNextPoint

public void calculateNextPoint(java.util.List poList)
Iterate through the list of Physics Objects and calculate their next Positions

Parameters:
poList - the list of Physics objects to iterate through