world

package
v0.0.0-...-8cfed74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type World

type World struct {
	Objects []shape.Shape
	Light   *light.Light
}

World is a collection of objects and a light source

func Default

func Default() World

Default returns a default World object

func (*World) ColorAt

func (w *World) ColorAt(r ray.Ray) color.Color

ColorAt returns the color of an intersection

func (*World) Intersect

func (w *World) Intersect(r ray.Ray) []shape.Intersection

Intersect returns the intersections of a collection of objects with a ray

func (*World) IsShadowed

func (w *World) IsShadowed(p tuple.Tuple) bool

IsShadowed determines if a point is shadowed in a world

func (*World) ReflectedColor

func (w *World) ReflectedColor(c *shape.Computation) color.Color

ReflectedColor determines the reflected color for a precomputation

func (*World) ShadeHit

func (w *World) ShadeHit(c shape.Computation) color.Color

ShadeHit returns the shade of a hit

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL