# abstract class Hitable

## Overview

Superclass for any kind of 'object' we would want to calculate an intersection with.

## Defined in:

hitable.cr
hitables/hitable_list.cr
hitables/rect.cr
hitables/triangle.cr

## Instance Method Detail

def area : Float64 #

TODO This only makes sense for finite objects

def area_light : Light? #

def area_light=(area_light : Light?) #

abstract def hit(ray : Ray) : HitRecord? #

def pdf(point : Point, wi : Vector) : Float64 #

Probability density function of rays Probability that a ray(point, wi) hits the object

def pdf(point : Point) : Float64 #

Probability density function of points on the object.

NOTE For now this is always `1.0 / area`

def rotate(axis : Vector, degrees : Float64) : Hitable #

Return a new hitable rotated around `axis` by `degrees`

def rotate_x(degrees : Float64) : Hitable #

Shorthand for `#rotate(Vector.x, degrees)`

def rotate_y(degrees : Float64) : Hitable #

Shorthand for `#rotate(Vector.y, degrees)`

def rotate_z(degrees : Float64) : Hitable #

Shorthand for `#rotate(Vector.z, degrees)`

def sample(origin) : ::Tuple(Point, Normal) #

Get a random point and its normal somewhere on the object with respect to some origin point. This way it is possible to sample only the visible hemisphere of a sphere etc.

NOTE For now this just points to `sample()`

def sample : ::Tuple(Point, Normal) #

Get a random point and its normal somewhere on the object

def scale(size : Float64) : Hitable #

Return a new hitable scaled by some factor

def translate(offset : Vector) : Hitable #

Return a new hitable translated (moved) by some offset

TODO Chaining two transformations of the same kind is not possible right now