navigation

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package navigation provides pathfinding for the bot, supporting primarily an embedded mmap-based pathfinder (vendored). Remote gRPC is optional and deprioritized (stubbed here; full support can be added behind a build tag).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Navigator interface {
	// FindPath computes a path from start to dest on the given map.
	FindPath(mapID uint32, start, dest Point3D) (*PathResult, error)

	// FindRandomPath finds a random walkable point near center.
	FindRandomPath(mapID uint32, center Point3D, radius float32) (*PathResult, error)

	// GetHeight returns the ground height (Z) at the given point using the pathfinding data (maps + baked vmaps).
	GetHeight(mapID uint32, x, y, z float32) (float32, bool)

	// GetTerrainHeight returns terrain-only height (no vmaps) if available.
	GetTerrainHeight(mapID uint32, x, y float32) (float32, bool)

	// Close releases resources.
	Close()
}

Navigator is the interface for pathfinding.

func NewEmbeddedNavigator

func NewEmbeddedNavigator(dataDir string) Navigator

NewEmbeddedNavigator creates a navigator using a single data directory root (containing mmaps/, maps/, vmaps/ subdirectories). All navigators for the same dataDir share a single underlying service.

func NewRemoteNavigator

func NewRemoteNavigator(address string) (Navigator, error)

NewRemoteNavigator creates a navigator that connects to a remote pathfinding service. In this extraction, remote is deprioritized in favor of embedded. Full gRPC support (requiring gen/pb + grpc deps) can be restored behind a build tag or separate optional package if needed for bridge scenarios.

type PathResult

type PathResult struct {
	Found  bool
	Points []Point3D
}

PathResult holds the result of a pathfinding query.

type Point3D

type Point3D struct {
	X, Y, Z float32
}

Point3D is a 3D position in game world coordinates.

func (Point3D) DistanceTo

func (p Point3D) DistanceTo(o Point3D) float32

DistanceTo computes 3D distance.

func (Point3D) DistanceTo2D

func (p Point3D) DistanceTo2D(o Point3D) float32

DistanceTo2D computes 2D distance (ignoring Z).

Jump to

Keyboard shortcuts

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