Something went wrong. Try again.
A ray tracer in Coalton
Something went wrong. Try again.
123456789101112131415161718192021222324(cl:defpackage #:ray/hittable (:use #:coalton #:coalton-prelude) (:local-nicknames (#:r #:ray/ray) (#:v #:ray/vec3) (#:m #:ray/material)) (:export #:Hittable #:HitRecord #:hit?))
(cl:in-package #:ray/hittable)
(cl:declaim (cl:optimize (cl:speed 3) (cl:safety 0) (cl:debug 0)))
(coalton-toplevel (define-struct HitRecord (point v:Vec3) (normal v:Vec3) (t F64) (front-face? Boolean) (material m:Material))
(define-class (Hittable :a) (hit? "Does a ray cast through a scene intersect this thing?" (:a * r:Ray * F64 * F64 -> Optional HitRecord))))