vbsp

Crates.iovbsp
lib.rsvbsp
version
sourcesrc
created_at2022-02-18 19:54:05.311766+00
updated_at2025-03-04 20:39:20.57025+00
descriptionRust parser for valve bsp files.
homepagehttps://github.com/icewind1991/vbsp
repositoryhttps://github.com/icewind1991/vbsp
max_upload_size
id534855
Cargo.toml error:TOML parse error at line 20, column 1 | 20 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Robin Appelman (icewind1991)

documentation

README

VBSP

Rust parser for valve bsp files.

Currently supports bsp files from Counter Strike Source and Team Fortress 2, other source games using bsp version 19 or 20 might also work. Adding other sourcemod variants should be fairly straight forward and pull requests for them are welcome.

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.

Commit count: 120

cargo fmt