trace

package
v0.0.0-...-1e8ba1f Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2016 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidSizeError    = errors.New("invalid size")
	Uint28OverflowError = errors.New("uint28 overflow")
)

Functions

func Reconstruct

func Reconstruct(a, b image.Image, out draw.Image) error

func TreeWidthToDepth

func TreeWidthToDepth(width int) int

Types

type Camera

type Camera interface {
	Position() Vec3
	LookAt() Vec3
	Up() Vec3
}

type Config

type Config struct {
	FieldOfView  float32
	TreeScale    float32
	TreePosition Vec3

	ViewDist      float32
	FrameSeed     int
	Jitter, Depth bool
	MultiThreaded bool
	Images        [2]*image.RGBA
}

type FreeFlightCamera

type FreeFlightCamera struct {
	Pos        Vec3
	XRot, YRot float32
}

func (*FreeFlightCamera) Forward

func (c *FreeFlightCamera) Forward() Vec3

func (*FreeFlightCamera) Lift

func (c *FreeFlightCamera) Lift(dist float32)

func (*FreeFlightCamera) LookAt

func (c *FreeFlightCamera) LookAt() Vec3

func (*FreeFlightCamera) Move

func (c *FreeFlightCamera) Move(dist float32)

func (*FreeFlightCamera) Position

func (c *FreeFlightCamera) Position() Vec3

func (*FreeFlightCamera) Right

func (c *FreeFlightCamera) Right() Vec3

func (*FreeFlightCamera) Strafe

func (c *FreeFlightCamera) Strafe(dist float32)

func (*FreeFlightCamera) Up

func (c *FreeFlightCamera) Up() Vec3

type LookAtCamera

type LookAtCamera struct {
	Pos  Vec3
	Look Vec3
}

func (*LookAtCamera) LookAt

func (c *LookAtCamera) LookAt() Vec3

func (*LookAtCamera) Position

func (c *LookAtCamera) Position() Vec3

func (*LookAtCamera) Up

func (c *LookAtCamera) Up() Vec3

type Octree

type Octree []octreeNode

func LoadOctree

func LoadOctree(reader io.Reader) (Octree, int, error)

type Raytracer

type Raytracer struct {
	// contains filtered or unexported fields
}

func NewRaytracer

func NewRaytracer(cfg Config) *Raytracer

func (*Raytracer) ClearDepth

func (rt *Raytracer) ClearDepth(frame int)

func (*Raytracer) Close

func (rt *Raytracer) Close()

func (*Raytracer) Depth

func (rt *Raytracer) Depth(frame int) *image.Gray16

func (*Raytracer) Frame

func (rt *Raytracer) Frame() int

func (*Raytracer) Image

func (rt *Raytracer) Image(frame int) *image.RGBA

func (*Raytracer) SetClearColor

func (rt *Raytracer) SetClearColor(c color.RGBA)

func (*Raytracer) Trace

func (rt *Raytracer) Trace(camera Camera, tree Octree, maxDepth int) int

type Vec3

type Vec3 [3]float32

Jump to

Keyboard shortcuts

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