BSPParser
Simple and modern library for parsing the Valve BSP format
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
BspParser::Bsp Struct Reference

#include <bsp.hpp>

Public Member Functions

 Bsp (std::span< const std::byte > data)
 
void smoothNeighbouringDisplacements ()
 

Public Attributes

std::span< const std::byte > data
 
const Structs::Headerheader = nullptr
 
std::span< const Structs::GameLumpgameLumps
 
std::span< const Structs::Vectorvertices
 
std::span< const Structs::Planeplanes
 
std::span< const Structs::Edgeedges
 
std::span< const int32_t > surfaceEdges
 
std::span< const Structs::Facefaces
 
std::span< const Structs::TexInfotextureInfos
 
std::span< const Structs::TexDatatextureDatas
 
std::span< const int32_t > textureStringTable
 
std::span< const char > textureStringData
 
std::span< const Structs::Modelmodels
 
std::span< const Structs::DispInfodisplacementInfos
 
std::span< const Structs::DispVertdisplacementVertices
 
std::vector< TriangulatedDisplacementdisplacements
 
std::vector< PhysModelphysicsModels
 
std::vector< Zip::ZipFileEntrycompressedPakfile
 
std::optional< std::span< const Structs::StaticPropDict > > staticPropDictionary = std::nullopt
 
std::optional< std::span< const Structs::StaticPropLeaf > > staticPropLeaves = std::nullopt
 
std::optional< std::variant< std::span< const Structs::StaticPropV4 >, std::span< const Structs::StaticPropV5 >, std::span< const Structs::StaticPropV6 >, std::span< const Structs::StaticPropV7Multiplayer2013 > > > staticProps = std::nullopt
 

Detailed Description

Lightweight abstraction over a BSP file, providing direct access to many of its lumps without any additional allocations.

Note
Does not take ownership of the passed data. It is your responsibility to ensure the lifetime of the BSP does not exceed that of the underlying data.

Member Function Documentation

◆ smoothNeighbouringDisplacements()

void BspParser::Bsp::smoothNeighbouringDisplacements ( )

Smooths normals and tangents between neighbouring displacements for rendering.

Warning
This must only be called once.

Member Data Documentation

◆ displacements

std::vector<TriangulatedDisplacement> BspParser::Bsp::displacements

Triangulated and internally smoothed displacement infos for rendering.

Note
Use smoothNeighbouringDisplacements to smooth the normals and tangents between connected displacements, which mutates this collection.

The documentation for this struct was generated from the following files: