blob: 3629f5a5e79f452e597683bb1ec8e36e42fe59f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
import {Type} from 'class-transformer';
import {Plane, Sphere} from './Geometry';
import {Light} from './Light';
export class RaytraceContext {
@Type(() => Sphere)
readonly spheres: Sphere[];
@Type(() => Plane)
readonly planes: Plane[];
@Type(() => Light)
readonly lights: Light[];
constructor(
readonly height: number,
readonly width: number,
readonly fov: number,
spheres: Sphere[],
planes: Plane[],
lights: Light[],
readonly options: RaytracerOptions
) {
this.spheres = spheres;
this.planes = planes;
this.lights = lights;
}
}
export interface RaytracerOptions {
numThreads: number;
shadows: boolean;
diffuseLighting: boolean;
specularLighting: boolean;
reflections: boolean;
maxRecurseDepth: number;
maxDrawDistance: number;
}
|