vec3:mul

Multiplies the vector by a vector or a number.

v = vec3:mul(u)

Arguments

NameTypeDescription
uvec3The other vector to multiply the components by.

Returns

NameTypeDescription
vvec3The original vector.

v = vec3:mul(x)

Arguments

NameTypeDescription
xnumberThe number to multiply each component by.

Returns

NameTypeDescription
vvec3The original vector.

Notes

This function modifies v and sets the values to equal the multiplied values. When multiplying by a vector, the multiplication is component-wise, like this:

v.x, v.y, v.z = v.x * u.x, v.y * u.y, v.z * u.z

Multiplying by a number scales each component of the vector by that number:

v.x, v.y, v.z = v.x * x, v.y * x, v.z * x

See also