|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectprocessing.core.PVector
generativedesign.Node
generativedesign.Attractor
public class Attractor
This class extends the functionality of the Node class to provide some more functions that make working with the attractor easier.
| Field Summary | |
|---|---|
static int |
BASIC
Basic attractor function |
int |
mode
One of the constants BASIC, SMOOTH (default), TWIRL. |
static int |
SMOOTH
Attractor function with a smooth transition at the attractor radius |
float |
strength
Attraction strength (default = 1). |
static int |
TWIRL
Same as SMOOTH, but perpendicular to the attraction vector |
| Fields inherited from class generativedesign.Node |
|---|
damping, diameter, id, maxVelocity, maxX, maxY, maxZ, minX, minY, minZ, radius, ramp, velocity |
| Fields inherited from class processing.core.PVector |
|---|
x, y, z |
| Constructor Summary | |
|---|---|
Attractor()
Creates an attractor at default position (0, 0, 0). |
|
Attractor(float theX,
float theY)
Creates an attractor position (theX, theY, 0). |
|
Attractor(float theX,
float theY,
float theZ)
Creates an attractor position (theX, theY, theZ). |
|
Attractor(PVector theVector)
Creates an attractor at the position given by theVector. |
|
| Method Summary | |
|---|---|
void |
attachNode(Node theNode)
Adds a node to this attractor |
void |
attract()
Performs attraction for all attached nodes. |
void |
attract(Node theNode)
Performs attraction for theNode. |
int |
getMode()
|
Node[] |
getNodes()
|
float |
getStrength()
|
void |
setMode(int theMode)
|
void |
setNodes(Node[] nodes)
|
void |
setStrength(float theStrength)
|
| Methods inherited from class generativedesign.Node |
|---|
attract, getDamping, getDiameter, getID, getMaxVelocity, getMaxX, getMaxY, getMaxZ, getMinX, getMinY, getMinZ, getRadius, getRamp, getVelocity, rotateX, rotateY, rotateZ, setBoundary, setBoundary, setDamping, setDiameter, setID, setMaxVelocity, setMaxX, setMaxY, setMaxZ, setMinX, setMinY, setMinZ, setRadius, setRamp, setVelocity, update, update |
| Methods inherited from class processing.core.PVector |
|---|
add, add, add, add, angleBetween, array, cross, cross, cross, dist, dist, div, div, div, dot, dot, dot, equals, fromAngle, fromAngle, get, get, hashCode, heading, heading2D, lerp, lerp, lerp, limit, mag, magSq, mult, mult, mult, normalize, normalize, random2D, random2D, random2D, random2D, random3D, random3D, random3D, random3D, rotate, set, set, set, set, setMag, setMag, sub, sub, sub, sub, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int BASIC
public static final int SMOOTH
public static final int TWIRL
public int mode
public float strength
| Constructor Detail |
|---|
public Attractor()
public Attractor(float theX,
float theY)
public Attractor(float theX,
float theY,
float theZ)
public Attractor(PVector theVector)
| Method Detail |
|---|
public void attachNode(Node theNode)
theNode - Node to attachpublic void attract()
public void attract(Node theNode)
attract in class NodetheNode - Node to attractpublic int getMode()
public void setMode(int theMode)
public float getStrength()
getStrength in class Nodepublic void setStrength(float theStrength)
setStrength in class Nodepublic Node[] getNodes()
public void setNodes(Node[] nodes)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||