import { Vec3 } from '@quake2ts/shared'; import { VirtualFileSystem } from './vfs.js'; export interface Md2Header { readonly ident: number; readonly version: number; readonly skinWidth: number; readonly skinHeight: number; readonly frameSize: number; readonly numSkins: number; readonly numVertices: number; readonly numTexCoords: number; readonly numTriangles: number; readonly numGlCommands: number; readonly numFrames: number; readonly offsetSkins: number; readonly offsetTexCoords: number; readonly offsetTriangles: number; readonly offsetFrames: number; readonly offsetGlCommands: number; readonly offsetEnd: number; readonly magic: number; } export interface Md2Skin { readonly name: string; } export interface Md2TexCoord { readonly s: number; readonly t: number; } export interface Md2Triangle { readonly vertexIndices: [number, number, number]; readonly texCoordIndices: [number, number, number]; } export interface Md2Vertex { readonly position: Vec3; readonly normalIndex: number; readonly normal: Vec3; } export interface Md2Frame { readonly name: string; readonly vertices: readonly Md2Vertex[]; readonly minBounds: Vec3; readonly maxBounds: Vec3; } export interface Md2GlCommandVertex { readonly s: number; readonly t: number; readonly vertexIndex: number; } export interface Md2GlCommand { readonly mode: 'strip' | 'fan'; readonly vertices: readonly Md2GlCommandVertex[]; } export interface Md2Model { readonly header: Md2Header; readonly skins: readonly Md2Skin[]; readonly texCoords: readonly Md2TexCoord[]; readonly triangles: readonly Md2Triangle[]; readonly frames: readonly Md2Frame[]; readonly glCommands: readonly Md2GlCommand[]; /** * Multiple LOD versions of model (high, medium, low poly) */ readonly lods?: Md2Model[]; } export interface Md2Animation { readonly name: string; readonly firstFrame: number; readonly lastFrame: number; } export declare class Md2ParseError extends Error { } export declare class Md2Loader { private readonly vfs; private readonly cache; constructor(vfs: VirtualFileSystem); load(path: string): Promise; get(path: string): Md2Model | undefined; } export declare function parseMd2(buffer: ArrayBuffer): Md2Model; export declare function groupMd2Animations(frames: readonly Md2Frame[]): Md2Animation[]; //# sourceMappingURL=md2.d.ts.map