com.planeth.gtroids.physics.helper
Class CircumferentialVelHelper

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

public class CircumferentialVelHelper
extends java.lang.Object

Encapsulates the logic to handle the circumferencial vel of an object after a collision with the border.

It simulates some kind of kinetic energy.
The rotation affects the resulting vel.
The vel affects the resulting rotation.

Author:
Andreas Grässer, gal@planet-h.com.
created May 9, 2005

Constructor Summary
CircumferentialVelHelper(double circumferentialVel, Vector2D vel, int direction, double leverage)
          Constructor for CircumferentialVelHelper.
 
Method Summary
 void calculate()
          Calculates the new vel and circumferecialVel (after the collision)
 double getCircumferentialVel()
          Returns the circumferencialVel.
 int getDirection()
          Returns the direction, where the circumferencial is active
 Vector2D getVel()
          Returns the vel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CircumferentialVelHelper

public CircumferentialVelHelper(double circumferentialVel,
                                Vector2D vel,
                                int direction,
                                double leverage)
Constructor for CircumferentialVelHelper.

Parameters:
circumferentialVel - the circumferencialVel before the collision
vel - the velocity before the collision
direction - the direction, where the circumferencial is active
leverage - the leverage which affects the moving forces
Method Detail

calculate

public void calculate()
Calculates the new vel and circumferecialVel (after the collision)


getCircumferentialVel

public double getCircumferentialVel()
Returns the circumferencialVel.

Returns:
Returns the circumferencialVel.

getVel

public Vector2D getVel()
Returns the vel.

Returns:
Returns the vel.

getDirection

public int getDirection()
Returns the direction, where the circumferencial is active

Returns:
Returns the direction, where the circumferencial is active