chunk

package
v0.0.0-...-b8cd253 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RenderRadius = flag.Int("r", 16, "render radius")
)

Functions

func NearBlock

func NearBlock(pos mgl32.Vec3) Vec3

Types

type Action

type Action int
const (
	ActionAdd Action = iota
	ActionDelete
)

type Chunk

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

func NewChunk

func NewChunk(id Vec3) *Chunk

func (*Chunk) Add

func (c *Chunk) Add(id Vec3, w *Block)

func (*Chunk) Block

func (c *Chunk) Block(pos Vec3) (block *Block)

func (*Chunk) Del

func (c *Chunk) Del(id Vec3)

func (*Chunk) ID

func (c *Chunk) ID() Vec3

func (*Chunk) RangeBlocks

func (c *Chunk) RangeBlocks(f func(id Vec3, w *Block))

type ChunkAction

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

type ChunkRenderer

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

func NewChunkRenderer

func NewChunkRenderer(ctx *ctx.Context) (*ChunkRenderer, error)

func (*ChunkRenderer) DirtyChunk

func (r *ChunkRenderer) DirtyChunk(id Vec3)

DirtyChunk marks the chunk (by Vec3) as dirty (changed)

func (*ChunkRenderer) Get2dMat

func (r *ChunkRenderer) Get2dMat() mgl32.Mat4

func (*ChunkRenderer) Get3dMat

func (r *ChunkRenderer) Get3dMat() mgl32.Mat4

func (*ChunkRenderer) Render

func (r *ChunkRenderer) Render()

Render will render all chunks and HUD block items to screen

func (*ChunkRenderer) State

func (r *ChunkRenderer) State() state.State

func (*ChunkRenderer) UpdateItem

func (r *ChunkRenderer) UpdateItem(w string)

call on mainthread

func (*ChunkRenderer) UpdateLoop

func (r *ChunkRenderer) UpdateLoop()

UpdateLoop runs a loop for updating meshcache whenever a signal is received on the sigch (signal channel)

type Context

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

type Mesh

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

type Segment

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

type Thread

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

Thread for managing all active and visible chunks around the player

func (*Thread) Init

func (t *Thread) Init() types.InitFunc

func (*Thread) Tick

func (t *Thread) Tick() types.TickFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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