Vector4

Vector4 class

A vector with four components.

Properties

NameDescription
xThe x component.
yThe y component.
zThe z component.
wThe w component.

Methods

constructor

NameDescription
constructor()

Result:


constructor_overload

NameDescription
constructor_overload(vec, w)Initializes a new instance of the Vector4 struct.

Parameters:

NameTypeDescription
vecVector3Vec.
wNumberThe width.

Result:


constructor_overload$2{#constructor_overload$2}

NameDescription
constructor_overload$2(vec)Initializes a new instance of the Vector4 struct.

Parameters:

NameTypeDescription
vecVector3Vec.

Result:


constructor_overload$3{#constructor_overload$3}

NameDescription
constructor_overload$3(vec)Initializes a new instance of the Vector4 struct.

Parameters:

NameTypeDescription
vecFVector4Vec.

Result:


constructor_overload$4{#constructor_overload$4}

NameDescription
constructor_overload$4(x, y, z)Initializes a new instance of the Vector4 struct.

Parameters:

NameTypeDescription
xNumberThe x coordinate.
yNumberThe y coordinate.
zNumberThe z coordinate.

Result:


constructor_overload$5{#constructor_overload$5}

NameDescription
constructor_overload$5(x, y, z, w)Initializes a new instance of the Vector4 struct.

Parameters:

NameTypeDescription
xNumberThe x coordinate.
yNumberThe y coordinate.
zNumberThe z coordinate.
wNumberThe width.

Result:


set

NameDescription
set(newX, newY, newZ)Sets vector’s xyz components at a time, w will be set to 1

Parameters:

NameTypeDescription
newXNumberNew X component.
newYNumberNew Y component.
newZNumberNew Z component.

Result:


equals

NameDescription
equals(obj)Check if two vectors are equal

Parameters:

NameTypeDescription
obObjectnull

Result: boolean


hashCode

NameDescription
hashCode()Gets the hash code of this vector

Result: Number


set

NameDescription
set(newX, newY, newZ, newW)Sets vector’s all components at a time

Parameters:

NameTypeDescription
newXNumberNew X component.
newYNumberNew Y component.
newZNumberNew Z component.
newWNumberNew W component.

Result: Number


toString

NameDescription
toString()Returns a java.lang.String that represents the current Vector4.

Result: String


compareTo

NameDescription
compareTo(other)Compare current vector to another instance.

Parameters:

NameTypeDescription
otheVector4null

Result: Number