Top Description Fields Constructors Methods
javax.vecmath

public Class Vector3f

extends Tuple3f
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.lang.Math

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.

Field Summary

Modifier and TypeField and Description
pack-priv static final long
Inherited from javax.vecmath.Tuple3f:
xyz

Constructor Summary

AccessConstructor and Description
public
Vector3f(float
the x coordinate
x
,
float
the y coordinate
y
,
float
the z coordinate
z
)

Constructs and initializes a Vector3f from the specified xyz coordinates.

public
Vector3f(float[]
the array of length 3 containing xyz in order
v
)

Constructs and initializes a Vector3f from the array of length 3.

public
Vector3f(Vector3f
the Vector3f containing the initialization x y z data
v1
)

Constructs and initializes a Vector3f from the specified Vector3f.

public
Vector3f(Vector3d
the Vector3d containing the initialization x y z data
v1
)

Constructs and initializes a Vector3f from the specified Vector3d.

public
Vector3f(Tuple3f
the Tuple3f containing the initialization x y z data
t1
)

Constructs and initializes a Vector3f from the specified Tuple3f.

public
Vector3f(Tuple3d
the Tuple3d containing the initialization x y z data
t1
)

Constructs and initializes a Vector3f from the specified Tuple3d.

public
Vector3f()

Constructs and initializes a Vector3f to (0,0,0).

Method Summary

Modifier and TypeMethod and Description
public final float

Returns:

the angle in radians in the range [0,PI]
angle
(Vector3f
the other vector
v1
)

Returns the angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].

public final void
cross(Vector3f
the first vector
v1
,
Vector3f
the second vector
v2
)

Sets this vector to be the vector cross product of vectors v1 and v2.

public final float

Returns:

the dot product of this vector and v1
dot
(Vector3f
the other vector
v1
)

Computes the dot product of this vector and vector v1.

public final float

Returns:

the length of this vector
length
()

Returns the length of this vector.

public final float

Returns:

the squared length of this vector
lengthSquared
()

Returns the squared length of this vector.

public final void
normalize(Vector3f
the un-normalized vector
v1
)

Sets the value of this vector to the normalization of vector v1.

public final void
normalize()

Normalizes this vector in place.

Inherited from javax.vecmath.Tuple3f:
absoluteabsoluteaddaddclampclampclampMaxclampMaxclampMinclampMincloneepsilonEqualsequalsequalsgetgetgetXgetYgetZhashCodeinterpolateinterpolatenegatenegatescalescalescaleAddscaleAddsetsetsetsetsetXsetYsetZsubsubtoString

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.vecmath.Tuple3f.serialVersionUID.

Constructor Detail

Vector3fback to summary
public Vector3f(float x, float y, float z)

Constructs and initializes a Vector3f from the specified xyz coordinates.

Parameters
x:float

the x coordinate

y:float

the y coordinate

z:float

the z coordinate

Vector3fback to summary
public Vector3f(float[] v)

Constructs and initializes a Vector3f from the array of length 3.

Parameters
v:float[]

the array of length 3 containing xyz in order

Vector3fback to summary
public Vector3f(Vector3f v1)

Constructs and initializes a Vector3f from the specified Vector3f.

Parameters
v1:Vector3f

the Vector3f containing the initialization x y z data

Vector3fback to summary
public Vector3f(Vector3d v1)

Constructs and initializes a Vector3f from the specified Vector3d.

Parameters
v1:Vector3d

the Vector3d containing the initialization x y z data

Vector3fback to summary
public Vector3f(Tuple3f t1)

Constructs and initializes a Vector3f from the specified Tuple3f.

Parameters
t1:Tuple3f

the Tuple3f containing the initialization x y z data

Vector3fback to summary
public Vector3f(Tuple3d t1)

Constructs and initializes a Vector3f from the specified Tuple3d.

Parameters
t1:Tuple3d

the Tuple3d containing the initialization x y z data

Vector3fback to summary
public Vector3f()

Constructs and initializes a Vector3f to (0,0,0).

Method Detail

angleback to summary
public final float angle(Vector3f v1)

Returns the angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].

Parameters
v1:Vector3f

the other vector

Returns:float

the angle in radians in the range [0,PI]

crossback to summary
public final void cross(Vector3f v1, Vector3f v2)

Sets this vector to be the vector cross product of vectors v1 and v2.

Parameters
v1:Vector3f

the first vector

v2:Vector3f

the second vector

dotback to summary
public final float dot(Vector3f v1)

Computes the dot product of this vector and vector v1.

Parameters
v1:Vector3f

the other vector

Returns:float

the dot product of this vector and v1

lengthback to summary
public final float length()

Returns the length of this vector.

Returns:float

the length of this vector

lengthSquaredback to summary
public final float lengthSquared()

Returns the squared length of this vector.

Returns:float

the squared length of this vector

normalizeback to summary
public final void normalize(Vector3f v1)

Sets the value of this vector to the normalization of vector v1.

Parameters
v1:Vector3f

the un-normalized vector

normalizeback to summary
public final void normalize()

Normalizes this vector in place.