BBMOD_Vec3

constructor

new BBMOD_Vec3([_x[, _y, _z]])

Description

A 3D vector.

Arguments

Name Type Description
_x Real The first component of the vector. Defaults to 0.
_y Real/Undefined The second component of the vector. Defaults to _x.
_z Real/Undefined The third component of the vector. Defaults to _x.

Properties

Name Description
X The first component of the vector.
Y The second component of the vector.
Z The third component of the vector.

Methods

Name Description
Abs Creates a new vector where each component is equal to the absolute value of the original component.
Add Adds vectors and returns the result as a new vector.
Ceil Applies function ceil to each component of the vector and returns the result as a new vector.
Clamp Clamps each component of the vector between corresponding components of _min and _max and returns the result as a new vector.
ClampLength Clamps the length of the vector between _min and _max and returns the result as a new vector.
Clone Creates a clone of the vector.
Copy Copies components of the vector to the _dest vector.
Cross Computes a cross product of this vector and vector _v and returns the result as a new vector.
Dot Computes the dot product of this vector and vector _v.
Equals Checks whether this vectors equals to vector _v.
Floor Applies function floor to each component of the vector and returns the result as a new vector.
Frac Applies function frac to each component of the vector and returns the result as a new vector.
FromArray Loads vector components from an array.
FromBarycentric Computes the vector components using a formula _v1 + _f * (_v2 - _v1) + _g * (_v3 - _v1).
FromBuffer Loads vector components from a buffer.
Get Retrieves vector component at given index (0 is X, 1 is Y, etc.).
Length Computes the length of the vector.
LengthSqr Computes a squared length of the vector.
Lerp Linearly interpolates between vector _v by the given amount.
MaxComponent Computes the greatest component of the vector.
Maximize Creates a new vector where each component is the maximum component from this vector and vector _v.
MinComponent Computes the smallest component of the vector.
Minimize Creates a new vector where each component is the minimum component from this vector and vector _v.
Mul Multiplies the vector with vector _v and returns the result as a new vector.
Normalize Normalizes the vector and returns the result as a new vector.
Orthonormalize Orthonormalizes the vectors in-place using the Gram–Schmidt process.
Reflect Reflects the vector from vector _v and returns the result as a new vector.
Round Applies function round to each component of the vector and returns the result as a new vector.
Scale Scales each component of the vector by _s and returns the result as a new vector.
Set Sets vector components in-place.
SetIndex Sets vector component in-place.
Sub Subtracts vector _v from this vector and returns the result as a new vector.
ToArray Writes the components of the vector into the target array.
ToBuffer Writes the components of the vector into the buffer.
Transform Transforms vector (X, Y, Z, 1.0) by a matrix and returns the result as a new vector.

See also

BBMOD_Vec2, BBMOD_Vec4

Do you find this page helpful?

Copyright © 2022, BlueBurn. Built on May 18, 2022 using GMDoc.