vooga.physicsEngine.geometry
Class GeometricParameters

java.lang.Object
  extended by vooga.physicsEngine.geometry.GeometricParameters
Direct Known Subclasses:
PhysicalParameters

public class GeometricParameters
extends java.lang.Object

Class encapsulating the parameters for a geometric object. This class holds the shape of the object, the position, and the angular position. This class is what the geometry.intersections package operates on.

Author:
Peng Shi, Sami Boghos

Field Summary
protected  Shape shape
           
 
Constructor Summary
GeometricParameters(Shape shape)
          Creates a GeometricParameters object, represents a 2D geometric object with some shape, position, and location.
GeometricParameters(Shape shape, Vector2f position)
          Creates a GeometricParameters object with given shape and position.
GeometricParameters(Shape shape, Vector2f position, double angularPosition)
          Creates a GeometricParameters object with given shape, position and angularPosition.
 
Method Summary
 void drawShape(java.awt.Graphics g)
          Code for internal debugging by the physics engine.
 Vector2f getAbsoluteCoordinate(Vector2f relativeCoordinate)
           
 double getAngularPosition()
           
 Vector2f getCentroidPosition()
           
 JavaShape getJavaShape()
          Return the JavaShape encapsulation of the GeometricParameter 's shape.
 Shape getShape()
           
 java.awt.geom.Area getTransformedArea()
          Code for internal rendering by the physics engine.
 void incrementAngularPosition(double difference)
           
 void incrementPosition(Vector2f difference)
           
 void setAngularPosition(double angularPosition)
           
 void setCentroidPosition(Vector2f position)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shape

protected final Shape shape
Constructor Detail

GeometricParameters

public GeometricParameters(Shape shape)
Creates a GeometricParameters object, represents a 2D geometric object with some shape, position, and location. (default position and angularPosition are (0,0) and 0).

Parameters:
shape - the Shape of the object

GeometricParameters

public GeometricParameters(Shape shape,
                           Vector2f position)
Creates a GeometricParameters object with given shape and position. Default angularPosition is 0.

Parameters:
shape - the Shape of the object
position - the initial position of the object

GeometricParameters

public GeometricParameters(Shape shape,
                           Vector2f position,
                           double angularPosition)
Creates a GeometricParameters object with given shape, position and angularPosition.

Parameters:
shape -
position -
angularPosition -
Method Detail

getShape

public Shape getShape()
Returns:
the shape

setCentroidPosition

public void setCentroidPosition(Vector2f position)
Parameters:
position - the centroid position to set

incrementPosition

public void incrementPosition(Vector2f difference)
Parameters:
difference - the change in position

getCentroidPosition

public Vector2f getCentroidPosition()
Returns:
the position of the centroid

setAngularPosition

public void setAngularPosition(double angularPosition)
Parameters:
angularPosition - the angularPosition to set

incrementAngularPosition

public void incrementAngularPosition(double difference)
Parameters:
defference -

getAngularPosition

public double getAngularPosition()
Returns:
the angularPosition

getAbsoluteCoordinate

public Vector2f getAbsoluteCoordinate(Vector2f relativeCoordinate)
Parameters:
vertex -
Returns:

drawShape

public void drawShape(java.awt.Graphics g)
Code for internal debugging by the physics engine. (Renders the shape onto the given Graphics object without using the game engine.)

Parameters:
Graphics -

getJavaShape

public JavaShape getJavaShape()
Return the JavaShape encapsulation of the GeometricParameter 's shape.

Returns:

getTransformedArea

public java.awt.geom.Area getTransformedArea()
Code for internal rendering by the physics engine. This an java.awt.Area object that factors in the current position and rotation.

Returns: