diff options
| author | James Barnett <noreply@jamesbarnett.xyz> | 2022-01-04 21:44:49 +0000 |
|---|---|---|
| committer | James Barnett <noreply@jamesbarnett.xyz> | 2022-01-04 21:44:49 +0000 |
| commit | 16b0f20415efd3ed2c181df74a473ebd5265892b (patch) | |
| tree | 2d94216df0dca5b378f74b47515af5b910fc5ae7 /src/RaytraceContext.ts | |
| parent | 496c63266d02bc9369e3406353b877a8ebbae60a (diff) | |
| download | js-raytracer-16b0f20415efd3ed2c181df74a473ebd5265892b.tar.xz js-raytracer-16b0f20415efd3ed2c181df74a473ebd5265892b.zip | |
Fix specular lighting. Update scene.
Diffstat (limited to 'src/RaytraceContext.ts')
| -rw-r--r-- | src/RaytraceContext.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/RaytraceContext.ts b/src/RaytraceContext.ts index f7c9315..acd4336 100644 --- a/src/RaytraceContext.ts +++ b/src/RaytraceContext.ts @@ -1,4 +1,5 @@ import {Type} from 'class-transformer'; +import {Colour} from './Colour'; import {Plane, Sphere} from './Geometry'; import {Light} from './Light'; @@ -9,6 +10,8 @@ export class RaytraceContext { readonly planes: Plane[]; @Type(() => Light) readonly lights: Light[]; + @Type(() => Colour) + readonly backgroundColour: Colour; constructor( readonly height: number, readonly width: number, @@ -16,11 +19,13 @@ export class RaytraceContext { spheres: Sphere[], planes: Plane[], lights: Light[], + backgroundColour: Colour, readonly options: RaytracerOptions ) { this.spheres = spheres; this.planes = planes; this.lights = lights; + this.backgroundColour = backgroundColour; } } |