types

package
v0.0.0-...-d72bc35 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Vec3Dot

func Vec3Dot(v1, v2 *Vec3) float64

Types

type Camera

type Camera struct {
	FOV           float64
	FocalLength   float64
	FocalDistance float64
	Position      *Vec3
	AspectRation  float64

	Up, Right *Vec3
	LookAt    *Vec3
	Forward   *Vec3

	Height float64
	Width  float64
}

type Color

type Color Vec3

func NewColor

func NewColor(r, g, b float64) *Color

func (*Color) FromRay

func (c *Color) FromRay(r *Ray) *Color

func (*Color) ToStdColor

func (c *Color) ToStdColor() color.RGBA

type Coord

type Coord Vec3

type Mesh

type Mesh struct {
	Vertices  []*Vec3
	Normals   []*Vec3
	TexCoords []*Vec3
	Polygons  []*Polygon
	BVH       *accelerators.BVH
	Name      string
	RayOffset float64
}

type Polygon

type Polygon struct {
	VertexIndex  []int
	NormalIndex  []int
	TextureIndex []int
	HasNormals   bool
}

type Ray

type Ray struct {
	Orig, Dir *Vec3
}

func NewRay

func NewRay(orig, dir *Vec3) *Ray

func (*Ray) At

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

type Texture

type Texture image.RGBA

type UV

type UV struct {
	U, V *Vec3
}

type Vec3

type Vec3 struct {
	X, Y, Z float64
}

func NewVec3

func NewVec3(x, y, z float64) *Vec3

func Vec3Add

func Vec3Add(v1, v2 *Vec3) *Vec3

func Vec3Sub

func Vec3Sub(v1, v2 *Vec3) *Vec3

func (*Vec3) Add

func (v *Vec3) Add(a *Vec3) *Vec3

func (*Vec3) AddScalar

func (v *Vec3) AddScalar(c float64) *Vec3

func (*Vec3) Len

func (v *Vec3) Len() float64

func (*Vec3) LenSquared

func (v *Vec3) LenSquared() float64

func (*Vec3) Scale

func (v *Vec3) Scale(c float64) *Vec3

func (*Vec3) Sub

func (v *Vec3) Sub(a *Vec3) *Vec3

func (*Vec3) Unit

func (v *Vec3) Unit() *Vec3

Jump to

Keyboard shortcuts

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