@gltf-transform/functions
Version:
Functions for common glTF modifications, written using the core API
25 lines (24 loc) • 832 B
TypeScript
import { mat4, Primitive } from '@gltf-transform/core';
/**
* Applies a transform matrix to a {@link Primitive}.
*
* All vertex attributes on the Primitive and its
* {@link PrimitiveTarget PrimitiveTargets} are modified in place. If vertex
* streams are shared with other Primitives, and overwriting the shared vertex
* attributes is not desired, use {@link compactPrimitive} to pre-process
* the Primitive or call {@link transformMesh} instead.
*
* Example:
*
* ```javascript
* import { fromTranslation } from 'gl-matrix/mat4';
* import { transformPrimitive } from '@gltf-transform/functions';
*
* // offset vertices, y += 10.
* transformPrimitive(prim, fromTranslation([], [0, 10, 0]));
* ```
*
* @param prim
* @param matrix
*/
export declare function transformPrimitive(prim: Primitive, matrix: mat4): void;