physics3d
Class GamePhysics

java.lang.Object
  extended by physics3d.GamePhysics

public class GamePhysics
extends Object

GamePhysics is an immutable class with static methods that does the physics calculations

Specification Fields :
geometry : Geometry3D // the object that does calculations

Constructor Summary
GamePhysics()
           
 
Method Summary
static void constantVelMove(Ball b, double time)
          move the ball at its current velocity for time time
static void freeMove(Ball ball, double time)
          Move the given ball for the specified amount of time, under only the influence of gravity and air resistance
static List<GameObject> moveBall(Ball ball)
          Move the given ball.
static List<GameObject> willCollideWithBound(Ball ball, Set<GameObject> objects, double timeleft)
          Returns those GameObjects where the ball will collide with their bounds in the next timeleft seconds.
static PhysicsShape world(PhysicsShape p, GameObject o)
          return p in the worldspace of o
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GamePhysics

public GamePhysics()
Method Detail

moveBall

public static List<GameObject> moveBall(Ball ball)
Move the given ball. *

Throws:
FallBackException

willCollideWithBound

public static List<GameObject> willCollideWithBound(Ball ball,
                                                    Set<GameObject> objects,
                                                    double timeleft)
Returns those GameObjects where the ball will collide with their bounds in the next timeleft seconds.


freeMove

public static void freeMove(Ball ball,
                            double time)
Move the given ball for the specified amount of time, under only the influence of gravity and air resistance

Effects:
ball.velocity, ball.position

constantVelMove

public static void constantVelMove(Ball b,
                                   double time)
move the ball at its current velocity for time time


world

public static PhysicsShape world(PhysicsShape p,
                                 GameObject o)
return p in the worldspace of o