Struct vec4

4 component vector

Constructors

Name Description
this
this create with all components filled with specified value
this
this
this

Fields

Name Type Description
vec float[4]
w float
x float
y float
z float

Properties

Name Type Description
magnitude [get] float length of vector
magnitudeSquared [get] float sum of squares of all vector components
normalized [get] vec4 returns normalized copy of this vector
toString [get] string

Methods

Name Description
add add components of another vector to corresponding components of this vector
add add value to all components of vector
clear fill all components of vector with specified value
div divide all components of vector by value
div divide components of this vector by corresponding components of another vector
dot dot product (sum of by-component products of vector components)
mul multiply all components of vector by value
mul multiply components of this vector by corresponding components of another vector
normalize normalize vector: make its length == 1
opAssign
opAssign
opAssign
opAssign
opBinary divide all components of vector by value
opBinary subtract value from all components of vector
opBinary subtract value from all components of vector
opBinary add value to all components of vector
opBinary multiply all components of vector by value
opBinary add value to all components of vector
opBinary subtract value from all components of vector
opBinary multiply vector by matrix
opOpAssign add value to all components of vector
opOpAssign multiply all components of vector by value
opOpAssign subtract value from all components of vector
opOpAssign divide all components of vector by value
opOpAssign by component add values of corresponding components of other vector
opOpAssign by component multiply values of corresponding components of other vector
opOpAssign by component subtract values of corresponding components of other vector
opOpAssign by component divide values of corresponding components of other vector
opUnary returns vector with all components which are negative of components for this vector
sub subtract components of another vector from corresponding components of this vector
sub subtract value from all components of vector

Aliases

Name Description
a
b
g
length
r

Authors

Copyright

License