Skip to content

Commit

Permalink
chore: update gltf loader types (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
pschroen committed Apr 9, 2024
1 parent 56cd35f commit 2635658
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions types/core/Geometry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export class Geometry {
isInstanced: boolean;
bounds: Bounds;

// Set from gltf loader
extras?: object;
extensions?: object;

raycast?: GeometryRaycast; // User defined

constructor(gl: OGLRenderingContext, attributes?: AttributeMap);
Expand Down
8 changes: 8 additions & 0 deletions types/core/Transform.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Euler } from '../math/Euler.js';
import type { Mat4 } from '../math/Mat4.js';
import type { Quat } from '../math/Quat.js';
import type { Vec3, Vec3Tuple } from '../math/Vec3.js';
import type { GLTFLoader } from '../extras/GLTFLoader.d.js';

/**
* The base class for most objects and provides a set of properties and methods for manipulating
Expand Down Expand Up @@ -76,6 +77,13 @@ export class Transform {
*/
up: Vec3;

/**
* Set from {@link GLTFLoader | GLTF Loader}.
*/
name?: string;
extras?: object;
extensions?: object;

/**
* Creates a new transform object.
*/
Expand Down
2 changes: 1 addition & 1 deletion types/extras/GLTFLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class GLTFLoader {
gl: OGLRenderingContext,
desc: GLTFDescription,
images: (HTMLImageElement | ImageBitmap)[],
options: { sample: any; source: any; name: any; extensions: any; extras: any },
options: { sample: number; source: number; name: string; extensions: object; extras: object },
): Texture;

static parseMaterials(gl: OGLRenderingContext, desc: GLTFDescription, textures: Texture[]): GLTFMaterial[] | null;
Expand Down

0 comments on commit 2635658

Please sign in to comment.