vector

Artık kullanılmayanları göster

This library implements functionality for the vector type in addition to the built-in primitive operator support. It uses vectors with three components (x, y, and z).

Individual vector components can be accessed using the fields x or X, y or Y, z or Z. Since vector values are immutable, writing to individual components is not supported.

Özet

İşlevler

Özellikler

  • Constant vector with all components set to 0.

  • Constant vector with all components set to 1.

İşlevler

create

Creates a new vector with the given component values.

Parametreler

Dönüşler

magnitude

Calculates the magnitude of a given vector.

Parametreler

vec: vector

Dönüşler

normalize

Computes the normalized version (unit vector) of a given vector.

Parametreler

vec: vector

Dönüşler

cross

Computes the cross product of two vectors.

Parametreler

vec1: vector
vec2: vector

Dönüşler

Computes the dot product of two vectors.

Parametreler

vec1: vector
vec2: vector

Dönüşler

angle

Computes the angle between two vectors in radians. The axis, if specified, is used to determine the sign of the angle.

Parametreler

vec1: vector
vec2: vector
axis: vector

Dönüşler

floor

Applies math.floor() to every component of the input vector.

Parametreler

vec: vector

Dönüşler

ceil

Applies math.ceil() to every component of the input vector.

Parametreler

vec: vector

Dönüşler

Applies math.abs() to every component of the input vector.

Parametreler

vec: vector

Dönüşler

sign

Applies math.sign() to every component of the input vector.

Parametreler

vec: vector

Dönüşler

clamp

Applies math.clamp() to every component of the input vector.

Parametreler

vec: vector
min: vector
max: vector

Dönüşler

Applies math.max() to the corresponding components of the input vectors.

Parametreler

...: vector

Dönüşler

Applies math.min() to the corresponding components of the input vectors.

Parametreler

...: vector

Dönüşler

Özellikler

zero

Constant vector with all components set to 0.

Constant vector with all components set to 1.