Class iicm.utils3d.Vec3f
All Packages Class Hierarchy This Package Previous Next Index
Class iicm.utils3d.Vec3f
java.lang.Object
|
+----iicm.utils3d.Vec3f
- public final class Vec3f
- extends Object
Vec3f - small utilities for 3D vectors.
Copyright (c) 1997 IICM
-
value_
- 3D vector of values
-
X
-
-
Y
-
-
Z
-
-
Vec3f()
- constructor (0, 0, 0)
-
Vec3f(float, float, float)
- constructor (x, y, z)
-
Vec3f(float[])
- constructor (a[0], a[1], a[2]).
-
assign(float, float, float)
- assignment (x, y, z)
-
assign(float[])
- assignment (a[0], a[1], a[2]).
-
assign(Vec3f)
- assignment (copying, v = b)
-
cross(float[], float[])
-
-
cross(Vec3f, Vec3f)
- assign cross product a X b to this vector.
-
decrease(float[])
-
-
decrease(Vec3f)
- decrease (v -= b)
-
dot(float[], float[])
-
-
dot(Vec3f, Vec3f)
- dot product.
-
getOrthogonalVector(float[], float[])
- find a vector that is orthogonal to non-zero vector v.
-
getRotationAngle(Vec3f)
- get the angle which the xy plane must be rotatated about the
Y-axis (unchanged) such that the new normal vector (Z-axis)
points towards start
-
increase(float[])
-
-
increase(Vec3f)
- increase (v += b)
-
negate()
- negate (v = -v)
-
normalize()
- normalize.
-
print(float[])
- print a 3D float array (debugging tool)
-
rayat(float[], float, float[])
- ray equation (a + t * b)
-
scale(float)
- scale by a scalar
-
scale(float[], float)
-
-
sincrease(float, float[])
-
-
sincrease(float, Vec3f)
- sincrease (v += f * b).
-
slerpNorm(float[], int, float[], int, float, float[], int)
- spherical linear interpolation of 3D vector.
-
toString()
- conversion to string: "(x, y, z)".
value_
public float value_[]
- 3D vector of values
X
public final static int X
Y
public final static int Y
Z
public final static int Z
Vec3f
public Vec3f()
- constructor (0, 0, 0)
Vec3f
public Vec3f(float x,
float y,
float z)
- constructor (x, y, z)
Vec3f
public Vec3f(float a[])
- constructor (a[0], a[1], a[2]). values are copied into internal array.
assign
public void assign(float x,
float y,
float z)
- assignment (x, y, z)
assign
public void assign(float a[])
- assignment (a[0], a[1], a[2]). values are copied into internal array.
assign
public void assign(Vec3f b)
- assignment (copying, v = b)
negate
public void negate()
- negate (v = -v)
increase
public void increase(Vec3f b)
- increase (v += b)
increase
public void increase(float w[])
decrease
public void decrease(Vec3f b)
- decrease (v -= b)
decrease
public void decrease(float w[])
sincrease
public void sincrease(float f,
Vec3f b)
- sincrease (v += f * b). increase by a scaled vector
sincrease
public void sincrease(float f,
float w[])
rayat
public void rayat(float a[],
float t,
float b[])
- ray equation (a + t * b)
scale
public void scale(float f)
- scale by a scalar
scale
public static void scale(float v[],
float f)
dot
public static float dot(Vec3f a,
Vec3f b)
- dot product. < a . b > E.g. dot (a, a) is the square norm of a
dot
public static float dot(float u[],
float v[])
cross
public void cross(Vec3f a,
Vec3f b)
- assign cross product a X b to this vector.
do not call with "this" as either argument.
cross
public void cross(float u[],
float v[])
normalize
public float normalize()
- normalize. return old length
getOrthogonalVector
public static void getOrthogonalVector(float v[],
float axis[])
- find a vector that is orthogonal to non-zero vector v.
write result (normalized) into axis
getRotationAngle
public static float getRotationAngle(Vec3f start)
- get the angle which the xy plane must be rotatated about the
Y-axis (unchanged) such that the new normal vector (Z-axis)
points towards start
- Returns:
- angle off rotation
slerpNorm
public static void slerpNorm(float a1[],
int a1offs,
float a2[],
int a2offs,
float t,
float a[],
int aoffs)
- spherical linear interpolation of 3D vector. return a vector that
lies "at t between a1 and a2", i.e. a1 for t == 0, a2 for t == 1
and an interpolation of a1 and a2 for values between 0 and 1.
a1offs and a2offs allow a1 and a2 to start at an offset.
result is written at aoffs into array a.
toString
public String toString()
- conversion to string: "(x, y, z)". E.g.: System.out.println (v);
- Overrides:
- toString in class Object
print
public static String print(float v[])
- print a 3D float array (debugging tool)
All Packages Class Hierarchy This Package Previous Next Index