Top Description Fields Constructors Methods
javax.vecmath

public Class Vector4f

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

A 4-element vector represented by single-precision floating point x,y,z,w coordinates.

Field Summary

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

Constructor Summary

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

Constructs and initializes a Vector4f from the specified xyzw coordinates.

public
Vector4f(float[]
the array of length 4 containing xyzw in order
v
)

Constructs and initializes a Vector4f from the array of length 4.

public
Vector4f(Vector4f
the Vector4f containing the initialization x y z w data
v1
)

Constructs and initializes a Vector4f from the specified Vector4f.

public
Vector4f(Vector4d
the Vector4d containing the initialization x y z w data
v1
)

Constructs and initializes a Vector4f from the specified Vector4d.

public
Vector4f(Tuple4f
the Tuple4f containing the initialization x y z w data
t1
)

Constructs and initializes a Vector4f from the specified Tuple4f.

public
Vector4f(Tuple4d
the Tuple4d containing the initialization x y z w data
t1
)

Constructs and initializes a Vector4f from the specified Tuple4d.

public
Vector4f(Tuple3f
the tuple to be copied
t1
)

Constructs and initializes a Vector4f from the specified Tuple3f.

public
Vector4f()

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

Method Summary

Modifier and TypeMethod and Description
public final float

Returns:

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

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

public final float

Returns:

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

returns the dot product of this vector and v1

public final float

Returns:

the length of this vector as a float
length
()

Returns the length of this vector.

public final float

Returns:

the squared length of this vector as a float
lengthSquared
()

Returns the squared length of this vector

public final void
normalize(Vector4f
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.

public final void
set(Tuple3f
the tuple to be copied
t1
)

Sets the x,y,z components of this vector to the corresponding components of tuple t1.

Inherited from javax.vecmath.Tuple4f:
absoluteabsoluteaddaddclampclampclampMaxclampMaxclampMinclampMincloneepsilonEqualsequalsequalsgetgetgetWgetXgetYgetZhashCodeinterpolateinterpolatenegatenegatescalescalescaleAddscaleAddsetsetsetsetsetWsetXsetYsetZsubsubtoString

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.vecmath.Tuple4f.serialVersionUID.

Constructor Detail

Vector4fback to summary
public Vector4f(float x, float y, float z, float w)

Constructs and initializes a Vector4f from the specified xyzw coordinates.

Parameters
x:float

the x coordinate

y:float

the y coordinate

z:float

the z coordinate

w:float

the w coordinate

Vector4fback to summary
public Vector4f(float[] v)

Constructs and initializes a Vector4f from the array of length 4.

Parameters
v:float[]

the array of length 4 containing xyzw in order

Vector4fback to summary
public Vector4f(Vector4f v1)

Constructs and initializes a Vector4f from the specified Vector4f.

Parameters
v1:Vector4f

the Vector4f containing the initialization x y z w data

Vector4fback to summary
public Vector4f(Vector4d v1)

Constructs and initializes a Vector4f from the specified Vector4d.

Parameters
v1:Vector4d

the Vector4d containing the initialization x y z w data

Vector4fback to summary
public Vector4f(Tuple4f t1)

Constructs and initializes a Vector4f from the specified Tuple4f.

Parameters
t1:Tuple4f

the Tuple4f containing the initialization x y z w data

Vector4fback to summary
public Vector4f(Tuple4d t1)

Constructs and initializes a Vector4f from the specified Tuple4d.

Parameters
t1:Tuple4d

the Tuple4d containing the initialization x y z w data

Vector4fback to summary
public Vector4f(Tuple3f t1)

Constructs and initializes a Vector4f from the specified Tuple3f. The x,y,z components of this vector are set to the corresponding components of tuple t1. The w component of this vector is set to 0.

Parameters
t1:Tuple3f

the tuple to be copied

Since
vecmath 1.2
Vector4fback to summary
public Vector4f()

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

Method Detail

angleback to summary
public final float angle(Vector4f v1)

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

Parameters
v1:Vector4f

the other vector

Returns:float

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

dotback to summary
public final float dot(Vector4f v1)

returns the dot product of this vector and v1

Parameters
v1:Vector4f

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 as a float

lengthSquaredback to summary
public final float lengthSquared()

Returns the squared length of this vector

Returns:float

the squared length of this vector as a float

normalizeback to summary
public final void normalize(Vector4f v1)

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

Parameters
v1:Vector4f

the un-normalized vector

normalizeback to summary
public final void normalize()

Normalizes this vector in place.

setback to summary
public final void set(Tuple3f t1)

Sets the x,y,z components of this vector to the corresponding components of tuple t1. The w component of this vector is set to 0.

Parameters
t1:Tuple3f

the tuple to be copied

Since
vecmath 1.2