net.phys2d.raw.shapes
Class Box

java.lang.Object
  extended bynet.phys2d.raw.shapes.AbstractShape
      extended bynet.phys2d.raw.shapes.Box
All Implemented Interfaces:
DynamicShape, Shape

public class Box
extends AbstractShape
implements DynamicShape

A simple box in the engine - defined by a width and height


Field Summary
 
Fields inherited from class net.phys2d.raw.shapes.AbstractShape
bounds
 
Constructor Summary
Box(float width, float height)
          Create a box in the simulation
 
Method Summary
 Vector2f[] getPoints(ROVector2f pos, float rotation)
          Get the current positon of a set of points
 ROVector2f getSize()
          Get the size of this box
 float getSurfaceFactor()
          Some factor based on the edges length of the shape
 
Methods inherited from class net.phys2d.raw.shapes.AbstractShape
getBounds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.phys2d.raw.shapes.Shape
getBounds
 

Constructor Detail

Box

public Box(float width,
           float height)
Create a box in the simulation

Parameters:
width - The width of a box
height - The hieght of the box
Method Detail

getSize

public ROVector2f getSize()
Get the size of this box

Returns:
The size of this box

getSurfaceFactor

public float getSurfaceFactor()
Description copied from interface: Shape
Some factor based on the edges length of the shape

Specified by:
getSurfaceFactor in interface Shape
Returns:
The factor result - from the original demo
See Also:
Shape.getSurfaceFactor()

getPoints

public Vector2f[] getPoints(ROVector2f pos,
                            float rotation)
Get the current positon of a set of points

Parameters:
pos - The centre of the box
rotation - The rotation of the box
Returns:
The points building up a box at this position and rotation