|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--render.Vec
Provides functionality to manipulate vectors.
Constructor Summary | |
Vec()
|
Method Summary | |
static void |
copy(double[] src,
double[] dst)
Copies contents of the src vector to the dst vector. |
static void |
cross(double[] a,
double[] b,
double[] dst)
Computes the cross-product of two vectors a and b and stores the result in dst. |
static double |
dot(double[] a,
double[] b)
Computes the dot product of vectors a and b. |
static double |
norm(double[] v)
Computes the magnitude of the vector. |
static void |
normalize(double[] v)
Normalizes vector v to unit-length. |
static void |
rotate(double[] dst,
int axis,
double angle)
Rotates a vector about x or y or z axis |
static void |
set(double[] dst,
double x,
double y,
double z)
Populates the dst vector with values x, y, z. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Vec()
Method Detail |
public static void normalize(double[] v)
v
- a vectorpublic static double norm(double[] v)
v
- a vector
public static double dot(double[] a, double[] b)
a
- source vectorb
- source vector
public static void cross(double[] a, double[] b, double[] dst)
a
- source vector 1b
- source vector 2dst
- resulting vector from a cross bpublic static void copy(double[] src, double[] dst)
src
- original vectordst
- copy of original vectorpublic static void set(double[] dst, double x, double y, double z)
dst
- vector to be populatedx
- component 0y
- component 1z
- component 2public static void rotate(double[] dst, int axis, double angle)
dst
- vector to be rotatedaxis
- of rotation: 0=x, 1=y, 2=zangle
- in radians
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |