net.java.dev.joode.stepper
Class QuickStepper

java.lang.Object
  extended by net.java.dev.joode.stepper.AbstractStepperFunction
      extended by net.java.dev.joode.stepper.QuickStepper
All Implemented Interfaces:
StepperFunction

public class QuickStepper
extends AbstractStepperFunction


Field Summary
static QuickStepper INSTANCE
           
 QuickStepParameters qsp
           
static boolean RANDOMLY_REORDER_CONSTRAINTS
          for the SOR method: uncomment the following line to randomly reorder constraint rows during the solution.
static boolean REORDER_CONSTRAINTS
          for the SOR method: uncomment the following line to determine a new constraint-solving order for each iteration.
static java.util.Random rnd
           
static boolean WARM_STARTING
          for the SOR and CG methods: uncomment the following line to use warm starting.
 
Fields inherited from class net.java.dev.joode.stepper.AbstractStepperFunction
GYROSCOPIC
 
Fields inherited from interface net.java.dev.joode.stepper.StepperFunction
EULER, RK4
 
Constructor Summary
QuickStepper()
           
 
Method Summary
 void SOR_LCP(int m, Matrix J, int[][] jb, Body[] body, Matrix3[] invI, float[] lambda, float[][] fc, float[] b, float[] lo, float[] hi, float[] cfm, int[] findex)
          SOR-LCP method note: fc is returned as inv(M)*J'*lambda, the constraint force is actually J'*lambda
 void stepConstraints(int m, World world, Body[] body, int bcount, Joint[] joint, int jcount, Joint.Info1[] info, int[] ofs, Matrix3[] invI, float stepsize)
           
 
Methods inherited from class net.java.dev.joode.stepper.AbstractStepperFunction
addExternalForces, createRowOffsetArray, getInverseInertiaTensors, getJointInfo, resetForces, step, tagBodies, updateVelocity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final QuickStepper INSTANCE

WARM_STARTING

public static final boolean WARM_STARTING
for the SOR and CG methods: uncomment the following line to use warm starting. this definitely help for motor-driven joints. unfortunately it appears to hurt with high-friction contacts using the SOR method. use with care

See Also:
Constant Field Values

REORDER_CONSTRAINTS

public static final boolean REORDER_CONSTRAINTS
for the SOR method: uncomment the following line to determine a new constraint-solving order for each iteration. however, the qsort per iteration is expensive, and the optimal order is somewhat problem dependent.

See Also:
Constant Field Values

RANDOMLY_REORDER_CONSTRAINTS

public static final boolean RANDOMLY_REORDER_CONSTRAINTS
for the SOR method: uncomment the following line to randomly reorder constraint rows during the solution. depending on the situation, this can help a lot or hardly at all, but it doesn't seem to hurt.

See Also:
Constant Field Values

rnd

public static final java.util.Random rnd

qsp

public final QuickStepParameters qsp
Constructor Detail

QuickStepper

public QuickStepper()
Method Detail

stepConstraints

public void stepConstraints(int m,
                            World world,
                            Body[] body,
                            int bcount,
                            Joint[] joint,
                            int jcount,
                            Joint.Info1[] info,
                            int[] ofs,
                            Matrix3[] invI,
                            float stepsize)
Specified by:
stepConstraints in class AbstractStepperFunction

SOR_LCP

public void SOR_LCP(int m,
                    Matrix J,
                    int[][] jb,
                    Body[] body,
                    Matrix3[] invI,
                    float[] lambda,
                    float[][] fc,
                    float[] b,
                    float[] lo,
                    float[] hi,
                    float[] cfm,
                    int[] findex)
SOR-LCP method note: fc is returned as inv(M)*J'*lambda, the constraint force is actually J'*lambda

Parameters:
m - number of constraints
J - an m*12 matrix of constraint rows
jb - an array of first and second body numbers for each constraint row
invI - the global frame inverse inertia for each body (stacked 3x3 matrices)
lambda - return values
fc - returns the constraint force
b -
lo -
hi -