Documentation ¶
Index ¶
- Constants
- func ChunkVertexGenerator(cm *T) mesh.Generator[voxel.Vertex, uint16]
- func Crop(chk *T)
- func Deserialize(dec object.Decoder) (object.Component, error)
- func ExampleWorldgen(seed, size int) *worldgen
- func Expand(chk *T)
- func NewGUI(e *Editor, target *Mesh) gui.Fragment
- func NewMenu(editor *Editor) gui.Fragment
- func Subdivide(chk *T)
- type ChunkState
- type Editor
- func (e *Editor) Actions() []editor.Action
- func (e *Editor) Bounds() physics.Shape
- func (e *Editor) Deselect(ev mouse.Event) bool
- func (e *Editor) GetVoxel(x, y, z int) voxel.T
- func (e *Editor) InBounds(p vec3.T) bool
- func (e *Editor) KeyEvent(ev keys.Event)
- func (e *Editor) Name() string
- func (e *Editor) Recalculate()
- func (e *Editor) Select(ev mouse.Event)
- func (e *Editor) SelectColor(c color.T)
- func (e *Editor) SelectedColor() color.T
- func (e *Editor) SetVoxel(x, y, z int, v voxel.T)
- func (e *Editor) Target() object.Component
- func (e *Editor) Update(scene object.Component, dt float32)
- type EraseTool
- type Generator
- type LightVolume
- type LightVoxel
- type Mesh
- type PlaceTool
- type ReplaceTool
- type SampleTool
- type T
- type World
Constants ¶
View Source
const NormalUndefined = 0
View Source
const NormalXN = 2
View Source
const NormalXP = 1
View Source
const NormalYN = 4
View Source
const NormalYP = 3
View Source
const NormalZN = 6
View Source
const NormalZP = 5
View Source
const TexcoordBottomLeft = 2
View Source
const TexcoordBottomRight = 3
View Source
const TexcoordTopLeft = 0
View Source
const TexcoordTopRight = 1
Variables ¶
This section is empty.
Functions ¶
func ExampleWorldgen ¶
func ExampleWorldgen(seed, size int) *worldgen
Types ¶
type ChunkState ¶
type Editor ¶
type Editor struct { object.Object *editor.Context Chunk *T PlaceTool *PlaceTool EraseTool *EraseTool SampleTool *SampleTool ReplaceTool *ReplaceTool XPlane *plane.Plane YPlane *plane.Plane ZPlane *plane.Plane GUI gui.Fragment Menu gui.Fragment BoundingBox *lines.BoxObject Rigidbody *physics.RigidBody CollisionMesh *physics.Mesh // contains filtered or unexported fields }
Editor base struct
func (*Editor) Recalculate ¶
func (e *Editor) Recalculate()
func (*Editor) SelectColor ¶
func (*Editor) SelectedColor ¶
type EraseTool ¶
func NewEraseTool ¶
func NewEraseTool() *EraseTool
func (*EraseTool) CanDeselect ¶
func (*EraseTool) ToolMouseEvent ¶
func (pt *EraseTool) ToolMouseEvent(ev mouse.Event, hover physics.RaycastHit)
type Generator ¶
func NewRandomGen ¶
func NewRandomGen() Generator
type LightVolume ¶
type LightVolume struct { Falloff float32 Sx, Sy, Sz int Data [][][]LightVoxel }
func NewLightVolume ¶
func NewLightVolume(sx, sy, sz int) *LightVolume
func (*LightVolume) Block ¶
func (lv *LightVolume) Block(x, y, z int, blocked bool)
func (*LightVolume) Brightness ¶
func (lv *LightVolume) Brightness(x, y, z int) float32
func (*LightVolume) Calculate ¶
func (lv *LightVolume) Calculate()
func (*LightVolume) Clear ¶
func (lv *LightVolume) Clear()
func (*LightVolume) Get ¶
func (lv *LightVolume) Get(x, y, z int) *LightVoxel
func (*LightVolume) Resample ¶
func (lv *LightVolume) Resample(x, y, z int) float32
type LightVoxel ¶
type PlaceTool ¶
func NewPlaceTool ¶
func NewPlaceTool() *PlaceTool
func (*PlaceTool) CanDeselect ¶
func (*PlaceTool) ToolMouseEvent ¶
func (pt *PlaceTool) ToolMouseEvent(ev mouse.Event, hover physics.RaycastHit)
type ReplaceTool ¶
func NewReplaceTool ¶
func NewReplaceTool() *ReplaceTool
func (*ReplaceTool) CanDeselect ¶
func (pt *ReplaceTool) CanDeselect() bool
func (*ReplaceTool) ToolMouseEvent ¶
func (pt *ReplaceTool) ToolMouseEvent(ev mouse.Event, hover physics.RaycastHit)
type SampleTool ¶
func NewSampleTool ¶
func NewSampleTool() *SampleTool
func (*SampleTool) CanDeselect ¶
func (pt *SampleTool) CanDeselect() bool
func (*SampleTool) ToolMouseEvent ¶
func (pt *SampleTool) ToolMouseEvent(ev mouse.Event, hover physics.RaycastHit)
type T ¶
type T struct { Key string Sx, Sy, Sz int Data voxel.Array Light *LightVolume }
Chunk is the smallest individually renderable unit of voxel geometry
Click to show internal directories.
Click to hide internal directories.