Vector library

From GiderosMobile
Revision as of 02:29, 1 February 2026 by MoKaLux (talk | contribs)

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform linux.png
Available since: Gideros 2026.1

Description

This library implements functionality for the vector type in addition to the built-in primitive operator support. Default configuration uses vectors with 3 components (x, y, and z). If the 4-wide mode is enabled by setting the LUA_VECTOR_SIZE VM configuration to 4, vectors get an additional w component.

Individual vector components can be accessed using the fields x or X, y or Y, z or Z, and w or W in 4-wide mode. Since vector values are immutable, writes to individual components are not supported.

Reference

https://luau.org/library/#vector-library

Methods

vector.zero constant vector with all components set to 0
vector.one constant vector with all components set to 1

Events

Constants