net.java.dev.joode.stepper
Class BodyVariables

java.lang.Object
  extended by net.java.dev.joode.stepper.BodyVariables

public class BodyVariables
extends java.lang.Object

provides a container class for mutable variables of bodies during a step application. The class is provided so that variables can be stored and rolled back during a multi step function (such as midpoint method, and Range-Kutter)

Author:
s0570397

Field Summary
 Vector3 avel
           
static Body bodyTmp
          we need to use a real body to perform the angular updates becuase the body might contains some optimizations (held in flags) luckily we do not have to worry about mass though
 Vector3 facc
           
 Vector3 lvel
           
 Vector3 pos
           
 Quaternion q
           
 Matrix3 r
           
 Vector3 tacc
           
 
Constructor Summary
BodyVariables()
           
 
Method Summary
static void apply(BodyVariables[] variables, RealPointer acceleration, float stepsize)
          applies the acceleration information to a list of body variables to update them, like a normal Euler step
static BodyVariables[] aquireBodyVariableList(int size)
          retrieves a whole array of instanciated body variables, from a pool
static boolean equals(BodyVariables[] a, BodyVariables[] b)
           
static boolean equals(BodyVariables a, BodyVariables b)
           
 void get(Body b)
          exports this containers values back into a body
static void get(BodyVariables[] variables, Body[] bodies)
           
static void releaseBodyVariableList(BodyVariables[] list)
          releases an array of body variables (got from aquire)
static void rk4Update(BodyVariables[] variables, BodyVariables[] dx, RealPointer dv, float stepsize)
          updates the the position and velocity variables independantly, compatabile with the RK4 algorithm
static void rk4Update(BodyVariables[] variables, RealPointer dx, RealPointer dv, float stepsize)
          updates the the position and velocity variables independantly, compatabile with the RK4 algorithm
 void set(Body b)
          stores the bodies variables into this container
static void set(BodyVariables[] variables, Body[] bodies)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pos

public final Vector3 pos

q

public final Quaternion q

r

public final Matrix3 r

avel

public final Vector3 avel

lvel

public final Vector3 lvel

tacc

public final Vector3 tacc

facc

public final Vector3 facc

bodyTmp

public static final Body bodyTmp
we need to use a real body to perform the angular updates becuase the body might contains some optimizations (held in flags) luckily we do not have to worry about mass though

Constructor Detail

BodyVariables

public BodyVariables()
Method Detail

aquireBodyVariableList

public static BodyVariables[] aquireBodyVariableList(int size)
retrieves a whole array of instanciated body variables, from a pool

Parameters:
size -
Returns:

releaseBodyVariableList

public static void releaseBodyVariableList(BodyVariables[] list)
releases an array of body variables (got from aquire)

Parameters:
list -

set

public void set(Body b)
stores the bodies variables into this container

Parameters:
b -

get

public void get(Body b)
exports this containers values back into a body

Parameters:
b -

set

public static void set(BodyVariables[] variables,
                       Body[] bodies)

get

public static void get(BodyVariables[] variables,
                       Body[] bodies)

apply

public static void apply(BodyVariables[] variables,
                         RealPointer acceleration,
                         float stepsize)
applies the acceleration information to a list of body variables to update them, like a normal Euler step

Parameters:
variables -
acceleration - acceleration to apply bodies
stepsize -

rk4Update

public static void rk4Update(BodyVariables[] variables,
                             RealPointer dx,
                             RealPointer dv,
                             float stepsize)
updates the the position and velocity variables independantly, compatabile with the RK4 algorithm

Parameters:
variables -
stepsize -

rk4Update

public static void rk4Update(BodyVariables[] variables,
                             BodyVariables[] dx,
                             RealPointer dv,
                             float stepsize)
updates the the position and velocity variables independantly, compatabile with the RK4 algorithm

Parameters:
dx - get the required velocity updates from another body list instead of a packed array

equals

public static boolean equals(BodyVariables a,
                             BodyVariables b)

equals

public static boolean equals(BodyVariables[] a,
                             BodyVariables[] b)