1 unstable release
0.1.0 | Nov 11, 2023 |
---|
#34 in #bsp
9KB
181 lines
VBSP
Rust parser for valve bsp files.
Currently only supports the tf2 version of bsp files, but adding other sourcemod variants should be fairly straight forward.
Example usage
fn main() -> Result<(), vbsp::BspError> {
let data = std::fs::read("maps/cp_steel.bsp")?;
let bsp = vbsp::Bsp::read(&data)?;
println!("{:?}", bsp);
Ok(())
}
See vbsp-to-gltf or vbspviewer for some more examples of how to use the bsp data.
TODO
- smooth normals for displacements
- smooth normals for faces
Credits
This project is adapted from the quake bsp parser and wouldn't be possible without information from the source engine wiki.
Dependencies
~1.5MB
~37K SLoC