|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbox2d.util.blob.BlobStructure
public class BlobStructure
Class for a toroidal repeating blob structure. Should be subclassed with code to initialize the structure in appropriate ways, such as for a hexagonal lattice or a uniform grid.
Blobs are defined within an AABB from (0,0)->(1,1) that is then repeated to fill the full space after scaling (using the BlobMaker methods). The connections list keeps track of pairs of BlobPoints by index that are connected, and the connections* lists keep track of connections outside the AABB (to the corresponding points in the next regions).
Connections should only be defined once per pair.
This class does not allow for arbitrary repeated structures, but most structures of interest will be expressible as toroidally repeating in this way.
Constructor Summary | |
---|---|
BlobStructure()
|
Method Summary | |
---|---|
void |
addConnection(int a,
int b)
Add a connection within two points in the fundamental domain. |
void |
addConnection(int a,
int b,
org.jbox2d.util.blob.BlobStructure.Region r)
Add a connection between point at index a in the fundamental domain and point at index b in region r. |
int |
addPoint(BlobPoint p)
|
float |
getSpringDamping()
|
float |
getSpringFrequency()
|
void |
setSpringDamping(float damp)
|
void |
setSpringFrequency(float freq)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BlobStructure()
Method Detail |
---|
public void setSpringFrequency(float freq)
public float getSpringFrequency()
public void setSpringDamping(float damp)
public float getSpringDamping()
public int addPoint(BlobPoint p)
public void addConnection(int a, int b)
a
- The index in the connections ArrayList of the first point to be connectedb
- The index in the connections ArrayList of the second point to be connectedpublic void addConnection(int a, int b, org.jbox2d.util.blob.BlobStructure.Region r)
a
- b
- r
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |