vec2()
함수, 내장 함수 분류
A vec2<f32> constructor, WGSL-style: vec2(x, y).
import { vec2 } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
const vec2: (...a: NodeLike[]) => Node<"vec2<f32>">매개변수
...aNodeLike[]
반환값
Node<'vec2<f32>'>
설명
A bare number component lifts to f32,
so vec2(pos.x, 0) emits an f32 zero with no f32() wrapper. construct is the
untyped primitive this and every other vector and struct constructor is built on.
예제
예제
import { vec2 } from 'typeshade'
const uv = vec2(0, 1) // Node<'vec2<f32>'>관련 가이드
함께 보기
소스
src/core/ir/node.ts, 2491행, 커밋 c66579bf 기준