mrazza / gonav Goto Github PK
View Code? Open in Web Editor NEWA Source Engine navigation mesh file parser written in Go.
License: GNU Affero General Public License v3.0
A Source Engine navigation mesh file parser written in Go.
License: GNU Affero General Public License v3.0
The parser does not actually parse custom data. These lines in parser.go:
// Skip passed some unknown data
var garbageCount byte
p.read(&garbageCount)
p.advanceBytes(int(garbageCount) * 14)
Actually skips over game-specific custom area data.
It's possible create a tool for reverse bytes for x360?
Doesn't appear to work on the latest Go version using dust2's nav file. I'm using the example in the README.
f, _ := os.Open("de_dust2.nav") // Open the file
parser := gonav.Parser{Reader: f}
mesh, _ := parser.Parse() // Parse the file
area := mesh.QuadTreeAreas.FindAreaByPoint(gonav.Vector3{10, 10, 10}, true) // Find the nav area that contains the world point {10, 10} with a Z-value closest to 10
fmt.Println(area)
I think the problem is in parser.go
on line 193
. I believe
p.read(currSpot.OrderID)
should read
p.read(&currSpot.OrderID)
That appeared to fix the problem for me. Otherwise, you get the following error:
Failed to open file: Unexpected error when parsing: Failed to read data.
Parent error: binary.Read: invalid type uint32.
The navmesh file contains connections in the order +x, +y, -x, -y (counter-clockwise), or east, north, west, south. However, nav_compass 1
shows a compass with NESW going counterclockwise (:-1:), so perhaps it's best to avoid these terms altogether. The 32 bit value stored for each ladder is not up or down, it's also a cardinal direction. It seems to be the direction of the bottom area relative to the ladder. Check de_sugarcane for a map with all four ladder directions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.