isMat
이 페이지에서

isMat()

함수, 타입 분류

Narrows a ShaderType to the { kind: 'mat' } arm.

import { isMat } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

const isMat: (t: ShaderType) => t is Extract<ShaderType, { kind: "mat"; }>

매개변수

t ShaderType

반환값

t is Extract<ShaderType, { kind: 'mat' }>

설명

Narrows a ShaderType to the { kind: 'mat' } arm. It matches both elem: 'f32' (native matNxN<f32>) and elem: 'f64' (emulated, emitted as a struct of double-double columns); use isMat64 when the distinction matters. Binary-op type resolution checks it before a matrix-vector or matrix-matrix product.

예제

예제

import { isMat, mat4x4fT, mat2f64T } from 'typeshade'
isMat(mat4x4fT) // true
isMat(mat2f64T) // also true; use isMat64 to tell them apart

함께 보기

소스

src/core/ir/types.ts, 1106행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고