org.jbox2d.util.blob
Class BlobMaker

java.lang.Object
  extended by org.jbox2d.util.blob.BlobMaker

public class BlobMaker
extends Object

BlobMaker offers a static API for the creation of blobs.


Field Summary
static float pointDensity
           
static float pointFriction
           
static float pointRadius
           
 
Constructor Summary
BlobMaker()
           
 
Method Summary
static void createBlob(BlobStructure s, BlobContainer c, World w)
          Creates a blob in a given physics world.
static void createBlob(BlobStructure s, BlobContainer c, World w, float scaleX, float scaleY)
          Creates a blob in a given physics world.
static void createBlob(BlobStructure s, BlobContainer c, World w, float scaleX, float scaleY, float transX, float transY)
          Creates a blob in a given physics world.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pointRadius

public static float pointRadius

pointDensity

public static float pointDensity

pointFriction

public static float pointFriction
Constructor Detail

BlobMaker

public BlobMaker()
Method Detail

createBlob

public static void createBlob(BlobStructure s,
                              BlobContainer c,
                              World w)
Creates a blob in a given physics world. Does not apply any scaling or translation to the structure before filling the container with it.

The fill procedure aligns the structure with the upper left corner of the container AABB, then repeats the structure until the AABB is filled, testing at each point whether the container is supposed to have geometry there.

Parameters:
s - The BlobStructure definition
c - The BlobContainer that specifies the geometry to fill
w - The World to create the blob in

createBlob

public static void createBlob(BlobStructure s,
                              BlobContainer c,
                              World w,
                              float scaleX,
                              float scaleY)
Creates a blob in a given physics world. Applies the specified x/y scaling to the structure before fill.

The fill procedure aligns the structure with the upper left corner of the container AABB, applies the scaling, then repeats the structure until the AABB is filled, testing at each point whether the container is supposed to have geometry there.

Parameters:
s - The BlobStructure definition
c - The BlobContainer that specifies the geometry to fill
w - The World to create the blob in
scaleX - The world width of one repeating cell of the structure
scaleY - The world height of one repeating cell of the structure

createBlob

public static void createBlob(BlobStructure s,
                              BlobContainer c,
                              World w,
                              float scaleX,
                              float scaleY,
                              float transX,
                              float transY)
Creates a blob in a given physics world. Applies the specified x/y scaling to the structure before fill.

The fill procedure aligns the structure with the upper left corner of the container AABB, applies the scaling, shifts the cell by the requested translation amounts, then repeats the structure until the AABB is filled, testing at each point whether the container is supposed to have geometry there.

Parameters:
s - The BlobStructure definition
c - The BlobContainer that specifies the geometry to fill
w - The World to create the blob in
scaleX - The world width of one repeating cell of the structure
scaleY - The world height of one repeating cell of the structure
transX - The world x offset of the cells from the AABB edge
transY - The world y offset of the cells from the AABB edge