cube

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyIntersections

func AnyIntersections(boxes []BBox, search BBox) bool

func AnyIntersections32

func AnyIntersections32(boxes []BBox32, search BBox32) bool

func Range3D

func Range3D(p1, p2 Pos) iter.Seq[Pos]

Types

type Axis

type Axis int
const (
	Y Axis = iota

	Z

	X
)

func Axes

func Axes() []Axis

func (Axis) Faces

func (a Axis) Faces() (negative, positive Face)

func (Axis) RotateLeft

func (a Axis) RotateLeft() Axis

func (Axis) RotateRight

func (a Axis) RotateRight() Axis

func (Axis) String

func (a Axis) String() string

func (Axis) Vec3

func (a Axis) Vec3() mgl64.Vec3

type BBox

type BBox = boundingBox[float64, mgl64.Vec3]

func Box

func Box(x0, y0, z0, x1, y1, z1 float64) BBox

type BBox32

type BBox32 = boundingBox[float32, mgl32.Vec3]

func Box32

func Box32(x0, y0, z0, x1, y1, z1 float32) BBox32

type Direction

type Direction int
const (
	North Direction = iota

	South

	West

	East
)

func Directions

func Directions() []Direction

func (Direction) Face

func (d Direction) Face() Face

func (Direction) Opposite

func (d Direction) Opposite() Direction

func (Direction) RotateLeft

func (d Direction) RotateLeft() Direction

func (Direction) RotateRight

func (d Direction) RotateRight() Direction

func (Direction) String

func (d Direction) String() string

type Face

type Face int
const (
	FaceDown Face = iota

	FaceUp

	FaceNorth

	FaceSouth

	FaceWest

	FaceEast
)

func Faces

func Faces() []Face

func HorizontalFaces

func HorizontalFaces() []Face

func (Face) Axis

func (f Face) Axis() Axis

func (Face) Direction

func (f Face) Direction() Direction

func (Face) Opposite

func (f Face) Opposite() Face

func (Face) RotateLeft

func (f Face) RotateLeft() Face

func (Face) RotateRight

func (f Face) RotateRight() Face

func (Face) String

func (f Face) String() string

type Orientation

type Orientation int

func OrientationFromYaw

func OrientationFromYaw(yaw float64) Orientation

func (Orientation) Opposite

func (o Orientation) Opposite() Orientation

func (Orientation) RotateLeft

func (o Orientation) RotateLeft() Orientation

func (Orientation) RotateRight

func (o Orientation) RotateRight() Orientation

func (Orientation) Yaw

func (o Orientation) Yaw() float64

type Pos

type Pos [3]int

func Max

func Max(p1, p2 Pos) Pos

func Min

func Min(p1, p2 Pos) Pos

func PosFromVec3

func PosFromVec3(vec3 mgl64.Vec3) Pos

func (Pos) Add

func (p Pos) Add(pos Pos) Pos

func (Pos) Face

func (p Pos) Face(other Pos) Face

func (Pos) NeighbourFace

func (p Pos) NeighbourFace(other Pos) (Face, bool)

func (Pos) Neighbours

func (p Pos) Neighbours(f func(neighbour Pos), r Range)

func (Pos) OutOfBounds

func (p Pos) OutOfBounds(r Range) bool

func (Pos) Side

func (p Pos) Side(face Face) Pos

func (Pos) String

func (p Pos) String() string

func (Pos) Sub

func (p Pos) Sub(pos Pos) Pos

func (Pos) Vec3

func (p Pos) Vec3() mgl64.Vec3

func (Pos) Vec3Centre

func (p Pos) Vec3Centre() mgl64.Vec3

func (Pos) Vec3Middle

func (p Pos) Vec3Middle() mgl64.Vec3

func (Pos) Within

func (p Pos) Within(min, max Pos) bool

func (Pos) X

func (p Pos) X() int

func (Pos) Y

func (p Pos) Y() int

func (Pos) Z

func (p Pos) Z() int

type Range

type Range [2]int

func (Range) Height

func (r Range) Height() int

func (Range) Max

func (r Range) Max() int

func (Range) Min

func (r Range) Min() int

type Rotation

type Rotation [2]float64

func (Rotation) Add

func (r Rotation) Add(r2 Rotation) Rotation

func (Rotation) Direction

func (r Rotation) Direction() Direction

func (Rotation) Elem

func (r Rotation) Elem() (yaw, pitch float64)

func (Rotation) Neg

func (r Rotation) Neg() Rotation

func (Rotation) Opposite

func (r Rotation) Opposite() Rotation

func (Rotation) Orientation

func (r Rotation) Orientation() Orientation

func (Rotation) Pitch

func (r Rotation) Pitch() float64

func (Rotation) Vec3

func (r Rotation) Vec3() mgl64.Vec3

func (Rotation) Yaw

func (r Rotation) Yaw() float64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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