abstract class Hitable
- Hitable
- Reference
- Object
Overview
Superclass for any kind of 'object' we would want to calculate an intersection with.
Direct Known Subclasses
Defined in:
hitable.crhitables/hitable_list.cr
hitables/rect.cr
hitables/triangle.cr
Instance Method Summary
-
#area : Float64
TODO This only makes sense for finite objects
- #area_light : Light?
- #area_light=(area_light : Light?)
- #hit(ray : Ray) : HitRecord?
-
#pdf(point : Point, wi : Vector) : Float64
Probability density function of rays Probability that a ray(point, wi) hits the object
-
#pdf(point : Point) : Float64
Probability density function of points on the object.
-
#rotate(axis : Vector, degrees : Float64) : Hitable
Return a new hitable rotated around
axis
bydegrees
-
#rotate_x(degrees : Float64) : Hitable
Shorthand for
#rotate(Vector.x, degrees)
-
#rotate_y(degrees : Float64) : Hitable
Shorthand for
#rotate(Vector.y, degrees)
-
#rotate_z(degrees : Float64) : Hitable
Shorthand for
#rotate(Vector.z, degrees)
-
#sample(origin) : ::Tuple(Point, Normal)
Get a random point and its normal somewhere on the object with respect to some origin point.
-
#sample : ::Tuple(Point, Normal)
Get a random point and its normal somewhere on the object
-
#scale(size : Float64) : Hitable
Return a new hitable scaled by some factor
-
#translate(offset : Vector) : Hitable
Return a new hitable translated (moved) by some offset
Instance Method Detail
Probability density function of rays Probability that a ray(point, wi) hits the object
Probability density function of points on the object.
NOTE For now this is always 1.0 / area
Return a new hitable rotated
around axis
by degrees
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()
Get a random point and its normal somewhere on the object
Return a new hitable translated (moved) by some offset
TODO Chaining two transformations of the same kind is not possible right now