Vector4

From Wake
Jump to: navigation, search

Class: Vector4

Type: native

Can Construct: yes

Description

Provides a Vector4 class and mathematical functions.

Conversions

Almost all Vector4 functions accept either an instance of a Vector4 or a table of length 4 as shorthand.

Functions

 Description
Vector4.newConstructor.
Vector4:applyCreate a new vector by applying a function to each element of the current vector.
Vector4:distanceCalculate the distance between two vectors.
Vector4:dotCalculate the dot product between two vectors.
Vector4:getGet an element from a vector.
Vector4:lengthCalculate the length of a vector.
Vector4:normalizeCalculate the normalized form of a vector.
Vector4:reflectCalculate the reflection direction.
Vector4:refractCalculate the refraction vector.
Vector4:setSet the value of an element in a vector.
Vector4:setAllSet all values contained in a vector.
Vector4:tableGet the table representation of a vector.