gfxlite 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -0
  3. package/dist/gfxlite.es.js +6081 -0
  4. package/dist/gfxlite.umd.js +1455 -0
  5. package/dist/types/core/camera/Camera.d.ts +13 -0
  6. package/dist/types/core/camera/OrthographicCamera.d.ts +11 -0
  7. package/dist/types/core/camera/PerspectiveCamera.d.ts +9 -0
  8. package/dist/types/core/controls/OrbitControls.d.ts +84 -0
  9. package/dist/types/core/environment/Environment.d.ts +25 -0
  10. package/dist/types/core/environment/EnvironmentManager.d.ts +44 -0
  11. package/dist/types/core/geometry/BoxGeometry.d.ts +13 -0
  12. package/dist/types/core/geometry/CircleGeometry.d.ts +11 -0
  13. package/dist/types/core/geometry/ConeGeometry.d.ts +17 -0
  14. package/dist/types/core/geometry/CylinderGeometry.d.ts +19 -0
  15. package/dist/types/core/geometry/Geometry.d.ts +27 -0
  16. package/dist/types/core/geometry/PlaneGeometry.d.ts +15 -0
  17. package/dist/types/core/geometry/SphereGeometry.d.ts +13 -0
  18. package/dist/types/core/geometry/TorusGeometry.d.ts +15 -0
  19. package/dist/types/core/light/DirectionalLight.d.ts +19 -0
  20. package/dist/types/core/light/Light.d.ts +7 -0
  21. package/dist/types/core/material/BasicMaterial.d.ts +20 -0
  22. package/dist/types/core/material/LambertMaterial.d.ts +20 -0
  23. package/dist/types/core/material/Material.d.ts +34 -0
  24. package/dist/types/core/material/PhongMaterial.d.ts +22 -0
  25. package/dist/types/core/material/StandardMaterial.d.ts +42 -0
  26. package/dist/types/core/material/Texture.d.ts +24 -0
  27. package/dist/types/core/material/TextureManager.d.ts +18 -0
  28. package/dist/types/core/object/Mesh.d.ts +8 -0
  29. package/dist/types/core/object/Object3D.d.ts +35 -0
  30. package/dist/types/core/renderer/BatchManager.d.ts +82 -0
  31. package/dist/types/core/renderer/CullingComputePhase.d.ts +13 -0
  32. package/dist/types/core/renderer/DepthPrePhase.d.ts +17 -0
  33. package/dist/types/core/renderer/LightingManager.d.ts +20 -0
  34. package/dist/types/core/renderer/MainRenderPhase.d.ts +62 -0
  35. package/dist/types/core/renderer/Program.d.ts +25 -0
  36. package/dist/types/core/renderer/RenderPhase.d.ts +10 -0
  37. package/dist/types/core/renderer/Renderer.d.ts +61 -0
  38. package/dist/types/core/renderer/ShadowRenderPhase.d.ts +32 -0
  39. package/dist/types/core/renderer/SkyboxRenderPhase.d.ts +26 -0
  40. package/dist/types/core/scene/Scene.d.ts +16 -0
  41. package/dist/types/index.d.ts +28 -0
  42. package/dist/types/loaders/GLTFInterfaces.d.ts +144 -0
  43. package/dist/types/loaders/GLTFLoader.d.ts +30 -0
  44. package/dist/types/math/Box3.d.ts +21 -0
  45. package/dist/types/math/Euler.d.ts +12 -0
  46. package/dist/types/math/Matrix3.d.ts +20 -0
  47. package/dist/types/math/Matrix4.d.ts +31 -0
  48. package/dist/types/math/Quaternion.d.ts +22 -0
  49. package/dist/types/math/Utils.d.ts +3 -0
  50. package/dist/types/math/Vector2.d.ts +16 -0
  51. package/dist/types/math/Vector3.d.ts +32 -0
  52. package/dist/types/math/index.d.ts +10 -0
  53. package/package.json +53 -0
@@ -0,0 +1,13 @@
1
+ import { Matrix4 } from '../../math';
2
+ import { Object3D } from '../object/Object3D';
3
+ export declare class Camera extends Object3D {
4
+ projectionMatrix: Matrix4;
5
+ viewMatrix: Matrix4;
6
+ viewProjectionMatrix: Matrix4;
7
+ frustumPlanes: Float32Array;
8
+ updateWorldMatrix(parentWorldMatrix?: Matrix4): void;
9
+ updateProjectionMatrix(): void;
10
+ private updateViewProjectionMatrix;
11
+ private extractFrustumPlanes;
12
+ private normalizePlane;
13
+ }
@@ -0,0 +1,11 @@
1
+ import { Camera } from './Camera';
2
+ export declare class OrthographicCamera extends Camera {
3
+ left: number;
4
+ right: number;
5
+ top: number;
6
+ bottom: number;
7
+ near: number;
8
+ far: number;
9
+ constructor(left?: number, right?: number, top?: number, bottom?: number, near?: number, far?: number);
10
+ updateProjectionMatrix(): void;
11
+ }
@@ -0,0 +1,9 @@
1
+ import { Camera } from './Camera';
2
+ export declare class PerspectiveCamera extends Camera {
3
+ fov: number;
4
+ aspect: number;
5
+ near: number;
6
+ far: number;
7
+ constructor(fov?: number, aspect?: number, near?: number, far?: number);
8
+ updateProjectionMatrix(): void;
9
+ }
@@ -0,0 +1,84 @@
1
+ import { Vector3 } from '../../math';
2
+ import { Camera } from '../camera/Camera';
3
+ export interface OrbitControlsOptions {
4
+ /** Enable/disable controls */
5
+ enabled?: boolean;
6
+ /** Target point to orbit around */
7
+ target?: Vector3;
8
+ /** Minimum distance from target */
9
+ minDistance?: number;
10
+ /** Maximum distance from target */
11
+ maxDistance?: number;
12
+ /** Minimum polar angle (radians, 0 = top) */
13
+ minPolarAngle?: number;
14
+ /** Maximum polar angle (radians, PI = bottom) */
15
+ maxPolarAngle?: number;
16
+ /** Enable damping (inertia) */
17
+ enableDamping?: boolean;
18
+ /** Damping factor (0-1, lower = more damping) */
19
+ dampingFactor?: number;
20
+ /** Rotation speed multiplier */
21
+ rotateSpeed?: number;
22
+ /** Pan speed multiplier */
23
+ panSpeed?: number;
24
+ /** Zoom speed multiplier */
25
+ zoomSpeed?: number;
26
+ /** Enable panning */
27
+ enablePan?: boolean;
28
+ /** Enable zooming */
29
+ enableZoom?: boolean;
30
+ }
31
+ export declare class OrbitControls {
32
+ enabled: boolean;
33
+ target: Vector3;
34
+ minDistance: number;
35
+ maxDistance: number;
36
+ minPolarAngle: number;
37
+ maxPolarAngle: number;
38
+ enableDamping: boolean;
39
+ dampingFactor: number;
40
+ rotateSpeed: number;
41
+ panSpeed: number;
42
+ zoomSpeed: number;
43
+ enablePan: boolean;
44
+ enableZoom: boolean;
45
+ private camera;
46
+ private domElement;
47
+ private spherical;
48
+ private sphericalDelta;
49
+ private panOffset;
50
+ private scale;
51
+ private isPointerDown;
52
+ private pointerStart;
53
+ private pointerType;
54
+ private touches;
55
+ private lastPinchDistance;
56
+ private onPointerDownBound;
57
+ private onPointerMoveBound;
58
+ private onPointerUpBound;
59
+ private onWheelBound;
60
+ private onContextMenuBound;
61
+ constructor(camera: Camera, domElement: HTMLElement, options?: OrbitControlsOptions);
62
+ private updateSphericalFromCamera;
63
+ private onPointerDown;
64
+ private onPointerMove;
65
+ private onPointerUp;
66
+ private onWheel;
67
+ private pan;
68
+ /**
69
+ * Update camera position. Call this every frame.
70
+ */
71
+ update(): void;
72
+ /**
73
+ * Set the target point to orbit around.
74
+ */
75
+ setTarget(x: number, y: number, z: number): void;
76
+ /**
77
+ * Reset the camera to look at target from current position.
78
+ */
79
+ reset(): void;
80
+ /**
81
+ * Remove event listeners and clean up.
82
+ */
83
+ dispose(): void;
84
+ }
@@ -0,0 +1,25 @@
1
+ export interface EnvironmentOptions {
2
+ resolution?: number;
3
+ specularMipLevels?: number;
4
+ intensity?: number;
5
+ }
6
+ export declare class Environment {
7
+ readonly id: number;
8
+ needsUpdate: boolean;
9
+ hdrData: Float32Array | null;
10
+ hdrWidth: number;
11
+ hdrHeight: number;
12
+ resolution: number;
13
+ specularMipLevels: number;
14
+ intensity: number;
15
+ equirectTexture: GPUTexture | null;
16
+ cubemap: GPUTexture | null;
17
+ cubemapView: GPUTextureView | null;
18
+ irradianceMap: GPUTexture | null;
19
+ irradianceMapView: GPUTextureView | null;
20
+ prefilteredMap: GPUTexture | null;
21
+ prefilteredMapView: GPUTextureView | null;
22
+ constructor(options?: EnvironmentOptions);
23
+ static loadHDR(url: string, options?: EnvironmentOptions): Promise<Environment>;
24
+ dispose(): void;
25
+ }
@@ -0,0 +1,44 @@
1
+ import { Environment } from './Environment';
2
+ export declare class EnvironmentManager {
3
+ private device;
4
+ private equirectToCubemapPipeline;
5
+ private irradiancePipeline;
6
+ private prefilterPipeline;
7
+ private brdfPipeline;
8
+ private equirectBindGroupLayout;
9
+ private irradianceBindGroupLayout;
10
+ private prefilterBindGroupLayout;
11
+ private brdfBindGroupLayout;
12
+ private environmentBindGroupLayout;
13
+ private brdfLUT;
14
+ brdfLUTView: GPUTextureView | null;
15
+ private brdfGenerated;
16
+ dummyCubemapView: GPUTextureView | null;
17
+ cubemapSampler: GPUSampler | null;
18
+ brdfSampler: GPUSampler | null;
19
+ private envParamsBuffer;
20
+ private environmentBindGroupCache;
21
+ private dummyEnvironmentBindGroup;
22
+ constructor(device: GPUDevice);
23
+ private createPipelines;
24
+ private createEquirectToCubemapPipeline;
25
+ private createIrradiancePipeline;
26
+ private createPrefilterPipeline;
27
+ private createBRDFPipeline;
28
+ private createDummyResources;
29
+ private createEnvironmentBindGroupLayout;
30
+ private generateBRDFLUT;
31
+ processEnvironment(environment: Environment): void;
32
+ private convertEquirectToCubemap;
33
+ private generateCubemapMipmaps;
34
+ private generateIrradianceMap;
35
+ private generatePrefilteredMap;
36
+ getEnvironmentBindGroupLayout(): GPUBindGroupLayout;
37
+ getEnvironmentBindGroup(environment: Environment | null): GPUBindGroup;
38
+ getSkyboxResources(environment: Environment | null): {
39
+ cubemapView: GPUTextureView;
40
+ sampler: GPUSampler;
41
+ intensity: number;
42
+ };
43
+ dispose(): void;
44
+ }
@@ -0,0 +1,13 @@
1
+ import { Geometry } from '../geometry/Geometry';
2
+ export declare class BoxGeometry extends Geometry {
3
+ width: number;
4
+ height: number;
5
+ depth: number;
6
+ constructor({ width, height, depth }?: {
7
+ width?: number | undefined;
8
+ height?: number | undefined;
9
+ depth?: number | undefined;
10
+ });
11
+ invalidate(): void;
12
+ private static build;
13
+ }
@@ -0,0 +1,11 @@
1
+ import { Geometry } from '../geometry/Geometry';
2
+ export declare class CircleGeometry extends Geometry {
3
+ radius: number;
4
+ segments: number;
5
+ constructor({ radius, segments }?: {
6
+ radius?: number | undefined;
7
+ segments?: number | undefined;
8
+ });
9
+ invalidate(): void;
10
+ private static build;
11
+ }
@@ -0,0 +1,17 @@
1
+ import { Geometry } from '../geometry/Geometry';
2
+ export declare class ConeGeometry extends Geometry {
3
+ radius: number;
4
+ height: number;
5
+ radialSegments: number;
6
+ heightSegments: number;
7
+ openEnded: boolean;
8
+ constructor({ radius, height, radialSegments, heightSegments, openEnded, }?: {
9
+ radius?: number | undefined;
10
+ height?: number | undefined;
11
+ radialSegments?: number | undefined;
12
+ heightSegments?: number | undefined;
13
+ openEnded?: boolean | undefined;
14
+ });
15
+ invalidate(): void;
16
+ private static build;
17
+ }
@@ -0,0 +1,19 @@
1
+ import { Geometry } from '../geometry/Geometry';
2
+ export declare class CylinderGeometry extends Geometry {
3
+ radiusTop: number;
4
+ radiusBottom: number;
5
+ height: number;
6
+ radialSegments: number;
7
+ heightSegments: number;
8
+ openEnded: boolean;
9
+ constructor({ radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, }?: {
10
+ radiusTop?: number | undefined;
11
+ radiusBottom?: number | undefined;
12
+ height?: number | undefined;
13
+ radialSegments?: number | undefined;
14
+ heightSegments?: number | undefined;
15
+ openEnded?: boolean | undefined;
16
+ });
17
+ invalidate(): void;
18
+ private static build;
19
+ }
@@ -0,0 +1,27 @@
1
+ import { Box3 } from '../../math/Box3';
2
+ export declare class Geometry {
3
+ readonly id: number;
4
+ vertices: Float32Array;
5
+ normals: Float32Array | null;
6
+ uvs: Float32Array | null;
7
+ tangents: Float32Array | null;
8
+ indices: Uint32Array | null;
9
+ indexCount: number;
10
+ boundingBox: Box3 | null;
11
+ /**
12
+ * Version counter that increments when the geometry is invalidated.
13
+ * Used by BatchManager to detect when GPU buffers need re-uploading.
14
+ */
15
+ version: number;
16
+ constructor(vertices: Float32Array, indices?: Uint32Array, normals?: Float32Array, uvs?: Float32Array, tangents?: Float32Array);
17
+ computeBoundingBox(): void;
18
+ /**
19
+ * Called after modifying geometry parameters. Subclasses should override
20
+ * this to rebuild vertex data, then call super.invalidate().
21
+ */
22
+ invalidate(): void;
23
+ /**
24
+ * Helper for subclasses to update geometry data and trigger invalidation.
25
+ */
26
+ protected setBuffers(vertices: Float32Array, indices: Uint32Array, normals: Float32Array, uvs: Float32Array): void;
27
+ }
@@ -0,0 +1,15 @@
1
+ import { Geometry } from '../geometry/Geometry';
2
+ export declare class PlaneGeometry extends Geometry {
3
+ width: number;
4
+ height: number;
5
+ widthSegments: number;
6
+ heightSegments: number;
7
+ constructor({ width, height, widthSegments, heightSegments, }?: {
8
+ width?: number | undefined;
9
+ height?: number | undefined;
10
+ widthSegments?: number | undefined;
11
+ heightSegments?: number | undefined;
12
+ });
13
+ invalidate(): void;
14
+ private static build;
15
+ }
@@ -0,0 +1,13 @@
1
+ import { Geometry } from '../geometry/Geometry';
2
+ export declare class SphereGeometry extends Geometry {
3
+ radius: number;
4
+ widthSegments: number;
5
+ heightSegments: number;
6
+ constructor({ radius, widthSegments, heightSegments }?: {
7
+ radius?: number | undefined;
8
+ widthSegments?: number | undefined;
9
+ heightSegments?: number | undefined;
10
+ });
11
+ invalidate(): void;
12
+ private static build;
13
+ }
@@ -0,0 +1,15 @@
1
+ import { Geometry } from '../geometry/Geometry';
2
+ export declare class TorusGeometry extends Geometry {
3
+ radius: number;
4
+ tube: number;
5
+ radialSegments: number;
6
+ tubularSegments: number;
7
+ constructor({ radius, tube, radialSegments, tubularSegments, }?: {
8
+ radius?: number | undefined;
9
+ tube?: number | undefined;
10
+ radialSegments?: number | undefined;
11
+ tubularSegments?: number | undefined;
12
+ });
13
+ invalidate(): void;
14
+ private static build;
15
+ }
@@ -0,0 +1,19 @@
1
+ import { Light } from './Light';
2
+ import { Vector3 } from '../../math';
3
+ import { OrthographicCamera } from '../camera/OrthographicCamera';
4
+ export declare class DirectionalLight extends Light {
5
+ constructor(color?: Vector3, intensity?: number);
6
+ get direction(): Vector3;
7
+ shadow: {
8
+ camera: OrthographicCamera;
9
+ mapSize: {
10
+ width: number;
11
+ height: number;
12
+ };
13
+ bias: number;
14
+ map: GPUTexture | undefined;
15
+ view: GPUTextureView | undefined;
16
+ sampler: GPUSampler | undefined;
17
+ autoUpdate: boolean;
18
+ };
19
+ }
@@ -0,0 +1,7 @@
1
+ import { Object3D } from '../object/Object3D';
2
+ import { Vector3 } from '../../math';
3
+ export declare class Light extends Object3D {
4
+ color: Vector3;
5
+ intensity: number;
6
+ constructor(color?: Vector3, intensity?: number);
7
+ }
@@ -0,0 +1,20 @@
1
+ import { Vector3 } from '../../math';
2
+ import { Material } from './Material';
3
+ import { Texture } from './Texture';
4
+ export interface BasicMaterialOptions {
5
+ color?: Vector3;
6
+ opacity?: number;
7
+ transparent?: boolean;
8
+ map?: Texture;
9
+ }
10
+ export declare class BasicMaterial extends Material {
11
+ readonly materialType: 0;
12
+ readonly needsLighting = false;
13
+ readonly needsNormals = false;
14
+ map: Texture | null;
15
+ constructor({ color, opacity, transparent, map, }?: BasicMaterialOptions);
16
+ hasTextures(): boolean;
17
+ getUniformBufferData(): Float32Array;
18
+ getVertexShader(): string;
19
+ getFragmentShader(): string;
20
+ }
@@ -0,0 +1,20 @@
1
+ import { Vector3 } from '../../math';
2
+ import { Material } from './Material';
3
+ import { Texture } from './Texture';
4
+ export interface LambertMaterialOptions {
5
+ color?: Vector3;
6
+ opacity?: number;
7
+ transparent?: boolean;
8
+ map?: Texture;
9
+ }
10
+ export declare class LambertMaterial extends Material {
11
+ readonly materialType: 1;
12
+ readonly needsLighting = true;
13
+ readonly needsNormals = true;
14
+ map: Texture | null;
15
+ constructor({ color, opacity, transparent, map, }?: LambertMaterialOptions);
16
+ hasTextures(): boolean;
17
+ getUniformBufferData(): Float32Array;
18
+ getVertexShader(): string;
19
+ getFragmentShader(): string;
20
+ }
@@ -0,0 +1,34 @@
1
+ export declare const BlendMode: {
2
+ readonly Opaque: 0;
3
+ readonly AlphaBlend: 1;
4
+ readonly AlphaCutoff: 2;
5
+ };
6
+ export type BlendMode = (typeof BlendMode)[keyof typeof BlendMode];
7
+ export declare const MaterialType: {
8
+ readonly Basic: 0;
9
+ readonly Lambert: 1;
10
+ readonly Phong: 2;
11
+ readonly Standard: 3;
12
+ };
13
+ export type MaterialType = (typeof MaterialType)[keyof typeof MaterialType];
14
+ export declare abstract class Material {
15
+ readonly id: number;
16
+ needsUpdate: boolean;
17
+ uniforms: {
18
+ [key: string]: unknown;
19
+ };
20
+ transparent: boolean;
21
+ opacity: number;
22
+ blendMode: BlendMode;
23
+ alphaCutoff: number;
24
+ depthWrite: boolean;
25
+ doubleSided: boolean;
26
+ abstract readonly materialType: MaterialType;
27
+ abstract readonly needsLighting: boolean;
28
+ abstract readonly needsNormals: boolean;
29
+ abstract getUniformBufferData(): Float32Array;
30
+ abstract getVertexShader(): string;
31
+ abstract getFragmentShader(): string;
32
+ hasTextures(): boolean;
33
+ getPipelineKey(): string;
34
+ }
@@ -0,0 +1,22 @@
1
+ import { Vector3 } from '../../math';
2
+ import { Material } from './Material';
3
+ import { Texture } from './Texture';
4
+ export interface PhongMaterialOptions {
5
+ color?: Vector3;
6
+ specular?: Vector3;
7
+ shininess?: number;
8
+ opacity?: number;
9
+ transparent?: boolean;
10
+ map?: Texture;
11
+ }
12
+ export declare class PhongMaterial extends Material {
13
+ readonly materialType: 2;
14
+ readonly needsLighting = true;
15
+ readonly needsNormals = true;
16
+ map: Texture | null;
17
+ constructor({ color, specular, shininess, opacity, transparent, map, }?: PhongMaterialOptions);
18
+ hasTextures(): boolean;
19
+ getUniformBufferData(): Float32Array;
20
+ getVertexShader(): string;
21
+ getFragmentShader(): string;
22
+ }
@@ -0,0 +1,42 @@
1
+ import { Vector3 } from '../../math';
2
+ import { Material, BlendMode } from './Material';
3
+ import { Texture } from './Texture';
4
+ import { Environment } from '../environment/Environment';
5
+ export interface StandardMaterialOptions {
6
+ baseColor?: Vector3;
7
+ opacity?: number;
8
+ metallic?: number;
9
+ roughness?: number;
10
+ emissive?: Vector3;
11
+ emissiveFactor?: number;
12
+ normalScale?: number;
13
+ occlusionStrength?: number;
14
+ baseColorMap?: Texture;
15
+ normalMap?: Texture;
16
+ metallicRoughnessMap?: Texture;
17
+ emissiveMap?: Texture;
18
+ aoMap?: Texture;
19
+ transparent?: boolean;
20
+ blendMode?: BlendMode;
21
+ alphaCutoff?: number;
22
+ doubleSided?: boolean;
23
+ envMap?: Environment;
24
+ envMapIntensity?: number;
25
+ }
26
+ export declare class StandardMaterial extends Material {
27
+ readonly materialType: 3;
28
+ readonly needsLighting = true;
29
+ readonly needsNormals = true;
30
+ baseColorMap: Texture | null;
31
+ normalMap: Texture | null;
32
+ metallicRoughnessMap: Texture | null;
33
+ emissiveMap: Texture | null;
34
+ aoMap: Texture | null;
35
+ envMap: Environment | null;
36
+ envMapIntensity: number;
37
+ constructor(options?: StandardMaterialOptions);
38
+ hasTextures(): boolean;
39
+ getUniformBufferData(): Float32Array;
40
+ getVertexShader(): string;
41
+ getFragmentShader(): string;
42
+ }
@@ -0,0 +1,24 @@
1
+ export interface TextureOptions {
2
+ wrapS?: GPUAddressMode;
3
+ wrapT?: GPUAddressMode;
4
+ minFilter?: GPUFilterMode;
5
+ magFilter?: GPUFilterMode;
6
+ mipmaps?: boolean;
7
+ flipY?: boolean;
8
+ }
9
+ export declare class Texture {
10
+ readonly id: number;
11
+ source: ImageBitmap | null;
12
+ needsUpdate: boolean;
13
+ wrapS: GPUAddressMode;
14
+ wrapT: GPUAddressMode;
15
+ minFilter: GPUFilterMode;
16
+ magFilter: GPUFilterMode;
17
+ mipmaps: boolean;
18
+ flipY: boolean;
19
+ gpuTexture: GPUTexture | null;
20
+ gpuTextureView: GPUTextureView | null;
21
+ constructor(source?: ImageBitmap, options?: TextureOptions);
22
+ static load(url: string, options?: TextureOptions): Promise<Texture>;
23
+ dispose(): void;
24
+ }
@@ -0,0 +1,18 @@
1
+ import { Texture } from './Texture';
2
+ export declare class TextureManager {
3
+ private device;
4
+ private samplerCache;
5
+ dummyWhiteTexture: GPUTextureView;
6
+ dummyNormalTexture: GPUTextureView;
7
+ dummyBlackTexture: GPUTextureView;
8
+ defaultSampler: GPUSampler;
9
+ private mipmapPipeline;
10
+ private mipmapBindGroupLayout;
11
+ constructor(device: GPUDevice);
12
+ private createDummyTextures;
13
+ private createMipmapPipeline;
14
+ uploadTexture(texture: Texture): GPUTextureView;
15
+ private generateMipmaps;
16
+ getSampler(texture: Texture): GPUSampler;
17
+ dispose(): void;
18
+ }
@@ -0,0 +1,8 @@
1
+ import { Geometry } from '../geometry/Geometry';
2
+ import { Material } from '../material/Material';
3
+ import { Object3D } from '../object/Object3D';
4
+ export declare class Mesh extends Object3D {
5
+ geometry: Geometry;
6
+ material: Material;
7
+ constructor(geometry: Geometry, material: Material);
8
+ }
@@ -0,0 +1,35 @@
1
+ import { Matrix4, Quaternion, Vector3 } from '../../math';
2
+ export declare class Object3D {
3
+ readonly id: number;
4
+ name: string;
5
+ parent: Object3D | null;
6
+ children: Object3D[];
7
+ position: Vector3;
8
+ rotation: Quaternion;
9
+ scale: Vector3;
10
+ castShadow: boolean;
11
+ receiveShadow: boolean;
12
+ localMatrix: Matrix4;
13
+ worldMatrix: Matrix4;
14
+ lookAt(target: Vector3): void;
15
+ add(child: Object3D): void;
16
+ remove(child: Object3D): void;
17
+ rotateOnAxis(axis: Vector3, angle: number): this;
18
+ rotateX(angle: number): this;
19
+ rotateY(angle: number): this;
20
+ rotateZ(angle: number): this;
21
+ /**
22
+ * Updates the object's local matrix from its position, rotation, and scale.
23
+ */
24
+ updateLocalMatrix(): void;
25
+ /**
26
+ * Updates the object's world matrix, and recursively updates all children.
27
+ * @param parentWorldMatrix The world matrix of the parent object.
28
+ */
29
+ updateWorldMatrix(parentWorldMatrix?: Matrix4): void;
30
+ /**
31
+ * Traverses the object and its descendants.
32
+ * @param callback The function to call for each object.
33
+ */
34
+ traverse(callback: (object: Object3D) => void): void;
35
+ }