edu.eside.flingbox.physics.collisions
Class ContactSolver

java.lang.Object
  extended by edu.eside.flingbox.physics.collisions.ContactSolver

public class ContactSolver
extends java.lang.Object

Contact solver solves contacts between two bodies and applies necessaries forces over each body. This class has all members static due performance improvement


Method Summary
static void solveCollision(Contact contact)
          Computes contacts effects to body's Conditions for a contact solver (I total) = (I total at the end) Vel diference at end = (Vel diference at begin) * e so: (I1 + I2) = (I1f + I2f) (v1f - v2f) = (v1 - v2) * e
static void solvePenetration(Contact contact)
          Keeps bodies outside for other bodies
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

solveCollision

public static void solveCollision(Contact contact)
Computes contacts effects to body's Conditions for a contact solver (I total) = (I total at the end) Vel diference at end = (Vel diference at begin) * e so: (I1 + I2) = (I1f + I2f) (v1f - v2f) = (v1 - v2) * e

Parameters:
contact - contact descriptor
bodyA - first colliding body
bodyB - second colliding body

solvePenetration

public static void solvePenetration(Contact contact)
Keeps bodies outside for other bodies

Parameters:
contact - contact descriptor
bodyA - first body in contact
bodyB - second body in contact