Emini Physics Engine 1.3.5a API Documentation

at.emini.physics2D
Class MultiShape

java.lang.Object
  extended by at.emini.physics2D.Shape
      extended by at.emini.physics2D.MultiShape

public class MultiShape
extends Shape

The multishape contains several shapes. It is an extension of the standard shape that is treated accordingly by the rest of the code.

Author:
Alexander Adensamer

Field Summary
protected  int[] mAxesStartIndices
          Start indices for the unique axes for each shape in the common axes vector.
protected  Shape[] mShapes
          List of shapes the shape consists of
protected  int[] mVertexStartIndices
          Start indices for the vertices for each shape in the common vertex vector.
 
Fields inherited from class at.emini.physics2D.Shape
MAX_MASS_FX, mCcentroid, mElasticityFX, mFrictionFX, mUserData, mVertices
 
Constructor Summary
MultiShape(MultiShape other)
          Copy Constructor.
MultiShape(java.util.Vector shapes)
          Constructor.
 
Method Summary
 Shape getShape(int index)
          Returns the subshape at a given index.
 int getShapeCount()
          Returns the number of subshapes.
protected  void initShapeMembers(java.util.Vector shapes)
          Sets up the shape vectors.
static MultiShape loadShape(PhysicsFileReader reader, UserData userData, java.util.Vector stdShapes)
          Loads a multi shape from a stream.
 
Methods inherited from class at.emini.physics2D.Shape
correctCentroid, createCircle, createRectangle, createRegularPolygon, getAreaFX, getBoundingRadius, getBoundingRadiusFX, getBoundingRadiusSquare, getCorners, getElasticityFX, getFrictionFX, getId, getMass, getMassFX, getUserData, getVerticesFX, loadShape, setElasticity, setElasticityFX, setFriction, setFrictionFX, setMass, setMassFX, setUserData, updateInternals
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mShapes

protected Shape[] mShapes
List of shapes the shape consists of


mVertexStartIndices

protected int[] mVertexStartIndices
Start indices for the vertices for each shape in the common vertex vector.


mAxesStartIndices

protected int[] mAxesStartIndices
Start indices for the unique axes for each shape in the common axes vector.

Constructor Detail

MultiShape

public MultiShape(java.util.Vector shapes)
Constructor. Creates a complex multi shape from several parts. Each part is a shape. The parts do not have to be centered.

Parameters:
shapes - a vector of shapes that the multi shape consists of

MultiShape

public MultiShape(MultiShape other)
Copy Constructor.

Method Detail

initShapeMembers

protected void initShapeMembers(java.util.Vector shapes)
Sets up the shape vectors. It uses the mVertices[] array to store all shapes sequentially. Its own member indices are used to distinguish the individual shapes.

Parameters:
shapes -

getShape

public Shape getShape(int index)
Returns the subshape at a given index.

Parameters:
index - the index of the subshape.
Returns:
the sub shape

getShapeCount

public int getShapeCount()
Returns the number of subshapes.

Returns:
the shape count

loadShape

public static MultiShape loadShape(PhysicsFileReader reader,
                                   UserData userData,
                                   java.util.Vector stdShapes)
Loads a multi shape from a stream.

Parameters:
reader - a physics file reader.
Returns:
the loaded shape.

Emini Physics Engine 1.3.5a API Documentation

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