types

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICamera

type ICamera interface {
	Matrix() mgl32.Mat4
	SetPos(pos mgl32.Vec3)
	Pos() mgl32.Vec3
	Front() mgl32.Vec3
	FlipFlying()
	Flying() bool
	OnAngleChange(dx, dy float32)

	State() PlayerState
	Restore(state PlayerState)
}

type IChunk

type IChunk interface {
	ID() Vec3
	Block(id Vec3) *block.Block
	Add(id Vec3, w *block.Block)
	Del(id Vec3)
	RangeBlocks(f func(id Vec3, w *block.Block))
}

type IChunkRenderer

type IChunkRenderer interface {
	IRenderer

	UpdateItem(w string)
	Get3dMat() mgl32.Mat4
	Get2dMat() mgl32.Mat4
	DirtyChunk(id f32.Vec3)
	UpdateLoop()
}

type IGameApplication

type IGameApplication interface {
	World() IWorld
	Camera() ICamera
	Window() *glfw.Window

	CurrentBlockid() f32.Vec3
	ShouldClose() bool
	Update()

	LineRenderer() ILineRenderer
	PlayerRenderer() IPlayerRenderer
	ChunkRenderer() IChunkRenderer
}

type ILineRenderer

type ILineRenderer interface {
	IRenderer
}

type IPlayerRenderer

type IPlayerRenderer interface {
	IRenderer

	UpdateOrAdd(id int32, s proto.PlayerState)
	Remove(id int32)
}

type IRenderer

type IRenderer interface {
	Render()
}

type IThread

type IThread interface {
	Init() InitFunc
	Tick() TickFunc
}

type IWorld

type IWorld interface {
	Collide(pos mgl32.Vec3) (mgl32.Vec3, bool)
	HitTest(pos mgl32.Vec3, vec mgl32.Vec3) (*Vec3, *Vec3)
	Block(id Vec3) *block.Block
	BlockChunk(block Vec3) IChunk
	UpdateBlock(id Vec3, tp *block.Block)
	HasBlock(id Vec3) bool
	Chunk(id Vec3) IChunk
	Chunks(ids []Vec3) []IChunk
}

type InitFunc

type InitFunc func() (err error)

type Mesh

type Mesh struct {
	Id    f32.Vec3
	Dirty bool
	// contains filtered or unexported fields
}

func NewMesh

func NewMesh(shader *glhf.Shader, data []float32) *Mesh

func (*Mesh) Faces

func (m *Mesh) Faces() int

func (*Mesh) Release

func (m *Mesh) Release()

func (*Mesh) Render

func (m *Mesh) Render()

type PlayerState

type PlayerState struct {
	X, Y, Z float32
	Rx, Ry  float32
}

type TickFunc

type TickFunc func()

Jump to

Keyboard shortcuts

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