Documentation ¶
Overview ¶
Package hitable implements the methods used to compute intersections between a ray and geometry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BVHNode ¶
type BVHNode struct {
// contains filtered or unexported fields
}
BVHNode represents a bounding volume hierarchy node.
func (*BVHNode) BoundingBox ¶
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
Box represents a box.
func (*Box) BoundingBox ¶
type ConstantMedium ¶
type ConstantMedium struct {
// contains filtered or unexported fields
}
ConstantMedium represents a medium with constant density.
func NewConstantMedium ¶
func NewConstantMedium(hitable Hitable, density float64, a texture.Texture) *ConstantMedium
NewConstantMedium returns a new instance of the constant medium hitable.
func (*ConstantMedium) BoundingBox ¶
type FlipNormals ¶
type FlipNormals struct {
// contains filtered or unexported fields
}
FlipNormals represents a hitable with the inverted normal.
func NewFlipNormals ¶
func NewFlipNormals(hitable Hitable) *FlipNormals
NewFlipNormals returns a hitable with inverted normals.
func (*FlipNormals) BoundingBox ¶
type Hitable ¶
type Hitable interface { Hit(r ray.Ray, tMin float64, tMax float64) (*hitrecord.HitRecord, material.Material, bool) BoundingBox(time0 float64, time1 float64) (*aabb.AABB, bool) }
Hitable defines the methods compute ray/geometry operations.
type HitableSlice ¶
type HitableSlice struct {
// contains filtered or unexported fields
}
HitableSlice represents a list of hitable entities.
func NewSlice ¶
func NewSlice(hitables []Hitable) *HitableSlice
NewSlice returns an instance of HitableSlice.
func (*HitableSlice) BoundingBox ¶
type RotateY ¶
type RotateY struct {
// contains filtered or unexported fields
}
RotateY represents a rotation along the Y axis.
func NewRotateY ¶
NewRotateY returns a new hitable rotated along the Y axis.
func (*RotateY) BoundingBox ¶
type Sphere ¶
type Sphere struct {
// contains filtered or unexported fields
}
Sphere represents a sphere in the 3d world.
func NewSphere ¶
func NewSphere(center0 *vec3.Vec3Impl, center1 *vec3.Vec3Impl, time0 float64, time1 float64, radius float64, material material.Material) *Sphere
NewSphere returns a new instance of Sphere.
func (*Sphere) BoundingBox ¶
type Translate ¶
type Translate struct {
// contains filtered or unexported fields
}
Translate represents a hitable with its associated translation.
func NewTranslate ¶
NewTranslate returns an instance of a translated hitable.
func (*Translate) BoundingBox ¶
type XYRect ¶
type XYRect struct {
// contains filtered or unexported fields
}
XYRect represents an axis aligned rectangle.
func NewXYRect ¶
func NewXYRect(x0 float64, x1 float64, y0 float64, y1 float64, k float64, mat material.Material) *XYRect
NewXYRect returns an instance of an axis aligned rectangle.
func (*XYRect) BoundingBox ¶
type XZRect ¶
type XZRect struct {
// contains filtered or unexported fields
}
XZRect represents an axis aligned rectangle.
func NewXZRect ¶
func NewXZRect(x0 float64, x1 float64, z0 float64, z1 float64, k float64, mat material.Material) *XZRect
NewXZRect returns an instance of an axis aligned rectangle.
func (*XZRect) BoundingBox ¶
type YZRect ¶
type YZRect struct {
// contains filtered or unexported fields
}
YZRect represents an axis aligned rectangle.
func NewYZRect ¶
func NewYZRect(y0 float64, y1 float64, z0 float64, z1 float64, k float64, mat material.Material) *YZRect
NewYZRect returns an instance of an axis aligned rectangle.