com.jme.math
Class SpringNode

java.lang.Object
  extended bycom.jme.math.SpringNode

public class SpringNode
extends java.lang.Object

SpringNode defines a single node in a SpringSystem.

Version:
$Id: SpringNode.java,v 1.1 2004/11/29 21:24:56 renanse Exp $
Author:
Joshua Slack

Field Summary
 Vector3f acceleration
          Acceleration vector, zeroed and recalculated on each SpringSystem.calcForces(float).
 int index
          index of this node in the system.
 float invMass
          Inverse Mass of this node.
 float mass
          Mass of this node.
 Vector3f normal
          Normal vector of this node in space.
 Vector3f oldPos
          Previous Position of this node in space.
 Vector3f position
          Position of this node in space.
 
Constructor Summary
SpringNode(Vector3f pos, Vector3f norm)
          Public constructor.
 
Method Summary
 void setMass(float m)
          Set the mass for this node.
 void update(float dt)
          Verlet update of node location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

public int index
index of this node in the system. Needs to be set by the programmer. can be useful for derivatives of SpringNodeForce that may apply force differently to different nodes based on location in the matrix.


mass

public float mass
Mass of this node.


invMass

public float invMass
Inverse Mass of this node.


position

public Vector3f position
Position of this node in space.


oldPos

public Vector3f oldPos
Previous Position of this node in space.


normal

public Vector3f normal
Normal vector of this node in space.


acceleration

public Vector3f acceleration
Acceleration vector, zeroed and recalculated on each SpringSystem.calcForces(float).

Constructor Detail

SpringNode

public SpringNode(Vector3f pos,
                  Vector3f norm)
Public constructor.

Parameters:
pos - Vertex position of this node.
norm - Vector describing node's normal.
Method Detail

setMass

public void setMass(float m)
Set the mass for this node. Also calculates and stores the inverse mass to invMass field for future use.

Parameters:
m - float

update

public void update(float dt)
Verlet update of node location. Pretty stable. Updates position by using implied velocity derived from the distance travled since last update. Thus velocity and position do not get out of sync.

Parameters:
dt - float - change in time since last update.