trace

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BBoxIntersects

func BBoxIntersects(bb cube.BBox, start, end mgl64.Vec3) bool

func BlockIntersects

func BlockIntersects(pos cube.Pos, src world.BlockSource, b world.Block, start, end mgl64.Vec3) bool

func TraverseBlocks

func TraverseBlocks(start, end mgl64.Vec3, f func(pos cube.Pos) (con bool))

Types

type BBoxResult

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

func BBoxIntercept

func BBoxIntercept(bb cube.BBox, start, end mgl64.Vec3) (result BBoxResult, ok bool)

func (BBoxResult) BBox

func (r BBoxResult) BBox() cube.BBox

func (BBoxResult) Face

func (r BBoxResult) Face() cube.Face

func (BBoxResult) Position

func (r BBoxResult) Position() mgl64.Vec3

type BlockResult

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

func BlockIntercept

func BlockIntercept(pos cube.Pos, src world.BlockSource, b world.Block, start, end mgl64.Vec3) (result BlockResult, ok bool)

func (BlockResult) BBox

func (r BlockResult) BBox() cube.BBox

func (BlockResult) BlockPosition

func (r BlockResult) BlockPosition() cube.Pos

func (BlockResult) Face

func (r BlockResult) Face() cube.Face

func (BlockResult) Position

func (r BlockResult) Position() mgl64.Vec3

type EntityFilter

type EntityFilter func(iter.Seq[world.Entity]) iter.Seq[world.Entity]

type EntityResult

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

func EntityIntercept

func EntityIntercept(e world.Entity, start, end mgl64.Vec3) (result EntityResult, ok bool)

func (EntityResult) BBox

func (r EntityResult) BBox() cube.BBox

func (EntityResult) Entity

func (r EntityResult) Entity() world.Entity

func (EntityResult) Face

func (r EntityResult) Face() cube.Face

func (EntityResult) Position

func (r EntityResult) Position() mgl64.Vec3

type Result

type Result interface {
	BBox() cube.BBox

	Position() mgl64.Vec3

	Face() cube.Face
}

func Perform

func Perform(start, end mgl64.Vec3, tx *world.Tx, box cube.BBox, filter EntityFilter) (hit Result, ok bool)

Jump to

Keyboard shortcuts

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