Documentation ¶
Overview ¶
Package gonav provides functionality related to CS:GO Nav Meshes
Package gonav provides functionality related to CS:GO Nav Meshes
Package gonav provides functionality related to CS:GO Nav Meshes
Package gonav provides functionality related to CS:GO Nav Meshes
Package gonav provides functionality related to CS:GO Nav Meshes
Package gonav provides functionality related to CS:GO Nav Meshes
Package gonav provides functionality related to CS:GO Nav Meshes
Package gonav provides functionality related to CS:GO Nav Meshes
Package gonav provides functionality related to CS:GO Nav Meshes
Package gonav provides functionality related to CS:GO Nav Meshes
Index ¶
- type HeuristicCalculator
- type MeshConnectionCalculator
- type MeshLadderCalculator
- type NavArea
- func (area *NavArea) ContainsPoint(point Vector3, allowBelow bool) bool
- func (area *NavArea) DistanceFromCenter(point Vector3) float32
- func (area *NavArea) DistanceFromZ(point Vector3) float32
- func (area *NavArea) GetCenter() Vector3
- func (area *NavArea) GetClosestPointInArea(point Vector3) Vector3
- func (area *NavArea) GetNorthEastPoint() Vector3
- func (area *NavArea) GetRoughSquaredArea() float32
- func (area *NavArea) GetSouthWestPoint() Vector3
- func (area *NavArea) GetZ(x, y float32) (float32, error)
- func (area *NavArea) String() string
- type NavConnection
- type NavDirection
- type NavEncounterPath
- type NavEncounterSpot
- type NavHidingSpot
- type NavLadder
- type NavLadderConnection
- type NavLadderDirection
- type NavMesh
- type NavPlace
- type NavVisibleArea
- type Parser
- type Path
- type PathNode
- type Vector3
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeuristicCalculator ¶
HeuristicCalculator calculates an estimated heurisitic of cost between two (likely disjoint) NavAreas This is used by the A* algorithm so must be admissible AND monotonic
type MeshConnectionCalculator ¶
type MeshConnectionCalculator func(*NavConnection) float32
MeshConnectionCalculator is a func that calculates the cost of a connection in a nav mesh
type MeshLadderCalculator ¶
type MeshLadderCalculator func(*NavLadder, NavLadderDirection, *NavArea, *NavArea) float32
MeshLadderCalculator is a func that calculates the cost of a ladder between two nav areas The first NavArea is the starting area, the second NavArea is the ending area
type NavArea ¶
type NavArea struct {}
NavArea represents a NavArea as part of a NavMesh
func (*NavArea) ContainsPoint ¶
ContainsPoint determines whether or not the specified point is contained within this area If allowBelow is false, a rough estimation will be performed and if the specified point is below this NavArea, we will return false.
func (*NavArea) DistanceFromCenter ¶
DistanceFromCenter gets the distance from the specified point to the center of this area
func (*NavArea) DistanceFromZ ¶
DistanceFromZ gets the distance the specified point is from a rough estimate of the Z-position for this NavArea
func (*NavArea) GetClosestPointInArea ¶
GetClosestPointInArea gets the point closest to the specified point that is contained within this Area.
func (*NavArea) GetNorthEastPoint ¶
GetNorthEastPoint builds the north east point from the two known corner points and the known Z value
func (*NavArea) GetRoughSquaredArea ¶
GetRoughSquaredArea gets a rough estimate of the squared area of the NavArea
func (*NavArea) GetSouthWestPoint ¶
GetSouthWestPoint builds the south west point from the two known corner points and the known Z value
type NavConnection ¶
type NavConnection struct {}
NavConnection represents a connection between two NavAreas
type NavDirection ¶
type NavDirection int
NavDirection represents a cardinal direction
const ( NavDirection = iota NavDirectionEast NavDirectionSouth NavDirectionWest NavDirectionMax )NavDirectionNorth
type NavEncounterPath ¶
type NavEncounterPath struct {}
NavEncounterPath represents an encounter path
type NavEncounterSpot ¶
type NavEncounterSpot struct {}
NavEncounterSpot represents a spot along an encounter path
type NavHidingSpot ¶
type NavHidingSpot struct {}
NavHidingSpot represents an identified hiding spot within a NavArea
type NavLadderConnection ¶
type NavLadderConnection struct {}
NavLadderConnection represents a connection between an area and a ladder
type NavLadderDirection ¶
type NavLadderDirection int
NavLadderDirection represents the direction between a ladder and its connection
const ( NavLadderDirection = iota NavLadderDirectionDown NavLadderDirectionMax )NavLadderDirectionUp
type NavMesh ¶
type NavMesh struct {}
NavMesh represents an entire parsed Nav Mesh and provides functionality related to the manipulation and searching of the mesh
func (*NavMesh) GetAreaById ¶
Returns area given an id
func (*NavMesh) GetNearestArea ¶
Finds the area nearest to this point
func (*NavMesh) GetPlaceByName ¶
GetPlaceByName gets a NavPlace by the specified name string; nil if not found
type NavPlace ¶
type NavPlace struct {}
NavPlace represents a Place entry in the NavMesh
func (*NavPlace) GetEstimatedCenter ¶
GetEstimatedCenter gets a rough estimate of the center of this NavPlace
type Path ¶
type Path struct {
Nodes []*PathNode
}
Path represents a path between two points
func BuildShortestPath ¶
func BuildShortestPath(startArea, endArea *NavArea, areaCostCalc MeshConnectionCalculator, ladderCostCalc MeshLadderCalculator, heurisiticCost HeuristicCalculator) (Path, error)
BuildShortestPath builds a path (via PathFinding A*) and returns a Path object containing the start and end nodes of the path startArea and endArea are the starting and ending NavAreas for the path areaCostCalc is a func() that calculates the "cost" of a connection between two NavAreas ladderCostCalc is a func() that calculates the "cost" of a connection via a ladder heurisiticCost is a func() that estimates an admissible AND monotonic cost for two (likely nonadjacent) NavAreas
func SimpleBuildShortestPath ¶
SimpleBuildShortestPath builds a path (via PathFinding A*) and returns a Path object containing the start and end nodes of the path startArea and endArea are the starting and ending NavAreas for the path This function uses simple default cost and heuristic functions when building the Path. For more control, see BuildShortestPath
type PathNode ¶
type PathNode struct { Area *NavArea PrevNode *PathNode CostFromStart float32 // contains filtered or unexported fields }
PathNode is a single node along a path
type Vector3 ¶
type Vector3 struct {
X, Y, Z float32 // The X, Y, and Z coordinates of the vector
}
Vector3 represents a 3D vector or point in space with X, Y, Z components.
func (*Vector3) LengthSquared ¶
LengthSquared gets the square of the length of the Vector. This operation is faster than Length().