vec4
On this page

vec4

Type

A four-component vector of f32.

The signature and the sentence under each name are the compiler's own text at commit 26de7be8.

Syntax

interface vec4 {
readonly [vecTag]: readonly ['f32', 4]
[index: number]: f32
x: f32
y: f32
z: f32
w: f32
r: f32
g: f32
b: f32
a: f32
…
}

The … line stands for 672 more members, the swizzles. A swizzle reads two to four components as a new vector of the same element type. The components come in any order and may repeat, and their letters come from one set, xyzw or rgba.

Examples

See also

Edit this page Report a problem