@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
113 lines • 3.16 kB
TypeScript
export class PathTracedScene {
/**
*
* @type {BVH}
*/
bvh_top_level: BVH;
/**
*
* @type {Map<number, PathTracedMesh>}
*/
meshes: Map<number, PathTracedMesh>;
/**
*
* @type {AbstractLight[]}
*/
__lights: AbstractLight[];
/**
*
* @type {Map<THREE.BufferGeometry, BufferedGeometryBVH>}
*/
geo_cache: Map<THREE.BufferGeometry, BufferedGeometryBVH>;
/**
*
* @type {function}
* @private
*/
private __background_sampler;
optimize(): void;
/**
*
* @param {THREE.BufferGeometry} geo
* @return {BufferedGeometryBVH}
*/
obtainGeometryBVH(geo: THREE.BufferGeometry): BufferedGeometryBVH;
/**
*
* @param {AbstractLight} light
*/
addLight(light: AbstractLight): void;
/**
*
* @param {PathTracedMesh} mesh
* @returns {boolean}
*/
hasMesh(mesh: PathTracedMesh): boolean;
/**
*
* @param {PathTracedMesh} mesh
* @returns {boolean}
*/
addMesh(mesh: PathTracedMesh): boolean;
/**
*
* @param {PathTracedMesh} mesh
* @returns {boolean}
*/
removeMesh(mesh: PathTracedMesh): boolean;
/**
* Retrieves pre-cached material or build one from scratch, caches it and returns the result
* @param {THREE.Material} material
* @returns {StandardMaterial}
*/
obtainMaterial(material: THREE.Material): StandardMaterial;
/**
*
* @param {THREE.BufferGeometry} geometry
* @param {THREE.Material} material
* @param {mat4|number[]} transform
*/
createMesh(geometry: THREE.BufferGeometry, material: THREE.Material, transform: mat4 | number[]): void;
/**
*
* @param {number[]} out [color_r, color_g, color_b, normal_x, normal_y, normal_z]
* @param {number[]} hit
* @param {Ray3} incoming_ray
*/
sample_material(out: number[], hit: number[], incoming_ray: Ray3): void;
/**
* Tests ray for occlusion
* @param {Ray3} ray
* @returns {boolean}
*/
occluded(ray: Ray3): boolean;
/**
*
* @param {number[]} out
* @param {number[]|Ray3} ray
* @return {number} distance to contact, or -1 if no contact found
*/
trace(out: number[], ray: number[] | Ray3): number;
/**
*
* @param {number[]} out
* @param {number} out_offset
* @param {number[]} direction
* @param {number} direction_offset
*/
sample_background(out: number[], out_offset: number, direction: number[], direction_offset: number): void;
/**
*
* @param {number[]} out
* @param {number} out_offset
* @param {number[]} ray
*/
sample_lights(out: number[], out_offset: number, ray: number[]): void;
#private;
}
import { BVH } from "../../../../core/bvh2/bvh3/BVH.js";
import { PathTracedMesh } from "./PathTracedMesh.js";
import { AbstractLight } from "../../render/forward_plus/model/AbstractLight.js";
import { BufferedGeometryBVH } from "./BufferedGeometryBVH.js";
import { Ray3 } from "../../../../core/geom/3d/ray/Ray3.js";
//# sourceMappingURL=PathTracedScene.d.ts.map