|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.geom.Vec4
public class Vec4
| Field Summary | |
|---|---|
static Vec4 |
INFINITY
|
static Vec4 |
ONE
|
static Vec4 |
UNIT_NEGATIVE_W
|
static Vec4 |
UNIT_NEGATIVE_X
|
static Vec4 |
UNIT_NEGATIVE_Y
|
static Vec4 |
UNIT_NEGATIVE_Z
|
static Vec4 |
UNIT_W
|
static Vec4 |
UNIT_X
|
static Vec4 |
UNIT_Y
|
static Vec4 |
UNIT_Z
|
double |
w
|
double |
x
|
double |
y
|
double |
z
|
static Vec4 |
ZERO
|
| Constructor Summary | |
|---|---|
Vec4(double value)
|
|
Vec4(double x,
double y)
|
|
Vec4(double x,
double y,
double z)
|
|
Vec4(double x,
double y,
double z,
double w)
|
|
| Method Summary | |
|---|---|
Vec4 |
add3(Vec4 vec4)
|
Angle |
angleBetween3(Vec4 vec4)
|
static Angle |
axisAngle(Vec4 v1,
Vec4 v2,
Vec4[] result)
Compute the angle and rotation axis required to rotate one vector to align with another. |
static Vec4 |
clamp3(Vec4 vec4,
double min,
double max)
|
Vec4 |
cross3(Vec4 vec4)
|
double |
distanceTo3(Vec4 vec4)
|
double |
distanceToSquared3(Vec4 vec4)
|
Vec4 |
divide3(double value)
|
Vec4 |
divide3(Vec4 vec4)
|
double |
dot3(Vec4 vec4)
|
double |
dot4(Vec4 vec4)
|
double |
dotSelf3()
|
double |
dotSelf4()
|
boolean |
equals(java.lang.Object obj)
|
static Vec4 |
fromArray2(double[] array,
int offset)
Constructs a new Vec4 with x and y values from the specified double array. |
static Vec4 |
fromArray3(double[] array,
int offset)
Constructs a new Vec4 with x, y and z values from the specified double
array. |
static Vec4 |
fromArray4(double[] array,
int offset)
Constructs a new Vec4 with x, y, z and w values from the
specified double array. |
static Vec4 |
fromDoubleArray(double[] array,
int offset,
int length)
Constructs a new Vec4 with coordinate values read from the specified double array. |
static Vec4 |
fromFloatArray(float[] array,
int offset,
int length)
Constructs a new Vec4 with coordinate values read from the specified float array. |
static Vec4 |
fromLine3(Vec4 origin,
double t,
Vec4 direction)
|
Vec4 |
getAbs3()
|
static double |
getAverageDistance(java.lang.Iterable<? extends Vec4> points)
|
double |
getLength3()
|
double |
getLengthSquared3()
|
Vec4 |
getNegative3()
|
double |
getW()
|
double |
getX()
|
double |
getY()
|
double |
getZ()
|
int |
hashCode()
|
static Vec4 |
max3(Vec4 value1,
Vec4 value2)
|
static Vec4 |
min3(Vec4 value1,
Vec4 value2)
|
static Vec4 |
mix3(double amount,
Vec4 value1,
Vec4 value2)
|
Vec4 |
multiply3(double value)
|
Vec4 |
multiply3(Vec4 vec4)
|
Vec4 |
normalize3()
|
Vec4 |
perpendicularTo3(Vec4 vec4)
|
Vec4 |
projectOnto3(Vec4 vec4)
|
Vec4 |
subtract3(Vec4 vec4)
|
double[] |
toArray2(double[] array,
int offset)
Writes this Vec4's x and y values to the specified double array. |
double[] |
toArray3(double[] array,
int offset)
Writes this Vec4's x, y and z values to the specified double array. |
double[] |
toArray4(double[] array,
int offset)
Writes this Vec4's x, y, z and w values to the specified
double array. |
double[] |
toDoubleArray(double[] array,
int offset,
int length)
Writes this Vec4's coordinate values to the specified double array. |
float[] |
toFloatArray(float[] array,
int offset,
int length)
Writes this Vec4's coordinate values to the specified float array. |
java.lang.String |
toString()
|
Vec4 |
transformBy3(Matrix matrix)
|
Vec4 |
transformBy3(Quaternion quaternion)
|
Vec4 |
transformBy4(Matrix matrix)
|
double |
w()
|
double |
x()
|
double |
y()
|
double |
z()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Vec4 INFINITY
public static final Vec4 ONE
public static final Vec4 UNIT_NEGATIVE_W
public static final Vec4 UNIT_NEGATIVE_X
public static final Vec4 UNIT_NEGATIVE_Y
public static final Vec4 UNIT_NEGATIVE_Z
public static final Vec4 UNIT_W
public static final Vec4 UNIT_X
public static final Vec4 UNIT_Y
public static final Vec4 UNIT_Z
public final double w
public final double x
public final double y
public final double z
public static final Vec4 ZERO
| Constructor Detail |
|---|
public Vec4(double value)
public Vec4(double x,
double y)
public Vec4(double x,
double y,
double z)
public Vec4(double x,
double y,
double z,
double w)
| Method Detail |
|---|
public final Vec4 add3(Vec4 vec4)
public final Angle angleBetween3(Vec4 vec4)
public static Angle axisAngle(Vec4 v1,
Vec4 v2,
Vec4[] result)
v1 - The base vector.v2 - The vector to rotate into alignment with v1.result - A reference to an array in which to return the computed axis. May not be null.
java.lang.IllegalArgumentException - if any parameter is null.
public static Vec4 clamp3(Vec4 vec4,
double min,
double max)
public final Vec4 cross3(Vec4 vec4)
public final double distanceTo3(Vec4 vec4)
public final double distanceToSquared3(Vec4 vec4)
public final Vec4 divide3(double value)
public final Vec4 divide3(Vec4 vec4)
public final double dot3(Vec4 vec4)
public final double dot4(Vec4 vec4)
public final double dotSelf3()
public final double dotSelf4()
public final boolean equals(java.lang.Object obj)
equals in class java.lang.Object
public static Vec4 fromArray2(double[] array,
int offset)
x and y values from the specified double array. The
specified offset must be 0 or greater, and the array must have capacity equal to or greater than offset +
2. Coordinates are assigned as follows:x = array[offset]y = array[offset +
1]
array - the double array from which to read coordinate data.offset - the array starting index.
x and y coordinate values from the specified double array.
java.lang.IllegalArgumentException - if the array is null, if offset is negative, or if the array's capacity is less
than offset + 2.
public static Vec4 fromArray3(double[] array,
int offset)
x, y and z values from the specified double
array. The specified offset must be 0 or greater, and the array must have capacity equal to or greater than
offset + 3. Coordinates are assigned as follows:x = array[offset]y =
array[offset + 1]z = array[offset + 2]
array - the double array from which to read coordinate data.offset - the array starting index.
x, y and z coordinate values from the specified
double array.
java.lang.IllegalArgumentException - if the array is null, if offset is negative, or if the array's capacity is less
than offset + 3.
public static Vec4 fromArray4(double[] array,
int offset)
x, y, z and w values from the
specified double array. The specified offset must be 0 or greater, and the array must have capacity equal to or
greater than offset + 4. Coordinates are assigned as follows:x =
array[offset]y = array[offset + 1]z = array[offset + 2]w =
array[offset + 3]
array - the double array from which to read coordinate data.offset - the array starting index.
x, y, z and w coordinate values from
the specified double array.
java.lang.IllegalArgumentException - if the array is null, if offset is negative, or if the array's capacity is less
than offset + 4.
public static Vec4 fromDoubleArray(double[] array,
int offset,
int length)
offset + length. Coordinates are assigned as follows:x = array[offset]
y
= array[offset + 1] if length > 1, otherwise y=0z = array[offset +
2] if length > 2, otherwise z=0w = array[offset + 3] if
length > 3, otherwise w=1
array - the double array from which to read coordinate data.offset - the array starting index.length - the number of coordinates to read.
java.lang.IllegalArgumentException - if the array is null, if offset is negative, if length is less than 1, or if the
array's capacity is less than offset + length.
public static Vec4 fromFloatArray(float[] array,
int offset,
int length)
offset + length. Coordinates are assigned as follows:x = array[offset]
y
= array[offset + 1] if length > 1, otherwise y=0z = array[offset +
2] if length > 2, otherwise z=0w = array[offset + 3] if
length > 3, otherwise w=1
array - the float array from which to read coordinate data.offset - the array starting index.length - the number of coordinates to read.
java.lang.IllegalArgumentException - if the array is null, if offset is negative, if length is less than 1, or if the
array's capacity is less than offset + length.
public static Vec4 fromLine3(Vec4 origin,
double t,
Vec4 direction)
public final Vec4 getAbs3()
public static double getAverageDistance(java.lang.Iterable<? extends Vec4> points)
public final double getLength3()
public final double getLengthSquared3()
public final Vec4 getNegative3()
public final double getW()
public final double getX()
public final double getY()
public final double getZ()
public final int hashCode()
hashCode in class java.lang.Object
public static Vec4 max3(Vec4 value1,
Vec4 value2)
public static Vec4 min3(Vec4 value1,
Vec4 value2)
public static Vec4 mix3(double amount,
Vec4 value1,
Vec4 value2)
public final Vec4 multiply3(double value)
public final Vec4 multiply3(Vec4 vec4)
public final Vec4 normalize3()
public final Vec4 perpendicularTo3(Vec4 vec4)
public final Vec4 projectOnto3(Vec4 vec4)
public final Vec4 subtract3(Vec4 vec4)
public final double[] toArray2(double[] array,
int offset)
x and y values to the specified double array. The specified offset
must be 0 or greater, and the array must have have capacity equal to or greater than offset + 2.
Coordinates are written to the array as follows:array[offset] = xarray[offset + 1] =
y
array - the double array to receive the coordinate data.offset - the array starting index.
java.lang.IllegalArgumentException - if the array is null, if offset is negative, or if the array's capacity is less
than offset + 2.
public final double[] toArray3(double[] array,
int offset)
x, y and z values to the specified double array. The
specified offset must be 0 or greater, and the array must have have capacity equal to or greater than
offset + 3. Coordinates are written to the array as follows:array[offset] =
xarray[offset + 1] = yarray[offset + 2] = z
array - the double array to receive the coordinate data.offset - the array starting index.
java.lang.IllegalArgumentException - if the array is null, if offset is negative, or if the array's capacity is less
than offset + 3.
public final double[] toArray4(double[] array,
int offset)
x, y, z and w values to the specified
double array. The specified offset must be 0 or greater, and the array must have have capacity equal to or
greater than offset + 4. Coordinates are written to the array as follows:array[offset] =
xarray[offset + 1] = yarray[offset + 2] = zarray[offset +
3] = w
array - the double array to receive the coordinate data.offset - the array starting index.
java.lang.IllegalArgumentException - if the array is null, if offset is negative, or if the array's capacity is less
than offset + 4.
public final double[] toDoubleArray(double[] array,
int offset,
int length)
offset
+ length. Coordinates are written to the array as follows:array[offset] =
xarray[offset + 1] = y if length > 1, otherwise array[offset +
1] is not written to
array[offset + 2] = z if length > 2, otherwise
array[offset + 2] is not written toarray[offset + 3] = w if length >
3, otherwise array[offset + 3] is not written to
array - the double array to receive the coordinate data.offset - the array starting index.length - the number of coordinates to write.
java.lang.IllegalArgumentException - if the array is null, if offset is negative, if length is less than 1, or if the
array's capacity is less than offset + length.
public final float[] toFloatArray(float[] array,
int offset,
int length)
offset +
length. Coordinates are written to the array as follows:array[offset] =
xarray[offset + 1] = y if length > 1, otherwise array[offset +
1] is not written to
array[offset + 2] = z if length > 2, otherwise
array[offset + 2] is not written toarray[offset + 3] = w if length >
3, otherwise array[offset + 3] is not written to
array - the float array to receive the coordinate data.offset - the array starting index.length - the number of coordinates to write.
java.lang.IllegalArgumentException - if the array is null, if offset is negative, if length is less than 1, or if the
array's capacity is less than offset + length.public final java.lang.String toString()
toString in class java.lang.Objectpublic final Vec4 transformBy3(Matrix matrix)
public final Vec4 transformBy3(Quaternion quaternion)
public final Vec4 transformBy4(Matrix matrix)
public final double w()
public final double x()
public final double y()
public final double z()
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||