aboutsummaryrefslogtreecommitdiff
path: root/src/RaytraceContext.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/RaytraceContext.ts')
-rw-r--r--src/RaytraceContext.ts35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/RaytraceContext.ts b/src/RaytraceContext.ts
new file mode 100644
index 0000000..3629f5a
--- /dev/null
+++ b/src/RaytraceContext.ts
@@ -0,0 +1,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;
+}