simulation.engine
Class CollisionResult

java.lang.Object
  extended by simulation.engine.CollisionResult

public final class CollisionResult
extends java.lang.Object

The result of a collision calculation.

Author:
Jacob Taylor

Constructor Summary
CollisionResult(Vector contact, Vector trans)
          Creates a CollisionResult object describing the result of a collision calculation.
 
Method Summary
 Vector contactPoint()
          Get the location of the contact.
 CollisionResult invert()
          Get a copy of this with the translation vector inverted.
 Vector translation()
          Get the vector that moves the first object out of the collision.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollisionResult

public CollisionResult(Vector contact,
                       Vector trans)
Creates a CollisionResult object describing the result of a collision calculation.

Parameters:
contact - where the collision happened
trans - how much the first shape should be moved
Method Detail

contactPoint

public Vector contactPoint()
Get the location of the contact.

Returns:
the contact point

translation

public Vector translation()
Get the vector that moves the first object out of the collision.

Returns:
the vector that moves the first object out of the collision

invert

public CollisionResult invert()
Get a copy of this with the translation vector inverted. This may be used to make it describe the other object's translation.

Returns:
the modified CollisionResult