Emini Physics Engine 1.3.5a API Documentation

at.emini.physics2D
Class ShapeSet

java.lang.Object
  extended by at.emini.physics2D.ShapeSet

public class ShapeSet
extends java.lang.Object

The shapeset manages the shapes within a world. All shapes of a world are referenced here. Whenever the World.addBody(Body) adds a body, it registers the shape in its ShapeSet. If the shape is already registered nothing happens.

Author:
Alexander Adensamer

Field Summary
protected  java.util.Vector mShapes
          A list of all registered shapes.
 
Constructor Summary
ShapeSet()
          Empty Constructor.
ShapeSet(ShapeSet other)
          Copy constructor.
 
Method Summary
 ShapeSet copy()
          Copies the shape set.
protected  void correctShapeId(int index)
          Corrects the shape id for the shape at a given index This can be required if the vector was meddled with (like deleting, inserting, etc)
 java.util.Vector getShapes()
          Gets the vector of all shapes.
 boolean isRegistered(Shape s)
          Checks if a shape is registered.
 void registerShape(Shape s)
          Registers a shape in the set.
 void registerShapes(java.util.Vector newShapes)
          Registers a vector of shapes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mShapes

protected java.util.Vector mShapes
A list of all registered shapes.

Constructor Detail

ShapeSet

public ShapeSet()
Empty Constructor.


ShapeSet

public ShapeSet(ShapeSet other)
Copy constructor.

Parameters:
other - the shape set to copy.
Method Detail

copy

public ShapeSet copy()
Copies the shape set.

Returns:
the copy of the shape set

registerShape

public void registerShape(Shape s)
Registers a shape in the set. If the shape is already registered (here or somewhere else), it is ignored.

Parameters:
s - the shape to register.

registerShapes

public void registerShapes(java.util.Vector newShapes)
Registers a vector of shapes. All shapes in the vector that are not registered anywhere else are registered here.

Parameters:
newShapes - vector of shapes to register.

isRegistered

public boolean isRegistered(Shape s)
Checks if a shape is registered.

Parameters:
s - the shape to check for.
Returns:
true if the shape is registered here.

correctShapeId

protected void correctShapeId(int index)
Corrects the shape id for the shape at a given index This can be required if the vector was meddled with (like deleting, inserting, etc)

Parameters:
index - the index

getShapes

public java.util.Vector getShapes()
Gets the vector of all shapes.

Returns:
the vector of all registered shapes.

Emini Physics Engine 1.3.5a API Documentation

Emini Physics Engine 1.3.5a API Documentation - Copyright 2014 Alexander Adensamer