#macro #qbsp #qbsp-macros

macro qbsp_macros

Rust crate for parsing and operating with Quake 1 BSP files

5 unstable releases

new 0.3.1 Apr 17, 2025
0.3.0 Feb 22, 2025
0.2.1 Feb 11, 2025
0.2.0 Feb 6, 2025
0.1.0 Feb 5, 2025

#2206 in #macro

Download history 227/week @ 2025-02-01 139/week @ 2025-02-08 46/week @ 2025-02-15 166/week @ 2025-02-22 24/week @ 2025-03-01 24/week @ 2025-03-08 51/week @ 2025-03-15 18/week @ 2025-03-22 9/week @ 2025-03-29 72/week @ 2025-04-05 204/week @ 2025-04-12

303 downloads per month
Used in 2 crates (via qbsp)

MIT/Apache

5KB
78 lines

QBSP

Rust crate for parsing, and operating with Quake 1 BSP files.

Features

  • Parsing .bsp files with the BSP29 and BSP2 formats.
  • Structured easy access to the bsp data.
  • BSP raycasting.
  • Mesh generation.
  • Lightmap atlas generation either per-style or per-slot (.lit supported).
  • BSPX support, including built-in structures/support for the RGBLIGHTING, LIGHTGRID_OCTREE, BRUSHLIST, and DECOUPLED_LM lumps.

How to use

use qbsp::prelude::*;

let _ = BspData::parse(BspParseInput {
    bsp: &[], // Data of the bsp file.
    lit: None, // Optional lit file for colored lighting if no `RGBLIGHTING` BSPX lump is present.
    settings: BspParseSettings::default(),
});

Feature wishlist

I might work on these at a later date, but if anyone wants to help out or just give some ideas, they're more than welcome to!

  • More flexible meshing API
  • PVS data support
  • BSP writing

Dependencies

~200–630KB
~15K SLoC