simulation.engine
Class BodyConnection

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

public class BodyConnection
extends java.lang.Object

A connection to a body. When the body moves or rotates, the connection stays on the same relative point.

Author:
Jacob Taylor

Constructor Summary
BodyConnection(Body body, Vector point)
          Creates a connection on a certain body at a certain point
 
Method Summary
 void addImpulse(Vector imp)
          Applies a force at this point to the body
 Body connectedBody()
          Get the body this is connected to
 Vector connectedPoint()
          Get the point's current location
 Vector getVelocity()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BodyConnection

public BodyConnection(Body body,
                      Vector point)
Creates a connection on a certain body at a certain point

Parameters:
body - what body the connection is on
point - where the connection is
Method Detail

connectedPoint

public Vector connectedPoint()
Get the point's current location

Returns:
the current location

addImpulse

public void addImpulse(Vector imp)
Applies a force at this point to the body

Parameters:
imp - the impulse to add

connectedBody

public Body connectedBody()
Get the body this is connected to

Returns:
the body this is connected to

getVelocity

public Vector getVelocity()