wfowler1 / LibBSP

C# library for parsing and reading BSP (Binary Space Partition) structures in Quake-based game engines
Other
93 stars 26 forks source link

Map Indices not loading? #9

Open recore67 opened 2 weeks ago

recore67 commented 2 weeks ago

This is more of a personal issue rather than a bug, I'm working on a quake1 map renderer with my bsp file map setup and i've been able to create a mesh from the vertices collected in BSP.Vertices but as i want to collect the Indices from BSP.Indices I get an error saying the collection is null and BSP.IndicesLoaded returns false. Am i doing something wrong? is there like a switch or something to load Indices??

what's even weirder is think Faces aren't even loaded aswell, i'm not able to retrieve any vertex from Face[0].Vertices or Face[0].Indices

wfowler1 commented 2 weeks ago

Quake 1 uses edges instead. The Face struct has a FirstEdgeIndexIndex and NumEdgeIndices. These give a list of ints from lump 13, and those ints reference the edges in lump 12. A negative index means the two vertices are used in reverse.