j3d.org Code

org.j3d.geom.spring
Class SpringNode

java.lang.Object
  extended byorg.j3d.geom.spring.SpringNode

public class SpringNode
extends java.lang.Object

Representation of a node in a collection that many springs are connected to.

Version:
$Revision: 1.1 $
Author:
Justin Couch

Field Summary
 SpringNode[] connections
          Connections to other nodes
 float[] dir
           
 boolean locked
          Is this node currently locked in position?
 float[] naturalLengths
          Natural length of each connection
 float[] normal
          A reference to the global array containing normal information
 int numConnections
           
 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
 
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

position

public float[] position
A reference to the global array containing position information


normal

public float[] normal
A reference to the global array containing normal information


dir

public float[] dir

offset

public int offset
The offset into the array to work with the normal and positions


connections

public SpringNode[] connections
Connections to other nodes


naturalLengths

public float[] naturalLengths
Natural length of each connection


numConnections

public int numConnections

locked

public boolean locked
Is this node currently locked in position?

Method Detail

addSpring

public void addSpring(SpringNode node)
Add a spring between the given node and this node.

Parameters:
node - The new node instance to connect to this one

resetNaturalLengths

public void resetNaturalLengths()
Regenerate the natural lengths based on the current separation between this node and it's connections. This will also reset the current direction vector back to zero again.


j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org