import ComponentBase from "../component-base/index.js"; import { ValueOf } from "ts-essentials"; import Accessor from "../accessor/index.js"; import Indexer from "../asset/indexer/index.js"; import Material from "../material/index.js"; /** * Rendering modes for a primitive. All values correspond to WebGL enum values. * @alias Modes * @enum {number} * @memberof Primitive * @static */ declare const modes: { readonly POINTS: 0; readonly LINES: 1; readonly LINE_LOOP: 2; readonly LINE_STRIP: 3; readonly TRIANGLES: 4; readonly TRIANGLE_STRIP: 5; readonly TRIANGLE_FAN: 6; }; type RenderingMode = ValueOf; /** * A builder for the GLTF Primitive object * @see {@link https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-primitive | GLTF reference} * @hideconstructor */ export default class Primitive extends ComponentBase<{ mode: RenderingMode; attributes: { POSITION?: Accessor; NORMAL?: Accessor; TANGENT?: Accessor; [texcoord: `TEXCOORD_${number}`]: Accessor; [texcoord: `COLOR_${number}`]: Accessor; [texcoord: `JOINTS_${number}`]: Accessor; [texcoord: `WEIGHTS_${number}`]: Accessor; }; indices: Accessor; material: Material; }> { colour: typeof this.color; static get Modes(): { readonly POINTS: 0; readonly LINES: 1; readonly LINE_LOOP: 2; readonly LINE_STRIP: 3; readonly TRIANGLES: 4; readonly TRIANGLE_STRIP: 5; readonly TRIANGLE_FAN: 6; }; constructor(); /** * Sets the mode for this primitive * * @param {Primitive.Modes} mode * @returns {Primitive} this */ mode(mode: RenderingMode): Primitive; position(position: Accessor): this; normal(normal: Accessor): this; tangent(tangent: Accessor): this; /** * Sets data for the TEXCOORD property on the primitive * * @param {Accessor} texcoord Accessor containing Vec2 data * @param {number} [index=0] The set index for this property, which gets applied in the form TEXCOORD_ * @returns {Primitive} this */ texcoord(texcoord: Accessor, index?: number): Primitive; /** * Sets data for the COLOR property on the primitive * * @param {Accessor} color Accessor containing Vec3 or Vec4 data * @param {number} [index=0] The set index for this property, which gets applied in the form COLOR_ * @returns {Primitive} this */ color(color: Accessor, index?: number): Primitive; /** * Sets data for the JOINTS property on the primitive * * @param {Accessor} joints Accessor containing Vec4 data * @param {number} [index=0] The set index for this property, which gets applied in the form JOINTS_ * @returns {Primitive} this */ joints(joints: Accessor, index?: number): Primitive; /** * Sets data for the WEIGHTS property on the primitive * * @param {Accessor} weights Accessor containing Vec4 data * @param {number} [index=0] The set index for this property, which gets applied in the form WEIGHTS_ * @returns {Primitive} this */ weights(weights: Accessor, index?: number): Primitive; /** * Sets the indices property on the primitive * * @param {Accessor} indices an accessor for UInt index data * * @returns {Primitive} this */ indices(indices: Accessor): Primitive; /** * Sets the material for this primitive * * @param {Material} material * * @returns {Primitive} this */ material(material: Material): Primitive; build(indexer: Indexer): object; } export {};