ray

package
v0.0.0-...-3626a0a Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2015 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Epsilon is the smallest number not considered 0.
	Epsilon = 0.00001
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Counts

type Counts [NumTypes]int

Counts holds counts of each ray type

type Ray

type Ray struct {
	Origin mgl64.Vec3
	Dir    mgl64.Vec3
}

Ray is a 3D ray with an origin and a direction.

func (*Ray) At

func (r *Ray) At(t float64) mgl64.Vec3

At returns the point marked by the ray at t.

type Type

type Type int

Type identifies the type of ray.

const (
	// Unspecified is a ray with an unspecified ty.pe
	Unspecified Type = iota
	// Camera is a ray whose origin is the camera.
	Camera
	// Collision is a ray used to detect collision.
	Collision
	// Reflection is a ray generated from a reflection.
	Reflection
	// Refraction is a ray generated from a refraction.
	Refraction
	// Shadow is a ray toward a light source.
	Shadow
	// Illumination is a ray whose origin is a light source.
	Illumination
	// NumTypes is the number of ray types. Useful for using an array to map types to some value instead
	// of a map.
	NumTypes
)

Jump to

Keyboard shortcuts

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