vec2
Type
A two-component vector of f32.
The signature, the sentence and any message are the compiler's own text at commit af54ddad5.
Syntax
interface vec2 { readonly [vecTag]: readonly ['f32', 2] [index: number]: f32 x: f32 y: f32 r: f32 g: f32 …}The … line stands for 56 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
path/uv-gradient/uv-gradient.shade.tspath/moving-wave/moving-wave.shade.tspath/sdf-shapes/sdf-shapes.shade.tspath/tile-pattern/tile-pattern.shade.tspath/fractal/fractal.shade.tspath/palette/palette.shade.tspath/bouncing-balls/bouncing-balls.shade.tspath/ray-tracer/ray-tracer.shade.tsgallery/capsule-corp-namek-class/capsule-corp-namek-class.shade.tsgallery/domain-warp-twin/domain-warp-twin.shade.tsgallery/hillshade-twin/hillshade-twin.shade.tsgallery/julia-twin/julia-twin.shade.tsgallery/kaleidoscope-twin/kaleidoscope-twin.shade.tsgallery/mandelbrot-twin/mandelbrot-twin.shade.tsgallery/ocean-twin/ocean-twin.shade.tsgallery/path-tracer/path-tracer.shade.tsgallery/plasma-twin/plasma-twin.shade.tsgallery/rt-renderer-class/rt-renderer-class.shade.tsgallery/starfield-twin/starfield-twin.shade.tsgallery/tunnel-twin/tunnel-twin.shade.tsgallery/voronoi-twin/voronoi-twin.shade.tsgallery/fp64-burning-ship-twin/fp64-burning-ship-twin.shade.tsgallery/fp64-cancellation-twin/fp64-cancellation-twin.shade.tsgallery/fp64-checker-plane-twin/fp64-checker-plane-twin.shade.tsgallery/fp64-clock-twin/fp64-clock-twin.shade.tsgallery/fp64-deep-zoom-twin/fp64-deep-zoom-twin.shade.tsgallery/fp64-julia-twin/fp64-julia-twin.shade.tsgallery/fp64-lane-stripes/fp64-lane-stripes.shade.tsgallery/fp64-loran-twin/fp64-loran-twin.shade.tsgallery/fp64-mandelbrot-de-twin/fp64-mandelbrot-de-twin.shade.tsgallery/fp64-newton-twin/fp64-newton-twin.shade.tsgallery/fp64-rtc-twin/fp64-rtc-twin.shade.tsgallery/fp64-sine-sweep-twin/fp64-sine-sweep-twin.shade.tsgallery/array-literal-ramp/array-literal-ramp.shade.tsgallery/array-methods/array-methods.shade.tsgallery/bare-position/bare-position.shade.tsgallery/bit-bump/bit-bump.shade.tsgallery/bitfield-bands/bitfield-bands.shade.tsgallery/block-scope/block-scope.shade.tsgallery/bool-select/bool-select.shade.tsgallery/class-builder/class-builder.shade.tsgallery/class-parts/class-parts.shade.tsgallery/class-syntax/class-syntax.shade.tsgallery/clip-planes/clip-planes.shade.tsgallery/closures/closures.shade.tsgallery/convert-grid/convert-grid.shade.tsgallery/cube-array-gather/cube-array-gather.shade.tsgallery/cube-env/cube-env.shade.tsgallery/cutout/cutout.shade.tsgallery/default-args/default-args.shade.tsgallery/feedback-trail/feedback-trail.shade.tsgallery/generic-class/generic-class.shade.tsgallery/generic-helpers/generic-helpers.shade.tsgallery/gpu-console/gpu-console.shade.tsgallery/gradient-twin/gradient-twin.shade.tsgallery/hello-uniform-struct/hello-uniform-struct.shade.tsgallery/hello-vsin/hello-vsin.shade.tsgallery/hello-vsout/hello-vsout.shade.tsgallery/higher-order/higher-order.shade.tsgallery/id-pick/id-pick.shade.tsgallery/imported-noise/imported-noise.shade.tsgallery/inferred-returns/inferred-returns.shade.tsgallery/integer-math/integer-math.shade.tsgallery/loop-kernel/loop-kernel.shade.tsgallery/loop-reduction/loop-reduction.shade.tsgallery/loops-over-data/loops-over-data.shade.tsgallery/mixin-surface/mixin-surface.shade.tsgallery/module-const/module-const.shade.tsgallery/normal-matrix/normal-matrix.shade.tsgallery/null-values/null-values.shade.tsgallery/optional-fields/optional-fields.shade.tsgallery/optional-values/optional-values.shade.tsgallery/orbit-inout/orbit-inout.shade.tsgallery/packed-bytes/packed-bytes.shade.tsgallery/packing-bitcast/packing-bitcast.shade.tsgallery/palette-const/palette-const.shade.tsgallery/particle-step/particle-step.shade.tsgallery/pick-composite/pick-composite.shade.tsgallery/private-state/private-state.shade.tsgallery/ray-class/ray-class.shade.tsgallery/reference-parameters/reference-parameters.shade.tsgallery/rng-method/rng-method.shade.tsgallery/sample-branch/sample-branch.shade.tsgallery/separable-blur/separable-blur.shade.tsgallery/shadow-compare/shadow-compare.shade.tsgallery/shape-inheritance/shape-inheritance.shade.tsgallery/storage-texture/storage-texture.shade.tsgallery/textured-quad/textured-quad.shade.tsgallery/tuple-and-brand/tuple-and-brand.shade.tsgallery/twin-structs/twin-structs.shade.tsgallery/uniform-array/uniform-array.shade.ts