rendering

package
v0.0.0-...-b44e215 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColorModel = color.ModelFunc(glColorModel)

Functions

func GLModelView

func GLModelView() mgl.Mat4

func GLProjection

func GLProjection() mgl.Mat4

Types

type Chunk

type Chunk interface {
	Size() mgl.Vec3I
	At(pos mgl.Vec3I) Voxel
}

type Color

type Color struct {
	Red   float32
	Green float32
	Blue  float32
	Alpha float32
}

func (*Color) RGBA

func (c *Color) RGBA() (r, g, b, a uint32)

type CubeMesh

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

func NewCubeMesh

func NewCubeMesh(verts []VertexF) *CubeMesh

func (*CubeMesh) Close

func (v *CubeMesh) Close()

func (*CubeMesh) Render

func (v *CubeMesh) Render()

type Frustum

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

func NewFrustum

func NewFrustum() *Frustum

func (*Frustum) IsCubeWithin

func (f *Frustum) IsCubeWithin(pt mgl.Vec3, size mgl.Vec3) bool

func (*Frustum) IsPointWithin

func (f *Frustum) IsPointWithin(pt mgl.Vec3) bool

func (*Frustum) IsSphereWithin

func (f *Frustum) IsSphereWithin(center mgl.Vec3, pRadius float32) bool

func (*Frustum) Update

func (f *Frustum) Update()

type IteratableChunk

type IteratableChunk interface {
	Chunk
	ForeachVoxel(fn func(pos mgl.Vec3I, vox Voxel))
}

type Object

type Object interface {
	Position() mgl.Vec3
	Size() mgl.Vec3
	Renderer() Renderer
}

type Options

type Options int
const (
	NONE       Options = 0
	NO_CULLING Options = 1 << iota
	NO_MESHING
	NO_VBO
)

func (Options) HasFlag

func (o Options) HasFlag(opt Options) bool

type RenderCloser

type RenderCloser interface {
	Renderer
	Close()
}

type RenderFunc

type RenderFunc func()

func (RenderFunc) Render

func (rf RenderFunc) Render()

type Renderer

type Renderer interface {
	Render()
}

func NewRenderedChunk

func NewRenderedChunk(c Chunk, opt Options) Renderer

type VertexF

type VertexF struct {
	Color
	Norm mgl.Vec3
	Pos  mgl.Vec3
}

func CreateMeshFromChunk

func CreateMeshFromChunk(c Chunk, o Options) []VertexF

type Voxel

type Voxel interface {
	Color() color.Color
}

Jump to

Keyboard shortcuts

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