#bsp #parser #operating #quake #generation #qbsp

macro qbsp_macros

Rust crate for parsing and operating with Quake 1 BSP files

3 unstable releases

0.2.1 Feb 11, 2025
0.2.0 Feb 6, 2025
0.1.0 Feb 5, 2025

#2573 in Procedural macros

Download history 267/week @ 2025-02-04 124/week @ 2025-02-11

391 downloads per month
Used in 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 for the RGBLIGHTING, LIGHTGRID_OCTREE, and BRUSHLIST lumps.

How to use

use qbsp::prelude::*;

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

Future plans

  • More flexible meshing API
  • BSP writing

Dependencies

~210–650KB
~15K SLoC