|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jocl.cloth.utils.ArrayUtils
public class ArrayUtils
Utility methods for array operations
Method Summary | |
---|---|
static void |
add(float[] dstArray,
int dstIndex,
float[] srcArray,
int srcIndex)
Add the specified 3D vector to the specified vector |
static void |
cross(float[] dstArray,
int dstIndex,
float[] srcArray0,
int srcIndex0,
float[] srcArray1,
int srcIndex1,
float[] srcArray2,
int srcIndex2)
Computes the cross product from 3D vertices that are stored in arrays, and stores the result in an array |
static void |
cross(float[] dstArray,
int dstIndex,
float vx0,
float vy0,
float vz0,
float vx1,
float vy1,
float vz1)
Computes the cross product from the given vectors and stores it in the given array |
static int[] |
deinterlace(int[] array,
int stride,
int offset)
Deinterlace the given array. |
static int |
max(int... a)
Returns the maximum of the given values |
static int |
min(int... a)
Returns the minimum of the given values |
static void |
normalize(float[] array,
int index)
Normalize the 3D vector at the specified position |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int min(int... a)
a
- The values
public static int max(int... a)
a
- The values
public static int[] deinterlace(int[] array, int stride, int offset)
size=array.length/stride
that contains the elements
of the given array at the positions i*stride+offset
array
- The arraystride
- The strideoffset
- The offset
public static void cross(float[] dstArray, int dstIndex, float[] srcArray0, int srcIndex0, float[] srcArray1, int srcIndex1, float[] srcArray2, int srcIndex2)
dstArray
- The destination arraydstIndex
- The index where to store the resultsrcArray0
- The first source arraysrcIndex0
- The index of the first source vertexsrcArray1
- The second source arraysrcIndex1
- The index of the second source vertexsrcArray2
- The third source arraysrcIndex2
- The index of the third source vertexpublic static void cross(float[] dstArray, int dstIndex, float vx0, float vy0, float vz0, float vx1, float vy1, float vz1)
dstArray
- The destination arraydstIndex
- The index in the destination arrayvx0
- The x-coordinate of the first vectorvy0
- The y-coordinate of the first vectorvz0
- The z-coordinate of the first vectorvx1
- The x-coordinate of the second vectorvy1
- The y-coordinate of the second vectorvz1
- The z-coordinate of the second vectorpublic static void add(float[] dstArray, int dstIndex, float[] srcArray, int srcIndex)
dstArray
- The destination arraydstIndex
- The destination indexsrcArray
- The source arraysrcIndex
- The source indexpublic static void normalize(float[] array, int index)
array
- The arrayindex
- The index in the array
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |