debug

package
v0.10.10 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arrow

type Arrow struct {

	// Colour is the colour that will be used for the line and head. If empty, it will default to white.
	Colour color.RGBA
	// Position is the origin position of the shape in the world.
	Position mgl64.Vec3
	// EndPosition is the end position of the arrow in the world. The arrow will be drawn from Position to
	// EndPosition, with the head being drawn at EndPosition.
	EndPosition mgl64.Vec3
	// HeadLength is the length of the head to be drawn at the end of the arrow. If zero, it will default
	// to 1.0.
	HeadLength float64
	// HeadRadius is the radius of the head to be drawn at the end of the arrow. If zero, it will default
	// to 0.5.
	HeadRadius float64
	// HeadSegments is the number of segments that the head of the arrow will be drawn with. The more
	// segments, the smoother the head will look. If zero, it will default to 4.
	HeadSegments int
	// contains filtered or unexported fields
}

Arrow represents an arrow shape that can be drawn at any point in the world. It has a head which can also be positioned anywhere, and the length, radius and number of segments can be changed.

func (*Arrow) ShapeID

func (s *Arrow) ShapeID() int

ShapeID ...

type Box

type Box struct {

	// Colour is the colour that will be used for the outline. If empty, it will default to white.
	Colour color.RGBA
	// Bounds is the size of the box in the world, acting as an offset from the Position. If empty,
	// it will default to a 1x1x1 box.
	Bounds mgl64.Vec3
	// Position is the origin position of the shape in the world.
	Position mgl64.Vec3
	// Scale is the rate to scale the shape from its origin point. If zero, it will default to 1.0.
	Scale float64
	// contains filtered or unexported fields
}

Box represents a hollow box that can be drawn at any point in the world, with a bounds that can be set.

func (*Box) ShapeID

func (s *Box) ShapeID() int

ShapeID ...

type Circle

type Circle struct {

	// Colour is the colour that will be used for the outline. If empty, it will default to white.
	Colour color.RGBA
	// Position is the origin position of the shape in the world.
	Position mgl64.Vec3
	// Scale is the radius of the circle. If zero, it will default to 1.0.
	Scale float64
	// Segments is the number of segments that the circle will be drawn with. The more segments, the smoother
	// the circle will look. If empty, it will default to 20.
	Segments int
	// contains filtered or unexported fields
}

Circle represents a hollow circle that can be drawn at any point in the world, with the scale being used to control the radius.

func (*Circle) ShapeID

func (s *Circle) ShapeID() int

ShapeID ...

type Line

type Line struct {

	// Colour is the colour that will be used for the line. If empty, it will default to white.
	Colour color.RGBA
	// Position is the origin position of the shape in the world.
	Position mgl64.Vec3
	// EndPosition is the end position of the line in the world. The line will be drawn from Position to
	// EndPosition.
	EndPosition mgl64.Vec3
	// contains filtered or unexported fields
}

Line represents a line that can be drawn at any point in the world, with a start and end position.

func (*Line) ShapeID

func (s *Line) ShapeID() int

ShapeID ...

type Renderer

type Renderer interface {
	// AddDebugShape adds a debug shape to the renderer, which should be rendered to the player. If the shape
	// already exists, it will be updated with the new information.
	AddDebugShape(shape Shape)
	// RemoveDebugShape removes a debug shape from the renderer by its unique identifier.
	RemoveDebugShape(shape Shape)
	// VisibleDebugShapes returns a slice of all debug shapes that are currently being shown by the renderer.
	VisibleDebugShapes() []Shape
	// RemoveAllDebugShapes clears all debug shapes from the renderer, removing them from the view of the player.
	RemoveAllDebugShapes()
}

Renderer represents an interface for a renderer that can manage debug shapes.

type Shape

type Shape interface {
	// ShapeID returns the unique identifier of the shape. This is used to either update or remove the shape
	// after it has been sent to the player.
	ShapeID() int
}

Shape represents a shape that can be drawn to a player from any point in the world.

type Sphere

type Sphere struct {

	// Colour is the colour that will be used for the outline. If empty, it will default to white.
	Colour color.RGBA
	// Position is the origin position of the shape in the world.
	Position mgl64.Vec3
	// Scale is the radius of the sphere. If zero, it will default to 1.0.
	Scale float64
	// Segments is the number of segments that the circle will be drawn with. The more segments, the smoother
	// the circle will look. If empty, it will default to 20.
	Segments int
	// contains filtered or unexported fields
}

Sphere represents a hollow sphere that can be drawn at any point in the world, with one line in each axis. The scale is used to control the radius of the sphere.

func (*Sphere) ShapeID

func (s *Sphere) ShapeID() int

ShapeID ...

type Text

type Text struct {

	// Colour is the colour that will be used for the actual text, not affecting the always-black background.
	// If empty, the text will default to white.
	Colour color.RGBA
	// Position is the origin position of the shape in the world.
	Position mgl64.Vec3
	// Text is the text to be displayed on the shape. The background automatically scales to fit the text.
	Text string
	// contains filtered or unexported fields
}

Text represents text that can be drawn at any point in the world, looking like a normal entity nametag without actually being attached to an entity.

func (*Text) ShapeID

func (s *Text) ShapeID() int

ShapeID ...

Jump to

Keyboard shortcuts

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