detour_tile_cache

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DT_OBSTACLE_EMPTY = iota
	DT_OBSTACLE_PROCESSING
	DT_OBSTACLE_PROCESSED
	DT_OBSTACLE_REMOVING
)
View Source
const (
	DT_OBSTACLE_CYLINDER     = iota
	DT_OBSTACLE_BOX          // AABB
	DT_OBSTACLE_ORIENTED_BOX // OBB
)
View Source
const (
	TileCache_MAX_UPDATE   = 64
	TileCache_MAX_REQUESTS = 64
)
View Source
const (
	REQUEST_ADD = iota
	REQUEST_REMOVE
)
View Source
const (
	MAX_REQUESTS = 64
	MAX_UPDATE   = 64
)
View Source
const DT_COMPRESSEDTILE_FREE_DATA = 0x01 ///< Navmesh owns the tile memory and should free it.
View Source
const DT_LAYER_MAX_NEIS = 16
View Source
const DT_MAX_TOUCHED_TILES = 8
View Source
const DT_TILECACHE_MAGIC = 'D'<<24 | 'T'<<16 | 'L'<<8 | 'R' ///< 'DTLR';
View Source
const DT_TILECACHE_NULL_AREA = 0
View Source
const DT_TILECACHE_NULL_IDX = 0xffff
View Source
const DT_TILECACHE_VERSION = 1
View Source
const DT_TILECACHE_WALKABLE_AREA = 63
View Source
const MAX_REM_EDGES = 48 // TODO: make this an expression.
View Source
const MAX_VERTS_PER_POLY = 6 // TODO: use the DT_VERTS_PER_POLYGON
View Source
const VERTEX_BUCKET_COUNT2 = (1 << 8)

Variables

This section is empty.

Functions

func DtBuildTileCacheContours

func DtBuildTileCacheContours(
	layer *DtTileCacheLayer,
	walkableClimb int, maxError float32,
	lcset *DtTileCacheContourSet) detour.DtStatus

TODO: move this somewhere else, once the layer meshing is done.

func DtBuildTileCachePolyMesh

func DtBuildTileCachePolyMesh(
	lcset *DtTileCacheContourSet,
	mesh *DtTileCachePolyMesh) detour.DtStatus

func DtBuildTileCacheRegions

func DtBuildTileCacheRegions(
	layer *DtTileCacheLayer,
	walkableClimb int) detour.DtStatus

Types

type DetourTitleCacheData

type DetourTitleCacheData struct {
}

type DetourTitleCacheLayerData

type DetourTitleCacheLayerData struct {
	Header   *DtTileCacheLayerHeader
	Comp     DtTileCacheCompressor //压缩器
	Heights  []int
	Areas    []int
	Cons     []int
	Regs     []int
	RegCount int
}

func DtBuildTileCacheLayer

func DtBuildTileCacheLayer(comp DtTileCacheCompressor,
	header *DtTileCacheLayerHeader,
	heights []int,
	areas []int,
	cons []int,
) *DetourTitleCacheLayerData

type DtCompressedTileRef

type DtCompressedTileRef int

type DtObstacleRef

type DtObstacleRef int

type DtTileCache

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

func (*DtTileCache) AddObstacle

func (d *DtTileCache) AddObstacle(pos []float32, radius, height float32, result *DtObstacleRef) detour.DtStatus

func (*DtTileCache) AddTile

func (d *DtTileCache) AddTile(data *DetourTitleCacheLayerData, flags int, result *DtCompressedTileRef) detour.DtStatus

func (*DtTileCache) BuildNavMeshTilesAt

func (d *DtTileCache) BuildNavMeshTilesAt(tx, ty int, navmesh detour.IDtNavMesh) detour.DtStatus

func (*DtTileCache) CalcTightTileBounds

func (d *DtTileCache) CalcTightTileBounds(header *DtTileCacheLayerHeader, bmin, bmax []float32)

func (*DtTileCache) GetCompressor

func (d *DtTileCache) GetCompressor() DtTileCacheCompressor

func (*DtTileCache) GetObstacle

func (d *DtTileCache) GetObstacle(i int) *DtTileCacheObstacle

func (*DtTileCache) GetObstacleBounds

func (d *DtTileCache) GetObstacleBounds(ob *DtTileCacheObstacle, bmin, bmax []float32)

func (*DtTileCache) GetObstacleCount

func (d *DtTileCache) GetObstacleCount() int

func (*DtTileCache) GetObstacleRef

func (d *DtTileCache) GetObstacleRef(ob *DtTileCacheObstacle) DtObstacleRef

func (*DtTileCache) GetParams

func (d *DtTileCache) GetParams() *DtTileCacheParams

func (*DtTileCache) GetTile

func (d *DtTileCache) GetTile(i int) *dtCompressedTile

func (*DtTileCache) GetTileByRef

func (d *DtTileCache) GetTileByRef(ref DtCompressedTileRef) *dtCompressedTile

func (*DtTileCache) GetTileCount

func (d *DtTileCache) GetTileCount() int

func (*DtTileCache) GetTilesAt

func (d *DtTileCache) GetTilesAt(tx, ty int, tiles []DtCompressedTileRef, maxTiles int) int

func (*DtTileCache) Init

func (*DtTileCache) RemoveObstacle

func (d *DtTileCache) RemoveObstacle(ref DtObstacleRef) detour.DtStatus

func (*DtTileCache) Update

func (d *DtTileCache) Update(dt float32, navmesh detour.IDtNavMesh,
	upToDates ...*bool) detour.DtStatus

type DtTileCacheCompressor

type DtTileCacheCompressor interface {
	Compress(buffer []byte) ([]byte, error)
	Decompress(compressed []byte) ([]byte, error)
}

type DtTileCacheContour

type DtTileCacheContour struct {
	Nverts int
	Verts  []int
	Reg    int
	Area   int
}

type DtTileCacheContourSet

type DtTileCacheContourSet struct {
	Nconts int
	Conts  []*DtTileCacheContour
}

type DtTileCacheLayer

type DtTileCacheLayer struct {
	Header   *DtTileCacheLayerHeader
	RegCount int ///< Region count.
	Heights  []int
	Areas    []int
	Cons     []int
	Regs     []int
}

type DtTileCacheLayerHeader

type DtTileCacheLayerHeader struct {
	Magic                  int ///< Data magic
	Version                int ///< Data version
	Tx, Ty, Tlayer         int
	Bmin, Bmax             [3]float32
	Hmin, Hmax             int ///< Height min/max range
	Width, Height          int ///< Dimension of the layer.
	Minx, Maxx, Miny, Maxy int ///< Usable sub-region.
}

type DtTileCacheMeshProcess

type DtTileCacheMeshProcess interface {
	Process(params *detour.DtNavMeshCreateParams, polyAreas []int, polyFlags []int)
}

type DtTileCacheObstacle

type DtTileCacheObstacle struct {
	Type  int
	State int
	// contains filtered or unexported fields
}

type DtTileCacheParams

type DtTileCacheParams struct {
	Orig                   [3]float32
	Cs, Ch                 float32
	Width, Height          int
	WalkableHeight         float32
	WalkableRadius         float32
	WalkableClimb          float32
	MaxSimplificationError float32
	MaxTiles               int
	MaxObstacles           int
}

type DtTileCachePolyMesh

type DtTileCachePolyMesh struct {
	Nvp    int
	Nverts int   ///< Number of vertices.
	Npolys int   ///< Number of polygons.
	Verts  []int ///< Vertices of the mesh, 3 elements per vertex.
	Polys  []int ///< Polygons of the mesh, nvp*2 elements per polygon.
	Flags  []int ///< Per polygon flags.
	Areas  []int ///< Area ID of polygons.
}
type NavMeshTileBuildContext struct {
	// contains filtered or unexported fields
}

type ObstacleRequest

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

Jump to

Keyboard shortcuts

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