Documentation
¶
Index ¶
- Constants
- func AvailableWorlds() []string
- func InCloseRange(a, b float64) bool
- type Box
- type Camera
- type RotateY
- type Vec
- func (v *Vec) AddSI(a float64) *Vec
- func (v *Vec) AddSM(a float64) *Vec
- func (v *Vec) AddVI(v2 *Vec) *Vec
- func (v *Vec) AddVM(v2 *Vec) *Vec
- func (v *Vec) Copy() *Vec
- func (v *Vec) CrossI(v2 *Vec) *Vec
- func (v *Vec) DivSM(a float64) *Vec
- func (v *Vec) Dot(v2 *Vec) float64
- func (v *Vec) Len() float64
- func (v *Vec) LenSQ() float64
- func (v *Vec) MulSI(a float64) *Vec
- func (v *Vec) MulSM(a float64) *Vec
- func (v *Vec) NegI() *Vec
- func (v *Vec) NegM() *Vec
- func (v *Vec) Normalize() *Vec
- func (v *Vec) NormalizeI() *Vec
- func (v *Vec) SubSI(a float64) *Vec
- func (v *Vec) SubSM(a float64) *Vec
- func (v *Vec) SubVI(v2 *Vec) *Vec
- func (v *Vec) SubVM(v2 *Vec) *Vec
- type World
Constants ¶
const EPSILON = 0.000000001
EPSILON constant for checking if two float numbers are the same
Variables ¶
This section is empty.
Functions ¶
func InCloseRange ¶
InCloseRange checks if two numbers are identical, for floating-point computations
Types ¶
type Camera ¶
type Camera struct { LowerLeftCorner *Vec Horizontal *Vec Vertical *Vec Origin *Vec U, V, W *Vec LensRadius float64 Time0, Time1 float64 }
Camera describes properties of virtual camera which be used as parameters for rendering process
type RotateY ¶
RotateY holds reference to original object along precomputed parameters for computing rotation
func NewRotateY ¶
NewRotateY returns object containing original object rotated by 'angle' over y axis at center of object's bounding box
type Vec ¶
type Vec [3]float64
Vec is a vector with implemented main math ops, both mutable and unmutable
func ComputeXY ¶
ComputeXY returns color at (X, Y) position of camera plane, computed ns times and averaged
func (*Vec) DivSM ¶
DivSM divides each dimmension by scalar in place, returns reference to original object
func (*Vec) MulSM ¶
MulSM multiplies vector by scalar in place, returns reference to original object
func (*Vec) NegM ¶
NegM multiplies each dimmension by -1 in place, returns reference to original object
func (*Vec) Normalize ¶
Normalize normalizes the vector in place, returns reference to original object
func (*Vec) NormalizeI ¶
NormalizeI normalizes vector, returns result in a new object
func (*Vec) SubSM ¶
SubSM subtracts scalar from each dimmension in place, returns reference to original object