|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.math.SpatialVec
public final class SpatialVec
A collection of methods for spatial vectors As defined in Rigid Body Dynamics Algorithms Roy Featherstone 2007 Spatial vectors can be stored within arrays of length 6, or they can be stored inside a larger float array a, together with an integer offset "index" into that array. This represents a vector with components (a[index], a[index+1], a[index+2]). The methods from this class never allocate new arrays; rather, they assume that results are to be stored into some existing "destination" array.
| Field Summary | |
|---|---|
static int |
SPATIALVEC_SIZE
Length of SpatialVec arrays is 6 |
static float[] |
ZERO
The zero vector |
| Constructor Summary | |
|---|---|
private |
SpatialVec()
|
| Method Summary | |
|---|---|
static void |
add(float[] dst,
float[] a)
dst = dst+a |
static void |
add(float[] dst,
float[] a,
float[] b)
dst = a+b |
static void |
add(float[] dst,
int dstIndex,
float[] a,
int aIndex)
dst = dst+a |
static void |
cross(float[] dst,
float[] a,
float[] b)
Cross product |
static void |
cross(float[] dst,
int dstIndex,
float[] a,
int aIndex,
float[] b,
int bIndex)
velocity x velocity product |
static void |
crossForce(float[] dst,
float[] v,
float[] f)
movement x force, Featherstone's x* operation |
static void |
crossForce(float[] dst,
int dstIndex,
float[] v,
int vIndex,
float[] f,
int fIndex)
movement x force, Featherstone's x* operation |
static float |
dot(float[] a,
float[] b)
Spatial dot product |
static float |
dot(float[] a,
int aIndex,
float[] b,
int bIndex)
Spatial dot product |
static boolean |
epsilonEquals(float[] a,
float[] b,
float epsilon)
Tests for equality of vector components within epsilon. |
static boolean |
epsilonEquals(float[] a,
int aIndex,
float[] b,
int bIndex,
float epsilon)
Tests for equality of vector components within epsilon. |
static void |
set(float[] dst,
float[] src)
Copies the src 6-vector to the dst 6-vector |
static void |
set(float[] dst,
float[] w,
float[] v0)
Sets the dst 6-vector from two 3-vectors dst=[w v0]^T |
static void |
set(float[] dst,
float v0,
float v1,
float v2,
float v3,
float v4,
float v5)
Copies the src 6-vector to the dst 6-vector |
static void |
set(float[] dst,
int dstIndex,
float[] src,
int srcIndex)
Copies the src 6-vector to the dst 6-vector |
static void |
setAcc(float[] dst,
float[] w,
float[] v,
float[] wDiff,
float[] a)
Set the spatial acceleration vector from 'traditional' angular velocity, velocity, angular acceleration and acceleration |
static void |
setZero(float[] dst)
|
static void |
sub(float[] dst,
float[] a)
dst = dst-a |
static void |
sub(float[] dst,
float[] a,
float[] b)
dst = a-b |
static void |
sub(float[] dst,
int dstIndex,
float[] a,
int aIndex)
dst = dst-a |
static String |
toString(float[] a)
String representation |
static String |
toString(float[] a,
int aIndex)
String representation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SPATIALVEC_SIZE
public static final float[] ZERO
| Constructor Detail |
|---|
private SpatialVec()
| Method Detail |
|---|
public static void set(float[] dst,
float v0,
float v1,
float v2,
float v3,
float v4,
float v5)
public static void setZero(float[] dst)
public static void set(float[] dst,
float[] src)
public static void set(float[] dst,
int dstIndex,
float[] src,
int srcIndex)
public static void set(float[] dst,
float[] w,
float[] v0)
public static void setAcc(float[] dst,
float[] w,
float[] v,
float[] wDiff,
float[] a)
public static void add(float[] dst,
float[] a,
float[] b)
public static void sub(float[] dst,
float[] a,
float[] b)
public static void add(float[] dst,
float[] a)
public static void sub(float[] dst,
float[] a)
public static void add(float[] dst,
int dstIndex,
float[] a,
int aIndex)
public static void sub(float[] dst,
int dstIndex,
float[] a,
int aIndex)
public static float dot(float[] a,
float[] b)
public static float dot(float[] a,
int aIndex,
float[] b,
int bIndex)
public static void cross(float[] dst,
float[] a,
float[] b)
public static void cross(float[] dst,
int dstIndex,
float[] a,
int aIndex,
float[] b,
int bIndex)
public static void crossForce(float[] dst,
float[] v,
float[] f)
public static void crossForce(float[] dst,
int dstIndex,
float[] v,
int vIndex,
float[] f,
int fIndex)
public static boolean epsilonEquals(float[] a,
float[] b,
float epsilon)
public static boolean epsilonEquals(float[] a,
int aIndex,
float[] b,
int bIndex,
float epsilon)
public static String toString(float[] a)
public static String toString(float[] a,
int aIndex)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||