Documentation ¶
Index ¶
- Constants
- Variables
- func Sign(x int) int
- type Block
- type BlockBank
- type BlockType
- type Camera
- type Chunk
- type ChunkPosition
- type ChunkProvider
- type Color
- type CulledMesher
- type Disposable
- type Environment
- type FlatGenerator
- type Fog
- type FpsCameraController
- type FpsLogger
- type Game
- type Generator
- type InfiniteWorldController
- type Key
- type KeyListener
- type Mesh
- type MeshData
- type Mesher
- type MouseListener
- type Pixmap
- type Shader
- type SimplexGenerator
- type SimplexNoise
- type SunLight
- type Texture
- type TextureAtlas
- type TextureRegion
- type VertexAttribute
- type Window
- type WindowConfig
- type World
- type WorldRenderer
Constants ¶
View Source
const ( ChunkWidth = 16 ChunkDepth = 16 ChunkHeight = 16 ChunkXZ = ChunkWidth * ChunkDepth ChunkXYZ = ChunkXZ * ChunkHeight )
View Source
const ( AttribIndexPositions = 0 AttribIndexNormals = 1 AttribIndexUvs = 2 )
View Source
const (
BlockNil = 0x00
)
View Source
const CubeSize = 1.0
View Source
const Radius = 12
Variables ¶
View Source
var ( ColorWhite = NewColor(1, 1, 1, 1) ColorBlack = NewColor(0, 0, 0, 1) ColorRed = NewColor(1, 0, 0, 1) ColorGreen = NewColor(0, 1, 0, 1) ColorBlue = NewColor(0, 0, 1, 1) ColorTeal = NewColor(0.5, 1, 1, 1) )
View Source
var (
Vox *vox
)
Functions ¶
Types ¶
type BlockBank ¶
type BlockBank struct { Types []*BlockType // contains filtered or unexported fields }
func NewBlockBank ¶
func NewBlockBank() *BlockBank
type BlockType ¶
type BlockType struct { ID uint8 Top *TextureRegion Bottom *TextureRegion Side *TextureRegion }
type Chunk ¶
type Chunk struct { Position ChunkPosition Blocks [ChunkXYZ]Block Mesh *Mesh // contains filtered or unexported fields }
type ChunkPosition ¶
type ChunkPosition struct {
X, Y, Z int
}
func (*ChunkPosition) Distance ¶
func (v *ChunkPosition) Distance(other *ChunkPosition) float32
func (*ChunkPosition) Equals ¶
func (p *ChunkPosition) Equals(other *ChunkPosition) bool
func (*ChunkPosition) Set ¶
func (p *ChunkPosition) Set(x, y, z int) *ChunkPosition
func (*ChunkPosition) String ¶
func (p *ChunkPosition) String() string
type ChunkProvider ¶
type CulledMesher ¶
type CulledMesher struct { }
type Disposable ¶
type Disposable interface {
Dispose()
}
type Environment ¶
func NewEnvironment ¶
func NewEnvironment() *Environment
type FlatGenerator ¶
type FlatGenerator struct { }
func (*FlatGenerator) GenerateChunkAt ¶
func (g *FlatGenerator) GenerateChunkAt(x, y, z int, bank *BlockBank) *Chunk
type FpsCameraController ¶
type FpsCameraController struct { MouseSensivity float32 // degress per pixel Velocity float32 // contains filtered or unexported fields }
func NewFpsController ¶
func NewFpsController(cam *Camera) *FpsCameraController
func (*FpsCameraController) KeyDown ¶
func (c *FpsCameraController) KeyDown(key Key) bool
func (*FpsCameraController) KeyPressed ¶
func (c *FpsCameraController) KeyPressed(key Key) bool
func (*FpsCameraController) KeyUp ¶
func (c *FpsCameraController) KeyUp(key Key) bool
func (*FpsCameraController) MouseMoved ¶
func (c *FpsCameraController) MouseMoved(x, y float64) bool
func (*FpsCameraController) Update ¶
func (c *FpsCameraController) Update(delta float32)
type Game ¶
type Game interface { Disposable Create() Resize(width, height int) Render(delta float32) Update(delta float32) }
Game todo
type Generator ¶
func NewSimplexGenerator ¶
type InfiniteWorldController ¶
type InfiniteWorldController struct {
// contains filtered or unexported fields
}
func NewInifinteWorldController ¶
func NewInifinteWorldController(cam *Camera, world *World) *InfiniteWorldController
func (*InfiniteWorldController) Update ¶
func (c *InfiniteWorldController) Update()
type Key ¶
type Key uint16
const ( KeyUnknown Key = 0 KeySpace Key = 1 KeyApostrophe Key = 2 KeyComma Key = 3 KeyMinus Key = 4 KeyPeriod Key = 5 KeySlash Key = 6 Key0 Key = 7 Key1 Key = 8 Key2 Key = 9 Key3 Key = 10 Key4 Key = 11 Key5 Key = 12 Key6 Key = 13 Key7 Key = 14 Key8 Key = 15 Key9 Key = 16 KeySemicolon Key = 17 KeyEqual Key = 18 KeyA Key = 19 KeyB Key = 20 KeyC Key = 21 KeyD Key = 22 KeyE Key = 23 KeyF Key = 24 KeyG Key = 25 KeyH Key = 26 KeyI Key = 27 KeyJ Key = 28 KeyK Key = 29 KeyL Key = 30 KeyM Key = 31 KeyN Key = 32 KeyO Key = 33 KeyP Key = 34 KeyQ Key = 35 KeyR Key = 36 KeyS Key = 37 KeyT Key = 38 KeyU Key = 39 KeyV Key = 40 KeyW Key = 41 KeyX Key = 42 KeyY Key = 43 KeyZ Key = 44 KeyLeftBracket Key = 45 KeyBackslash Key = 46 KeyRightBracket Key = 47 KeyGraveAccent Key = 48 KeyWorld1 Key = 49 KeyWorld2 Key = 50 KeyEscape Key = 51 KeyEnter Key = 52 KeyTab Key = 53 KeyBackspace Key = 54 KeyInsert Key = 55 KeyDelete Key = 56 KeyRight Key = 57 KeyLeft Key = 58 KeyDown Key = 59 KeyUp Key = 60 KeyPageUp Key = 61 KeyPageDown Key = 62 KeyHome Key = 63 KeyEnd Key = 64 KeyCapsLock Key = 65 KeyScrollLock Key = 66 KeyNumLock Key = 67 KeyPrintScreen Key = 68 KeyPause Key = 69 KeyF1 Key = 70 KeyF2 Key = 71 KeyF3 Key = 72 KeyF4 Key = 73 KeyF5 Key = 74 KeyF6 Key = 75 KeyF7 Key = 76 KeyF8 Key = 77 KeyF9 Key = 78 KeyF10 Key = 79 KeyF11 Key = 80 KeyF12 Key = 81 KeyF13 Key = 82 KeyF14 Key = 83 KeyF15 Key = 84 KeyF16 Key = 85 KeyF17 Key = 86 KeyF18 Key = 87 KeyF19 Key = 88 KeyF20 Key = 89 KeyF21 Key = 90 KeyF22 Key = 91 KeyF23 Key = 92 KeyF24 Key = 93 KeyF25 Key = 94 KeyKP0 Key = 95 KeyKP1 Key = 96 KeyKP2 Key = 97 KeyKP3 Key = 98 KeyKP4 Key = 99 KeyKP5 Key = 100 KeyKP6 Key = 101 KeyKP7 Key = 102 KeyKP8 Key = 103 KeyKP9 Key = 104 KeyKPDecimal Key = 105 KeyKPDivide Key = 106 KeyKPMultiply Key = 107 KeyKPSubtract Key = 108 KeyKPAdd Key = 109 KeyKPEnter Key = 110 KeyKPEqual Key = 111 KeyLeftShift Key = 112 KeyLeftControl Key = 113 KeyLeftAlt Key = 114 KeyLeftSuper Key = 115 KeyRightShift Key = 116 KeyRightControl Key = 117 KeyRightAlt Key = 118 KeyRightSuper Key = 119 KeyMenu Key = 120 )
type KeyListener ¶
KeyListener todo
type MouseListener ¶
type MouseListener interface { //MouseDown(x, y float64) bool //MouseUp(x, y float64) bool MouseMoved(x, y float64) bool }
MouseListener todo
type Shader ¶
type Shader struct {
ID uint32
}
type SimplexGenerator ¶
type SimplexGenerator struct {
// contains filtered or unexported fields
}
func (*SimplexGenerator) GenerateChunkAt ¶
func (g *SimplexGenerator) GenerateChunkAt(xx, yy, zz int, bank *BlockBank) *Chunk
type SimplexNoise ¶
type SimplexNoise struct {
// contains filtered or unexported fields
}
func NewSimplex ¶
func NewSimplex(seed int64) *SimplexNoise
type Texture ¶
type Texture struct { Disposable // contains filtered or unexported fields }
func NewTexture ¶
type TextureAtlas ¶
type TextureAtlas struct { Regions map[string]*TextureRegion // contains filtered or unexported fields }
func NewTextureAtlas ¶
func NewTextureAtlas(jsonPath, imagePath string) *TextureAtlas
func (*TextureAtlas) Bind ¶
func (a *TextureAtlas) Bind()
func (*TextureAtlas) Dispose ¶
func (a *TextureAtlas) Dispose()
func (*TextureAtlas) Unbind ¶
func (a *TextureAtlas) Unbind()
type TextureRegion ¶
type VertexAttribute ¶
type WindowConfig ¶
type WindowConfig struct { Height int Width int Title string Resizable bool Fullscreen bool Vsync bool HiddenCursor bool }
WindowConfig todo
type World ¶
type World struct { // Chunks are all chunks that are ready to be rendered Chunks map[ChunkPosition]*Chunk MaxUploadsPerFrame int // contains filtered or unexported fields }
func (*World) GenerateNewChunk ¶
GenerateNewChunk generates a new chunk at the given chunk-coordinates. This does not perform, any OpenGL calls.
func (*World) RemoveChunk ¶
RemoveChunk schedules the cunk for removal.
type WorldRenderer ¶
type WorldRenderer struct { Disposable // contains filtered or unexported fields }
func NewWorldRenderer ¶
func NewWorldRenderer() *WorldRenderer
func (*WorldRenderer) Dispose ¶
func (r *WorldRenderer) Dispose()
func (*WorldRenderer) Render ¶
func (r *WorldRenderer) Render(cam *Camera, world *World, env *Environment)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.