model

package
v0.0.0-...-d1826b6 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: AGPL-3.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cake

type Cake struct {
	Bites int
}

Cake is a model used by cake blocks.

func (Cake) AABB

func (c Cake) AABB(pos cube.Pos, w *world.World) []physics.AABB

AABB ...

func (Cake) FaceSolid

func (c Cake) FaceSolid(pos cube.Pos, face cube.Face, w *world.World) bool

FaceSolid ...

type Carpet

type Carpet struct{}

Carpet is a model for carpet-like extremely thin blocks.

func (Carpet) AABB

func (Carpet) AABB(cube.Pos, *world.World) []physics.AABB

AABB ...

func (Carpet) FaceSolid

func (Carpet) FaceSolid(cube.Pos, cube.Face, *world.World) bool

FaceSolid ...

type Chest

type Chest struct{}

Chest is the model of a chest. It is just barely not a full block, having a slightly reduced with on all axes.

func (Chest) AABB

func (Chest) AABB(pos cube.Pos, w *world.World) []physics.AABB

AABB ...

func (Chest) FaceSolid

func (Chest) FaceSolid(pos cube.Pos, face cube.Face, w *world.World) bool

FaceSolid ...

type CocoaBean

type CocoaBean struct {
	Facing cube.Direction
	Age    int
}

CocoaBean is a model used by cocoa bean blocks.

func (CocoaBean) AABB

func (c CocoaBean) AABB(pos cube.Pos, w *world.World) []physics.AABB

AABB ...

func (CocoaBean) FaceSolid

func (c CocoaBean) FaceSolid(pos cube.Pos, face cube.Face, w *world.World) bool

FaceSolid ...

type Door

type Door struct {
	Facing cube.Direction
	Open   bool
	Right  bool
}

Door is a model used for doors. It has no solid faces and a bounding box that changes depending on the direction of the door, whether it is open, and the side of its hinge.

func (Door) AABB

func (d Door) AABB(pos cube.Pos, w *world.World) []physics.AABB

AABB ...

func (Door) FaceSolid

func (d Door) FaceSolid(pos cube.Pos, face cube.Face, w *world.World) bool

FaceSolid ...

type Empty

type Empty struct{}

Empty is a model that is completely empty. It has no collision boxes or solid faces.

func (Empty) AABB

func (Empty) AABB(cube.Pos, *world.World) []physics.AABB

AABB ...

func (Empty) FaceSolid

func (Empty) FaceSolid(cube.Pos, cube.Face, *world.World) bool

FaceSolid ...

type Fence

type Fence struct {
	Wooden bool
}

Fence is a model used by wooden & nether brick fence.

func (Fence) AABB

func (f Fence) AABB(pos cube.Pos, w *world.World) []physics.AABB

AABB ...

func (Fence) FaceSolid

func (f Fence) FaceSolid(_ cube.Pos, face cube.Face, _ *world.World) bool

FaceSolid ...

type FenceGate

type FenceGate struct {
	Facing cube.Direction
	Open   bool
}

FenceGate is a model used by fence gates.

func (FenceGate) AABB

func (f FenceGate) AABB(pos cube.Pos, w *world.World) []physics.AABB

AABB ...

func (FenceGate) FaceSolid

func (f FenceGate) FaceSolid(pos cube.Pos, face cube.Face, w *world.World) bool

FaceSolid ...

type Ladder

type Ladder struct {
	// Facing is the side of the block the ladder is currently attached to.
	Facing cube.Direction
}

Ladder is the model for a ladder block.

func (Ladder) AABB

func (l Ladder) AABB(cube.Pos, *world.World) []physics.AABB

AABB ...

func (Ladder) FaceSolid

func (l Ladder) FaceSolid(cube.Pos, cube.Face, *world.World) bool

FaceSolid ...

type Lantern

type Lantern struct {
	Hanging bool
}

Lantern is a model for the lantern block.

func (Lantern) AABB

func (l Lantern) AABB(pos cube.Pos, w *world.World) []physics.AABB

AABB ...

func (Lantern) FaceSolid

func (l Lantern) FaceSolid(pos cube.Pos, face cube.Face, w *world.World) bool

FaceSolid ...

type Leaves

type Leaves struct{}

Leaves is a model for leaves-like blocks. These blocks have a full collision box, but none of their faces are solid.

func (Leaves) AABB

func (Leaves) AABB(cube.Pos, *world.World) []physics.AABB

AABB ...

func (Leaves) FaceSolid

func (Leaves) FaceSolid(cube.Pos, cube.Face, *world.World) bool

FaceSolid ...

type Slab

type Slab struct {
	Double, Top bool
}

Slab is the model of a slab-like block, which is either a half block or a full block, depending on if the slab is double.

func (Slab) AABB

func (s Slab) AABB(cube.Pos, *world.World) []physics.AABB

AABB ...

func (Slab) FaceSolid

func (s Slab) FaceSolid(_ cube.Pos, face cube.Face, _ *world.World) bool

FaceSolid ...

type Solid

type Solid struct{}

Solid is the model of a fully solid block. Blocks with this model, such as stone or wooden planks, have a 1x1x1 collision box.

func (Solid) AABB

func (Solid) AABB(cube.Pos, *world.World) []physics.AABB

AABB ...

func (Solid) FaceSolid

func (Solid) FaceSolid(cube.Pos, cube.Face, *world.World) bool

FaceSolid ...

type Stair

type Stair struct {
	Facing     cube.Direction
	UpsideDown bool
}

Stair is a model for stair-like blocks. These have different solid sides depending on the direction the stairs are facing, the surrounding blocks and whether it is upside down or not.

func (Stair) AABB

func (s Stair) AABB(pos cube.Pos, w *world.World) []physics.AABB

AABB ...

func (Stair) FaceSolid

func (s Stair) FaceSolid(pos cube.Pos, face cube.Face, w *world.World) bool

FaceSolid ...

type Thin

type Thin struct{}

Thin is a model for thin, partial blocks such as a glass pane or an iron bar. It changes its bounding box depending on solid faces next to it.

func (Thin) AABB

func (t Thin) AABB(pos cube.Pos, w *world.World) []physics.AABB

AABB ...

func (Thin) FaceSolid

func (t Thin) FaceSolid(_ cube.Pos, face cube.Face, _ *world.World) bool

FaceSolid ...

type TilledGrass

type TilledGrass struct {
}

TilledGrass is a model used for grass that has been tilled in some way, such as dirt paths and farmland.

func (TilledGrass) AABB

func (TilledGrass) AABB(pos cube.Pos, w *world.World) []physics.AABB

AABB ...

func (TilledGrass) FaceSolid

func (TilledGrass) FaceSolid(pos cube.Pos, face cube.Face, w *world.World) bool

FaceSolid ...

type Trapdoor

type Trapdoor struct {
	Facing    cube.Direction
	Open, Top bool
}

Trapdoor is a model used for trapdoors. It has no solid faces and a bounding box that changes depending on the direction of the trapdoor.

func (Trapdoor) AABB

func (t Trapdoor) AABB(cube.Pos, *world.World) []physics.AABB

AABB ...

func (Trapdoor) FaceSolid

func (t Trapdoor) FaceSolid(cube.Pos, cube.Face, *world.World) bool

FaceSolid ...

Jump to

Keyboard shortcuts

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