org.jagatoo.loaders.models.cal3d.core
Class CalSpringSystem

java.lang.Object
  extended by org.jagatoo.loaders.models.cal3d.core.CalSpringSystem

public class CalSpringSystem
extends java.lang.Object

The spring system class.


Field Summary
protected  boolean collisionEnabled
           
protected  org.openmali.vecmath2.Vector3f force
           
protected  org.openmali.vecmath2.Vector3f gravity
           
static int ITERATION_COUNT
           
protected  CalModel model
           
 
Constructor Summary
CalSpringSystem(CalModel model)
          Constructs the spring system instance.
 
Method Summary
 void calculateForces(CalSubmesh submesh, float deltaTime)
          Calculates the forces on each unbound vertex.
 void calculateVertices(CalSubmesh submesh, float deltaTime)
          Calculates the vertices influenced by the spring system instance.
 org.openmali.vecmath2.Vector3f getForce()
           
 org.openmali.vecmath2.Vector3f getGravity()
           
 boolean isCollisionEnabled()
           
 void setCollisionEnabled(boolean collisionEnabled)
           
 void setForce(org.openmali.vecmath2.Vector3f force)
           
 void setGravity(org.openmali.vecmath2.Vector3f gravity)
           
 void update(float deltaTime)
          Updates all the spring systems in the attached meshes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected CalModel model

gravity

protected org.openmali.vecmath2.Vector3f gravity

force

protected org.openmali.vecmath2.Vector3f force

collisionEnabled

protected boolean collisionEnabled

ITERATION_COUNT

public static final int ITERATION_COUNT
See Also:
Constant Field Values
Constructor Detail

CalSpringSystem

public CalSpringSystem(CalModel model)
Constructs the spring system instance. This function is the default constructor of the spring system instance.

Parameters:
model - the model that should be managed with this spring system instance.
Method Detail

calculateForces

public void calculateForces(CalSubmesh submesh,
                            float deltaTime)
Calculates the forces on each unbound vertex. This function calculates the forces on each unbound vertex of a specific submesh.

Parameters:
submesh - A pointer to the submesh from which the forces should be calculated.
deltaTime - The elapsed time in seconds since the last calculation.

calculateVertices

public void calculateVertices(CalSubmesh submesh,
                              float deltaTime)
Calculates the vertices influenced by the spring system instance. This function calculates the vertices influenced by the spring system instance.

Parameters:
submesh - A pointer to the submesh from which the vertices should be calculated.
deltaTime - The elapsed time in seconds since the last calculation.

update

public void update(float deltaTime)
Updates all the spring systems in the attached meshes. This functon updates all the spring systems in the attached meshes.


getGravity

public org.openmali.vecmath2.Vector3f getGravity()

setGravity

public void setGravity(org.openmali.vecmath2.Vector3f gravity)

getForce

public org.openmali.vecmath2.Vector3f getForce()

setForce

public void setForce(org.openmali.vecmath2.Vector3f force)

isCollisionEnabled

public boolean isCollisionEnabled()

setCollisionEnabled

public void setCollisionEnabled(boolean collisionEnabled)