diff options
| author | James Barnett <noreply@jamesbarnett.xyz> | 2022-01-02 18:23:36 +0000 |
|---|---|---|
| committer | James Barnett <noreply@jamesbarnett.xyz> | 2022-01-02 18:23:36 +0000 |
| commit | e075667cd2dc878dd9dceb07c85719f6712bcda1 (patch) | |
| tree | 414e76418d92a39c59b1f5faf08289c0a729ddb4 /src/Geometry.ts | |
| parent | 7ad1b7efabea1349107669a432e6c88305f8d825 (diff) | |
| download | js-raytracer-e075667cd2dc878dd9dceb07c85719f6712bcda1.tar.xz js-raytracer-e075667cd2dc878dd9dceb07c85719f6712bcda1.zip | |
Implement multi-threaded rendering
Diffstat (limited to 'src/Geometry.ts')
| -rw-r--r-- | src/Geometry.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Geometry.ts b/src/Geometry.ts index 4fcc11b..9bef1a7 100644 --- a/src/Geometry.ts +++ b/src/Geometry.ts @@ -1,13 +1,21 @@ +import {Type} from 'class-transformer'; import {Colour} from './Colour'; import {Material} from './Material'; import {Vector} from './Vector'; export class Sphere { + @Type(() => Vector) + readonly centerPoint: Vector; + @Type(() => Material) + readonly material: Material; constructor( - readonly centerPoint: Vector, readonly radius: number, - readonly material: Material - ) {} + centerPoint: Vector, + material: Material + ) { + this.centerPoint = centerPoint; + this.material = material; + } } export class Plane { |