public final class MyVector3f
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
firstAxis
index of the first (X) axis
|
static int |
lastAxis
index of the final (Z) axis
|
static java.util.logging.Logger |
logger
message logger for this class
|
static int |
numAxes
number of axes in the coordinate system
|
static int |
xAxis
index of the X axis
|
static int |
yAxis
index of the Y axis
|
static int |
zAxis
index of the Z axis
|
| Modifier and Type | Method and Description |
|---|---|
static void |
accumulateMaxima(Vector3f maxima,
Vector3f input)
Accumulate maximum coordinates.
|
static void |
accumulateMinima(Vector3f minima,
Vector3f input)
Accumulate minimum coordinates.
|
static void |
accumulateScaled(Vector3f total,
Vector3f input,
float scale)
Accumulate a linear combination of vectors.
|
static java.lang.String |
describe(Vector3f vector)
Generate a textual description of a Vector3f value.
|
static java.lang.String |
describeDirection(Vector3f v)
Generate a textual description of a direction vector.
|
static double |
dot(Vector3f vector1,
Vector3f vector2)
Determine the dot (scalar) product of 2 vectors.
|
static void |
generateBasis(Vector3f in1,
Vector3f store2,
Vector3f store3)
Generate an orthonormal basis that includes the specified vector.
|
static boolean |
isAllNonNegative(Vector3f vector)
Test whether all components of a vector are all non-negative: in other
words, whether it's in the first octant or the boundaries thereof.
|
static boolean |
isAllPositive(Vector3f vector)
Test whether all components of a vector are all positive: in other words,
whether it's strictly inside the first octant.
|
static boolean |
isScaleIdentity(Vector3f vector)
Test for a scale identity.
|
static boolean |
isScaleUniform(Vector3f vector)
Test for a uniform scaling vector.
|
static boolean |
isZero(Vector3f vector)
Test for a zero vector or translation identity.
|
static double |
lengthSquared(Vector3f vector)
Determine the squared length of a vector.
|
static Vector3f |
lerp(float t,
Vector3f v0,
Vector3f v1,
Vector3f storeResult)
Interpolate linearly between (or extrapolate linearly from) 2 vectors.
|
static Vector3f |
midpoint(Vector3f vector1,
Vector3f vector2,
Vector3f storeResult)
Determine the midpoint between 2 locations.
|
static boolean |
ne(Vector3f v1,
Vector3f v2)
Test whether 2 vectors are distinct, without distinguishing 0 from -0.
|
static void |
normalizeLocal(Vector3f input)
Normalize the specified vector in place.
|
static Vector3f |
standardize(Vector3f input,
Vector3f storeResult)
Standardize a vector in preparation for hashing.
|
public static final int firstAxis
public static final int numAxes
public static final int xAxis
public static final int yAxis
public static final int zAxis
public static final int lastAxis
public static final java.util.logging.Logger logger
public static void accumulateMaxima(Vector3f maxima, Vector3f input)
maxima - the highest coordinate so far for each axis (not null,
modified)input - vector to compare (not null, unaffected)public static void accumulateMinima(Vector3f minima, Vector3f input)
minima - the lowest coordinate so far for each axis (not null,
modified)input - vector to compare (not null, unaffected)public static void accumulateScaled(Vector3f total, Vector3f input, float scale)
total - sum of the scaled inputs so far (not null, modified)input - the vector to scale and add (not null, unaffected)scale - scale factor to apply to the inputpublic static java.lang.String describe(Vector3f vector)
vector - the value to describe (may be null, unaffected)public static java.lang.String describeDirection(Vector3f v)
v - the value to describe (may be null, unaffected)public static double dot(Vector3f vector1, Vector3f vector2)
Vector3f.dot(Vector3f), this method returns a
double-precision value for precise calculation of angles.vector1 - the first input vector (not null, unaffected)vector2 - the 2nd input vector (not null, unaffected)public static void generateBasis(Vector3f in1, Vector3f store2, Vector3f store3)
in1 - input direction for the first basis vector (not null, not
zero, modified)store2 - storage for the 2nd basis vector (not null, modified)store3 - storage for the 3rd basis vector (not null, modified)public static boolean isAllNonNegative(Vector3f vector)
vector - input (not null, unaffected)public static boolean isAllPositive(Vector3f vector)
vector - input (not null, unaffected)public static boolean isScaleIdentity(Vector3f vector)
vector - input (not null, unaffected)Vector3f.UNIT_XYZ, false otherwisepublic static boolean isScaleUniform(Vector3f vector)
vector - input (not null, unaffected)public static boolean isZero(Vector3f vector)
vector - input (not null, unaffected)public static double lengthSquared(Vector3f vector)
Vector3f.lengthSquared(), this method uses
double-precision arithmetic to reduce the risk of overflow and returns a
double-precision value for precise comparison of lengths.vector - input (not null, unaffected)public static Vector3f lerp(float t, Vector3f v0, Vector3f v1, Vector3f storeResult)
No rounding error is introduced when v1==v2.
t - the weight given to v1v0 - the function value at t=0 (not null, unaffected unless it's
also storeResult)v1 - the function value at t=1 (not null, unaffected unless it's
also storeResult)storeResult - storage for the result (modified if not null, may be
v0 or v1)storeResult or a new
instance)public static Vector3f midpoint(Vector3f vector1, Vector3f vector2, Vector3f storeResult)
vector1 - coordinates of the first location (not null, unaffected
unless it's storeResult)vector2 - coordinates of the 2nd location (not null, unaffected
unless it's storeResult)storeResult - storage for the result (modified if not null, may be
vector1 or vector2)storeResult or a new
instance)public static boolean ne(Vector3f v1, Vector3f v2)
v1 - the first input vector (not null, unaffected)v2 - the 2nd input vector (not null, unaffected)public static void normalizeLocal(Vector3f input)
input - (not null, modified)public static Vector3f standardize(Vector3f input, Vector3f storeResult)
input - (not null, unaffected unless it's also storeResult)storeResult - storage for the result (modified if not null, may be
input)