navmesh

package module
v0.0.0-...-51184b7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2015 License: MIT Imports: 5 Imported by: 0

README

navmesh

navigation mesh in golang navmesh

#install go get github.com/xtaci/navmesh/demo

Documentation

Index

Constants

View Source
const LARGE_NUMBER = math.MaxInt32

Variables

View Source
var (
	ERROR_TRIANGLELIST_ILLEGAL = errors.New("triangle list illegal")
)

Functions

This section is empty.

Types

type BorderList

type BorderList struct {
	Indices []int32 // 2pt as border
}

type Dijkstra

type Dijkstra struct {
	Matrix map[int32][]WeightedTriangle // all edge for nodes
}

Dijkstra

func (*Dijkstra) CreateMatrixFromMesh

func (d *Dijkstra) CreateMatrixFromMesh(mesh Mesh)

create neighbour matrix

func (*Dijkstra) Run

func (d *Dijkstra) Run(src_id int32) map[int32]int32

type Mesh

type Mesh struct {
	Vertices  []Point3   // vertices
	Triangles [][3]int32 // triangles
}
type NavMesh struct{}
func (nm *NavMesh) Route(list TriangleList, start, end *Point3) (*Path, error)

type Path

type Path struct {
	Line []Point3
}

type TriangleHeap

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

func NewTriangleHeap

func NewTriangleHeap() *TriangleHeap

func (*TriangleHeap) DecreaseKey

func (th *TriangleHeap) DecreaseKey(id int32, weight uint32)

func (*TriangleHeap) Len

func (th *TriangleHeap) Len() int

func (*TriangleHeap) Less

func (th *TriangleHeap) Less(i, j int) bool

func (*TriangleHeap) Pop

func (th *TriangleHeap) Pop() interface{}

func (*TriangleHeap) Push

func (th *TriangleHeap) Push(x interface{})

func (*TriangleHeap) Swap

func (th *TriangleHeap) Swap(i, j int)

type TriangleList

type TriangleList struct {
	Vertices  []Point3
	Triangles [][3]int32 // triangles
}

type WeightedTriangle

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

Triangle Heap

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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