java.lang.Object
javax.vecmath.Tuple3f
javax.vecmath.Vector3f
- All Implemented Interfaces:
Serializable
,Cloneable
A 3 element vector that is represented by single precision floating point
x,y,z coordinates. If this value represents a normal, then it should be
normalized.
- Version:
- specification 1.1, implementation $Revision: 1.9 $, $Date: 1999/10/05 07:03:50 $
- Author:
- Kenji hiranabe
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionVector3f()
Constructs and initializes a Vector3f to (0,0,0).Vector3f
(float[] v) Constructs and initializes a Vector3f from the specified array of length 3.Vector3f
(float x, float y, float z) Constructs and initializes a Vector3f from the specified xyz coordinates.Constructs and initializes a Vector3f from the specified Tuple3d.Constructs and initializes a Vector3f from the specified Tuple3f.Constructs and initializes a Vector3f from the specified Vector3d.Constructs and initializes a Vector3f from the specified Vector3f. -
Method Summary
Modifier and TypeMethodDescriptionfinal float
Returns the angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].clone()
final void
Sets this vector to be the vector cross product of vectors v1 and v2.final float
Computes the dot product of the this vector and vector v1.final float
length()
Returns the length of this vector.final float
Returns the squared length of this vector.final void
Normalizes this vector in place.final void
Sets the value of this vector to the normalization of vector v1.Methods inherited from class javax.vecmath.Tuple3f
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, epsilonEquals, equals, equals, get, get, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, sub, sub, toString
-
Constructor Details
-
Vector3f
public Vector3f(float x, float y, float z) Constructs and initializes a Vector3f from the specified xyz coordinates.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinate
-
Vector3f
public Vector3f(float[] v) Constructs and initializes a Vector3f from the specified array of length 3.- Parameters:
v
- the array of length 3 containing xyz in order
-
Vector3f
Constructs and initializes a Vector3f from the specified Vector3f.- Parameters:
v1
- the Vector3f containing the initialization x y z data
-
Vector3f
Constructs and initializes a Vector3f from the specified Vector3d.- Parameters:
v1
- the Vector3d containing the initialization x y z data
-
Vector3f
Constructs and initializes a Vector3f from the specified Tuple3d.- Parameters:
t1
- the Tuple3d containing the initialization x y z data
-
Vector3f
Constructs and initializes a Vector3f from the specified Tuple3f.- Parameters:
t1
- the Tuple3f containing the initialization x y z data
-
Vector3f
public Vector3f()Constructs and initializes a Vector3f to (0,0,0).
-
-
Method Details
-
lengthSquared
public final float lengthSquared()Returns the squared length of this vector.- Returns:
- the squared length of this vector
-
length
public final float length()Returns the length of this vector.- Returns:
- the length of this vector
-
cross
Sets this vector to be the vector cross product of vectors v1 and v2.- Parameters:
v1
- the first vectorv2
- the second vector
-
dot
Computes the dot product of the this vector and vector v1.- Parameters:
v1
- the other vector
-
normalize
Sets the value of this vector to the normalization of vector v1.- Parameters:
v1
- the un-normalized vector
-
normalize
public final void normalize()Normalizes this vector in place. -
angle
Returns the angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].- Parameters:
v1
- the other vector- Returns:
- the angle in radians in the range [0,PI]
-
clone
-