world

package
v0.0.0-...-672813e Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Near = 0.001
	Far  = 1000
	Fov  = 45
)
View Source
const (
	SizeWidth  = 16
	SizeHeight = 16
	SizeLength = 16
)
View Source
const (
	NoiseSmooth = 20
	WaterHeight = 3
)

Misc

Variables

View Source
var Noise32 = simplex.New32(0)

Functions

This section is empty.

Types

type BlockKind

type BlockKind uint8
const (
	BlockEmpty BlockKind = iota
	BlockVoid
	BlockGrass
	BlockWater
)

type Camera

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

func NewCamera

func NewCamera() *Camera

func (*Camera) SendUniforms

func (c *Camera) SendUniforms(program uint32)

NOTE: I don't mind sending uniforms as part of the shaders code, but I resolve put it directly here in the camera API

func (*Camera) Update

func (c *Camera) Update()

type Chunk

type Chunk struct {
	X, Z    int32
	Data    [SizeWidth][SizeHeight][SizeLength]BlockKind
	Terrain gfx.Mesh
	Water   gfx.Mesh
}

func NewChunk

func NewChunk(x, z int32) *Chunk

func (*Chunk) GetBlock

func (c *Chunk) GetBlock(x, y, z int32) BlockKind

type QuadSide

type QuadSide uint32
const (
	SideNorth QuadSide = iota
	SideSouth
	SideEast
	SideWest
	SideTop
	SideBottom
)

Jump to

Keyboard shortcuts

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