|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.geom.spring.SpringNode
public class SpringNode
Representation of a node in a collection that many springs are connected to.
For memory efficiency purposes, each node has a position and normal direction that are sourced from a global array. An offset provides the direct reference into the array for it's specific information.
Field Summary | |
---|---|
SpringNode[] |
connections
Connections to other nodes |
float[] |
dir
Direction the node is currently moving. |
boolean |
locked
Is this node currently locked in position? |
float[] |
naturalLengths
Natural length of each connection |
int |
nNormal
number of valid normals from the contributing connections |
float[] |
normal
A reference to the global array containing normal information |
int |
numConnections
The number of valid items in the connections array |
int |
offset
The offset into the array to work with the normal and positions. |
float[] |
position
A reference to the global array containing position information |
Constructor Summary | |
---|---|
SpringNode()
Create an empty version of this node. |
|
SpringNode(float[] pos,
float[] norm,
int offset)
Create a new node at the given position and normal. |
Method Summary | |
---|---|
void |
addSpring(SpringNode node)
Add a spring between the given node and this node. |
void |
resetNaturalLengths()
Regenerate the natural lengths based on the current separation between this node and it's connections. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float[] position
public float[] normal
public float[] dir
public int offset
public SpringNode[] connections
public float[] naturalLengths
public int numConnections
connections
array
public int nNormal
public boolean locked
Constructor Detail |
---|
public SpringNode()
public SpringNode(float[] pos, float[] norm, int offset)
SpringSystem.addRectField(int, int, float[], float[])
method of SpringSystem.
pos
- The position array that contains the locationnorm
- The normal array that contains our normaloffset
- The offset into the arrays that this node is located atMethod Detail |
---|
public void addSpring(SpringNode node)
node
- The new node instance to connect to this onepublic void resetNaturalLengths()
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |