debug_utils

package
v0.0.0-...-208d128 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DU_DRAW_POINTS = iota
	DU_DRAW_LINES
	DU_DRAW_TRIS
	DU_DRAW_QUADS
)
View Source
const (
	DU_DRAWNAVMESH_OFFMESHCONS = 0x01
	DU_DRAWNAVMESH_CLOSEDLIST  = 0x02
	DU_DRAWNAVMESH_COLOR_TILES = 0x04
)
View Source
const CHF_MAGIC = ('r' << 24) | ('c' << 16) | ('h' << 8) | 'f'
View Source
const CHF_VERSION = 3
View Source
const CSET_MAGIC = ('c' << 24) | ('s' << 16) | ('e' << 8) | 't'
View Source
const CSET_VERSION = 2

Variables

This section is empty.

Functions

func AppendArrowHead

func AppendArrowHead(dd DuDebugDraw, p, q []float32,
	s float32, col Colorb)

func Bit

func Bit(a, b int) int

func DebugDrawTileCachePortals

func DebugDrawTileCachePortals(dd DuDebugDraw, layer *detour_tile_cache.DtTileCacheLayer, cs, ch float32)

func DrawMeshTile

func DrawMeshTile(dd DuDebugDraw, mesh detour.IDtNavMesh, query detour.NavMeshQuery, tile *detour.DtMeshTile, flags int)

func DrawMeshTileBVTree

func DrawMeshTileBVTree(dd DuDebugDraw, tile *detour.DtMeshTile)

func DuAppendArc

func DuAppendArc(dd DuDebugDraw, x0, y0, z0,
	x1, y1, z1, h,
	as0, as1 float32, col Colorb)

func DuAppendArrow

func DuAppendArrow(dd DuDebugDraw, x0, y0, z0,
	x1, y1, z1,
	as0, as1 float32, col Colorb)

func DuAppendBox

func DuAppendBox(dd DuDebugDraw, minx, miny, minz,
	maxx, maxy, maxz float32, fcol []Colorb)

func DuAppendBoxPoints

func DuAppendBoxPoints(dd DuDebugDraw, minx, miny, minz,
	maxx, maxy, maxz float32, col Colorb)

func DuAppendBoxWire

func DuAppendBoxWire(dd DuDebugDraw, minx, miny, minz, maxx, maxy, maxz float32, col Colorb)

func DuAppendCircle

func DuAppendCircle(dd DuDebugDraw, x, y, z,
	r float32, col Colorb)

func DuAppendCross

func DuAppendCross(dd DuDebugDraw, x, y, z,
	s float32, col Colorb)

func DuAppendCylinder

func DuAppendCylinder(dd DuDebugDraw, minx, miny, minz,
	maxx, maxy, maxz float32, col Colorb)

func DuAppendCylinderWire

func DuAppendCylinderWire(dd DuDebugDraw, minx, miny, minz,
	maxx, maxy, maxz float32, col Colorb)

func DuCalcBoxColors

func DuCalcBoxColors(colors []Colorb, colTop Colorb, colSide Colorb)

func DuDebugDrawArc

func DuDebugDrawArc(dd DuDebugDraw, x0, y0, z0,
	x1, y1, z1, h,
	as0, as1 float32, col Colorb, lineWidth float32)

func DuDebugDrawArrow

func DuDebugDrawArrow(dd DuDebugDraw, x0, y0, z0,
	x1, y1, z1,
	as0, as1 float32, col Colorb, lineWidth float32)

func DuDebugDrawBox

func DuDebugDrawBox(dd DuDebugDraw, minx, miny, minz,
	maxx, maxy, maxz float32, fcol []Colorb)

func DuDebugDrawBoxWire

func DuDebugDrawBoxWire(dd DuDebugDraw, minx, miny, minz,
	maxx, maxy, maxz float32, col Colorb, lineWidth float32)

func DuDebugDrawCircle

func DuDebugDrawCircle(dd DuDebugDraw, x, y, z,
	r float32, col Colorb, lineWidth float32)

func DuDebugDrawCompactHeightfieldDistance

func DuDebugDrawCompactHeightfieldDistance(dd DuDebugDraw, chf *recast.RcCompactHeightfield)

func DuDebugDrawCompactHeightfieldRegions

func DuDebugDrawCompactHeightfieldRegions(dd DuDebugDraw, chf *recast.RcCompactHeightfield)

func DuDebugDrawCompactHeightfieldSolid

func DuDebugDrawCompactHeightfieldSolid(dd DuDebugDraw, chf *recast.RcCompactHeightfield)

func DuDebugDrawContours

func DuDebugDrawContours(dd DuDebugDraw, cset *recast.RcContourSet, alphas ...float32)

func DuDebugDrawCross

func DuDebugDrawCross(dd DuDebugDraw, x, y, z,
	size float32, col Colorb, lineWidth float32)

func DuDebugDrawCylinder

func DuDebugDrawCylinder(dd DuDebugDraw, minx, miny, minz,
	maxx, maxy, maxz float32, col Colorb)

func DuDebugDrawCylinderWire

func DuDebugDrawCylinderWire(dd DuDebugDraw, minx float32, miny, minz,
	maxx, maxy, maxz float32, col Colorb, lineWidth float32)

func DuDebugDrawGridXZ

func DuDebugDrawGridXZ(dd DuDebugDraw, ox, oy, oz float32,
	w, h int, size float32,
	col Colorb, lineWidth float32)

func DuDebugDrawHeightfieldLayer

func DuDebugDrawHeightfieldLayer(dd DuDebugDraw, layer *recast.RcHeightfieldLayer, idx int)

func DuDebugDrawHeightfieldLayers

func DuDebugDrawHeightfieldLayers(dd DuDebugDraw, lset *recast.RcHeightfieldLayerSet)

func DuDebugDrawHeightfieldSolid

func DuDebugDrawHeightfieldSolid(dd DuDebugDraw, hf *recast.RcHeightfield)

func DuDebugDrawHeightfieldWalkable

func DuDebugDrawHeightfieldWalkable(dd DuDebugDraw, hf *recast.RcHeightfield)

func DuDebugDrawNavMesh

func DuDebugDrawNavMesh(dd DuDebugDraw, mesh detour.IDtNavMesh, flags int)

func DuDebugDrawNavMeshBVTree

func DuDebugDrawNavMeshBVTree(dd DuDebugDraw, mesh detour.IDtNavMesh)

func DuDebugDrawNavMeshNodes

func DuDebugDrawNavMeshNodes(dd DuDebugDraw, query detour.NavMeshQuery)

func DuDebugDrawNavMeshPoly

func DuDebugDrawNavMeshPoly(dd DuDebugDraw, mesh detour.IDtNavMesh, ref detour.DtPolyRef, col Colorb)

func DuDebugDrawNavMeshPolysWithFlags

func DuDebugDrawNavMeshPolysWithFlags(dd DuDebugDraw, mesh detour.IDtNavMesh,
	polyFlags int, col Colorb)

func DuDebugDrawNavMeshPortals

func DuDebugDrawNavMeshPortals(dd DuDebugDraw, mesh detour.IDtNavMesh)

func DuDebugDrawNavMeshWithClosedList

func DuDebugDrawNavMeshWithClosedList(dd DuDebugDraw, mesh detour.IDtNavMesh, query detour.NavMeshQuery, flags int)

func DuDebugDrawPolyMesh

func DuDebugDrawPolyMesh(dd DuDebugDraw, mesh *recast.RcPolyMesh)

func DuDebugDrawPolyMeshDetail

func DuDebugDrawPolyMeshDetail(dd DuDebugDraw, dmesh *recast.RcPolyMeshDetail)

func DuDebugDrawRawContours

func DuDebugDrawRawContours(dd DuDebugDraw, cset *recast.RcContourSet, alphas ...float32)

func DuDebugDrawRegionConnections

func DuDebugDrawRegionConnections(dd DuDebugDraw, cset *recast.RcContourSet, alphas ...float32)

func DuDebugDrawTileCacheContours

func DuDebugDrawTileCacheContours(dd DuDebugDraw, lcset *detour_tile_cache.DtTileCacheContourSet,
	orig []float32, cs, ch float32)

func DuDebugDrawTileCacheLayerAreas

func DuDebugDrawTileCacheLayerAreas(dd DuDebugDraw, layer *detour_tile_cache.DtTileCacheLayer, cs, ch float32)

func DuDebugDrawTileCacheLayerRegions

func DuDebugDrawTileCacheLayerRegions(dd DuDebugDraw, layer *detour_tile_cache.DtTileCacheLayer, cs, ch float32)

func DuDebugDrawTileCachePolyMesh

func DuDebugDrawTileCachePolyMesh(dd DuDebugDraw, lmesh *detour_tile_cache.DtTileCachePolyMesh,
	orig []float32, cs, ch float32)

func DuDebugDrawTriMesh

func DuDebugDrawTriMesh(dd DuDebugDraw, verts []float32, nverts int,
	tris []int, normals []float32, ntris int,
	flags []int, texScale float32)

func DuDebugDrawTriMeshSlope

func DuDebugDrawTriMeshSlope(dd DuDebugDraw, verts []float32, nverts int,
	tris []int, normals []float32, ntris int,
	walkableSlopeAngle float32, texScale float32)

func DuDumpCompactHeightfield

func DuDumpCompactHeightfield(chf *recast.RcCompactHeightfield, w *rw.ReaderWriter) bool

func DuDumpContourSet

func DuDumpContourSet(cset *recast.RcContourSet, w *rw.ReaderWriter) bool

func DuDumpPolyMeshDetailToObj

func DuDumpPolyMeshDetailToObj(dmesh recast.RcPolyMeshDetail, w *rw.ReaderWriter) bool

func DuDumpPolyMeshToObj

func DuDumpPolyMeshToObj(pmesh *recast.RcPolyMesh, w *rw.ReaderWriter) bool

func DuIntToCol1

func DuIntToCol1(i int, col []float32)

func DuLogBuildTimes

func DuLogBuildTimes(totalTimeUsec int)

func DuReadCompactHeightfield

func DuReadCompactHeightfield(chf *recast.RcCompactHeightfield, r *rw.ReaderWriter) bool

func DuReadContourSet

func DuReadContourSet(cset recast.RcContourSet, r *rw.ReaderWriter) bool

func GetContourCenter

func GetContourCenter(cont *recast.RcContour, orig []float32, cs, ch float32, center []float32)

Types

type Colorb

type Colorb [4]uint8

func DuDarkenCol

func DuDarkenCol(col Colorb) (res Colorb)

func DuIntToCol

func DuIntToCol(i, a int) Colorb

func DuLerpCol

func DuLerpCol(ca, cb Colorb, u uint8) Colorb

func DuRGBA

func DuRGBA[T int | int32 | uint8](r, g, b, a T) Colorb

func DuRGBAf

func DuRGBAf(fr, fg, fb, fa float32) Colorb

func DuTransCol

func DuTransCol(c Colorb, a uint8) Colorb

func (Colorb) A

func (c Colorb) A() uint8

func (Colorb) B

func (c Colorb) B() uint8

func (*Colorb) FromInt

func (c *Colorb) FromInt(col uint32)

func (Colorb) G

func (c Colorb) G() uint8

func (Colorb) Int

func (c Colorb) Int() uint32

func (Colorb) R

func (c Colorb) R() uint8

type DuDebugDraw

type DuDebugDraw interface {
	DepthMask(state bool)

	Texture(state bool)

	/// Begin drawing primitives.
	///  @param prim [in] primitive type to draw, one of rcDebugDrawPrimitives.
	///  @param size [in] size of a primitive, applies to point size and line width only.
	Begin(prim DuDebugDrawPrimitives, size ...float32) //TODO float size = 1.0f

	/// Submit a vertex
	///  @param pos [in] position of the verts.
	///  @param color [in] color of the verts.
	Vertex(pos []float32, color Colorb)

	/// Submit a vertex
	///  @param x,y,z [in] position of the verts.
	///  @param color [in] color of the verts.
	Vertex1(x, y, z float32, color Colorb)

	/// Submit a vertex
	///  @param pos [in] position of the verts.
	///  @param color [in] color of the verts.
	///  @param uv [in] the uv coordinates of the verts.
	Vertex2(pos []float32, color Colorb, uv []float32)

	/// Submit a vertex
	///  @param x,y,z [in] position of the verts.
	///  @param color [in] color of the verts.
	///  @param u,v [in] the uv coordinates of the verts.
	Vertex3(x, y, z float32, color Colorb, u, v float32)

	/// End drawing primitives.
	End()

	/// Compute a color for given area.
	AreaToCol(area int) Colorb
}

func NewDuDebugDraw

func NewDuDebugDraw() DuDebugDraw

type DuDebugDrawBase

type DuDebugDrawBase struct {
}

func (*DuDebugDrawBase) AreaToCol

func (d *DuDebugDrawBase) AreaToCol(area int) Colorb

func (*DuDebugDrawBase) Begin

func (d *DuDebugDrawBase) Begin(prim DuDebugDrawPrimitives, size ...float32)

func (*DuDebugDrawBase) DepthMask

func (d *DuDebugDrawBase) DepthMask(state bool)

func (*DuDebugDrawBase) End

func (d *DuDebugDrawBase) End()

func (*DuDebugDrawBase) Texture

func (d *DuDebugDrawBase) Texture(state bool)

func (*DuDebugDrawBase) Vertex

func (d *DuDebugDrawBase) Vertex(pos []float32, color Colorb)

func (*DuDebugDrawBase) Vertex1

func (d *DuDebugDrawBase) Vertex1(x, y, z float32, color Colorb)

func (*DuDebugDrawBase) Vertex2

func (d *DuDebugDrawBase) Vertex2(pos []float32, color Colorb, uv []float32)

func (*DuDebugDrawBase) Vertex3

func (d *DuDebugDrawBase) Vertex3(x, y, z float32, color Colorb, u, v float32)

type DuDebugDrawPrimitives

type DuDebugDrawPrimitives int

type DuDisplayList

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

func NewDuDisplayList

func NewDuDisplayList(cap int) *DuDisplayList

func (*DuDisplayList) Vertex

func (d *DuDisplayList) Vertex(pos []float32, color Colorb)

Jump to

Keyboard shortcuts

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