public class Vector3d
extends javax.vecmath.Vector3d
| Modifier and Type | Field and Description |
|---|---|
static Vector3d |
UNITY
The Constant UNITY.
|
static Vector3d |
X_ONE
The Constant X_ONE.
|
static Vector3d |
Y_ONE
The Constant Y_ONE.
|
static Vector3d |
Z_ONE
The Constant Z_ONE.
|
static Vector3d |
ZERO
The Constant ZERO.
|
| Constructor and Description |
|---|
Vector3d(double x,
double y)
Creates a new vector with specified
x, y and
z = 0. |
Vector3d(double x,
double y,
double z)
Creates a new vector.
|
Vector3d(java.lang.Number x,
java.lang.Number y) |
Vector3d(java.lang.Number x,
java.lang.Number y,
java.lang.Number z) |
| Modifier and Type | Method and Description |
|---|---|
double |
angle(Vector3d v)
Returns the angle between this and the specified vector.
|
Vector3d |
clone() |
Vector3d |
cross(Vector3d a)
Returns the cross product of this vector and the specified vector.
|
Vector3d |
dividedBy(double a)
Returns this vector devided by the specified value.
|
double |
dot(Vector3d a)
Returns the dot product of this vector and the specified vector.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
Vector3d |
lerp(Vector3d a,
double t)
Linearly interpolates between this and the specified vector.
|
double |
magnitude()
Returns the magnitude of this vector.
|
Vector3d |
minus(Vector3d v)
Returns the difference of this vector and the specified vector.
|
Vector3d |
negated()
Returns a negated copy of this vector.
|
Vector3d |
normalized()
Returns a normalized copy of this vector with length
1. |
Vector3d |
orthogonal()
Creates a new vector which is orthogonal to this.
|
Vector3d |
plus(Vector3d v)
Returns the sum of this vector and the specified vector.
|
boolean |
test(java.lang.Object obj,
double epsilon) |
Vector3d |
times(double a)
Returns the product of this vector and the specified value.
|
Vector3d |
times(Vector3d a)
Returns the product of this vector and the specified vector.
|
java.lang.String |
toObjString()
Returns this vector in OBJ string format.
|
java.lang.StringBuilder |
toObjString(java.lang.StringBuilder sb)
Returns this vector in OBJ string format.
|
java.lang.String |
toStlString()
Returns this vector in STL string format.
|
java.lang.StringBuilder |
toStlString(java.lang.StringBuilder sb)
Returns this vector in STL string format.
|
java.lang.String |
toString() |
Vector3d |
transform(Transform transform)
Applies the specified transformation to this vector.
|
Vector3d |
transform(Transform transform,
double amount)
Applies the specified transformation to this vector.
|
Vector3d |
transformed(Transform transform)
Returns a transformed copy of this vector.
|
Vector3d |
transformed(Transform transform,
double amount)
Returns a transformed copy of this vector.
|
static Vector3d |
x(double x)
Creates a new vector with specified
x. |
static Vector3d |
xy(double x,
double y)
Creates a new vector with specified
x, y and
z = 0. |
static Vector3d |
xy(java.lang.Number x,
java.lang.Number y) |
static Vector3d |
xyz(double x,
double y,
double z)
Creates a new vector with specified
x, y and
z. |
static Vector3d |
xyz(java.lang.Number x,
java.lang.Number y,
java.lang.Number z) |
static Vector3d |
y(double y)
Creates a new vector with specified
y. |
static Vector3d |
z(double z)
Creates a new vector with specified
z. |
angle, cross, dot, length, lengthSquared, normalize, normalizeabsolute, absolute, add, add, clamp, clamp, clamp, clamp, clampMax, clampMax, clampMax, clampMax, clampMin, clampMin, clampMin, clampMin, epsilonEquals, equals, get, get, getX, getY, getZ, interpolate, interpolate, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, scaleAdd, set, set, set, set, setX, setY, setZ, sub, subpublic static final Vector3d ZERO
public static final Vector3d UNITY
public static final Vector3d X_ONE
public static final Vector3d Y_ONE
public static final Vector3d Z_ONE
public Vector3d(double x,
double y,
double z)
x - x valuey - y valuez - z valuepublic Vector3d(java.lang.Number x,
java.lang.Number y,
java.lang.Number z)
public Vector3d(double x,
double y)
x, y and
z = 0.x - x valuey - y valuepublic Vector3d(java.lang.Number x,
java.lang.Number y)
public static Vector3d xy(double x, double y)
x, y and
z = 0.x - x valuey - y valuepublic static Vector3d xy(java.lang.Number x, java.lang.Number y)
public static Vector3d xyz(double x, double y, double z)
x, y and
z.x - x valuey - y valuez - z valuepublic static Vector3d xyz(java.lang.Number x, java.lang.Number y, java.lang.Number z)
public Vector3d clone()
clone in class javax.vecmath.Tuple3dpublic Vector3d negated()
public Vector3d plus(Vector3d v)
v - the vector to add
Note: this vector is not modified.public Vector3d minus(Vector3d v)
v - the vector to subtract
Note: this vector is not modified.public Vector3d times(double a)
a - the value
Note: this vector is not modified.public Vector3d times(Vector3d a)
a - the vector
Note: this vector is not modified.public Vector3d dividedBy(double a)
a - the value
Note: this vector is not modified.public double dot(Vector3d a)
a - the second vectorpublic Vector3d lerp(Vector3d a, double t)
a - vectort - interpolation valuet = 0; copy of a if t = 1;
the point midway between this and the specified vector if t = 0.5public double magnitude()
public Vector3d normalized()
1.
Note: this vector is not modified.1public Vector3d cross(Vector3d a)
a - the vectorpublic java.lang.String toStlString()
public java.lang.StringBuilder toStlString(java.lang.StringBuilder sb)
sb - string builderpublic java.lang.String toObjString()
public java.lang.StringBuilder toObjString(java.lang.StringBuilder sb)
sb - string builderpublic Vector3d transform(Transform transform)
transform - the transform to applypublic Vector3d transformed(Transform transform)
transform - the transform to apply
Note: this vector is not modified.public Vector3d transform(Transform transform, double amount)
transform - the transform to applyamount - the amountpublic Vector3d transformed(Transform transform, double amount)
transform - the transform to apply
Note: this vector is not modified.amount - the amountpublic java.lang.String toString()
toString in class javax.vecmath.Tuple3dpublic boolean equals(java.lang.Object obj)
equals in class javax.vecmath.Tuple3dpublic boolean test(java.lang.Object obj,
double epsilon)
public double angle(Vector3d v)
v - vectorpublic int hashCode()
hashCode in class javax.vecmath.Tuple3dpublic static Vector3d x(double x)
x.x - x value[x,0,0]public static Vector3d y(double y)
y.y - y value[0,y,0]public static Vector3d z(double z)
z.z - z value[0,0,z]public Vector3d orthogonal()