Documentation
¶
Index ¶
- type BaseShape
- func (s *BaseShape) GetInvTransform() *matrix.Mat44
- func (s *BaseShape) GetMaterial() *material.Material
- func (s *BaseShape) GetTransform() *matrix.Mat44
- func (s *BaseShape) Intersect(r ray.Ray) Intersections
- func (s *BaseShape) NormalAt(p tuple.Tuple) tuple.Tuple
- func (s *BaseShape) SetTransform(transform matrix.Mat44)
- type Intersection
- type Intersections
- type Plane
- type PreparedComps
- type Shape
- type Sphere
- type World
- func (w *World) AddLight(l light.PointLight)
- func (w *World) AddObject(obj Shape)
- func (w *World) ColorAt(r ray.Ray, remaining int) color.Color
- func (w *World) Intersect(r ray.Ray) Intersections
- func (w *World) IsShadowed(point tuple.Tuple, l light.PointLight) bool
- func (w *World) ReflectedColor(comps PreparedComps, remaining int) color.Color
- func (w *World) RefractedColor(comps PreparedComps, remaining int) color.Color
- func (w *World) ShadeHit(comps PreparedComps, remaining int) color.Color
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseShape ¶
type BaseShape struct {
Shape
Material material.Material
// contains filtered or unexported fields
}
func (*BaseShape) GetInvTransform ¶
func (*BaseShape) GetMaterial ¶
func (*BaseShape) GetTransform ¶
func (*BaseShape) SetTransform ¶
type Intersection ¶
func NewIntersection ¶
func NewIntersection(T float64, Object Shape) Intersection
func (Intersection) Equal ¶
func (x1 Intersection) Equal(x2 Intersection) bool
func (Intersection) PrepareComputations ¶
func (x Intersection) PrepareComputations(r ray.Ray, xs Intersections) PreparedComps
type Intersections ¶
type Intersections []Intersection
func (Intersections) Hit ¶
func (xs Intersections) Hit() *Intersection
func (Intersections) Sort ¶
func (xs Intersections) Sort()
type PreparedComps ¶
type PreparedComps struct {
T float64
Object Shape
Point tuple.Tuple
OverPoint tuple.Tuple
UnderPoint tuple.Tuple
EyeV tuple.Tuple
NormalV tuple.Tuple
ReflectV tuple.Tuple
Inside bool
N1 float64 // Refractive index of exiting material
N2 float64 // Refractive index of entering material
}
func (*PreparedComps) Schlick ¶
func (comps *PreparedComps) Schlick() float64
type World ¶
type World struct {
Objects []Shape
Lights []light.PointLight
}
func NewDefaultWorld ¶
func NewDefaultWorld() World
func (*World) AddLight ¶
func (w *World) AddLight(l light.PointLight)
func (*World) IsShadowed ¶
func (*World) ReflectedColor ¶
func (w *World) ReflectedColor(comps PreparedComps, remaining int) color.Color
func (*World) RefractedColor ¶
func (w *World) RefractedColor(comps PreparedComps, remaining int) color.Color
Click to show internal directories.
Click to hide internal directories.