Documentation
¶
Index ¶
- Constants
- type BSPEntity
- type BSPFile
- func (bsp *BSPFile) BuildEntityString() string
- func (b *BSPFile) Close()
- func (bsp *BSPFile) FetchEntities() []BSPEntity
- func (bsp *BSPFile) FetchEntityString() string
- func (bsp *BSPFile) FetchPlanes() []BSPPlane
- func (bsp *BSPFile) FetchTextures() []BSPTexture
- func (bsp *BSPFile) FetchVertices() []Vertex
- func (bsp *BSPFile) FetchVisibility() []Visibility
- func (bsp *BSPFile) ParseLumpData() error
- func (bsp *BSPFile) ParseLumpMetadata()
- func (bsp *BSPFile) Validate() bool
- type BSPLumpData
- type BSPLumpMeta
- type BSPPlane
- type BSPTexture
- type Vertex
- type Visibility
Constants ¶
View Source
const ( Magic = (('P' << 24) + ('S' << 16) + ('B' << 8) + 'I') HeaderLen = 160 // magic + version + lump metadata EntityLump = 0 PlanesLump = 1 // 20 bytes each VerticesLump = 2 // 12 bytes each (3 floats) VisibilityLump = 3 // 4 bytes PVS, 4 bytes PHS NodesLump = 4 // 28 bytes each TextureLump = 5 // 76 bytes each FacesLump = 6 // 20 bytes each LightMapLump = 7 LeavesLump = 8 LeafFaceTable = 9 LeafBrushTable = 10 EdgesLump = 11 FaceEdgeTable = 12 ModelsLump = 13 BrushesLump = 14 BrushSidesLump = 15 POPLump = 16 AreasLump = 17 AreaPortals = 18 TextureLen = 76 // 40 bytes of origins and angles + 36 for textname )
View Source
const (
BSPPlaneSize = 20
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BSPFile ¶
type BSPFile struct {
Name string // just the filename minus extension (ex: "q2dm1")
Filename string // including any path prefix and .bsp extension
Handle *os.File
Header m.Buffer
LumpMeta [19]BSPLumpMeta
LumpData [19]BSPLumpData
Ents []BSPEntity
Planes []BSPPlane
Vertices []Vertex
Visibility []Visibility
}
represents a binary space partitioning map file
func OpenBSPFile ¶
func (*BSPFile) BuildEntityString ¶
func (*BSPFile) FetchEntities ¶
func (*BSPFile) FetchEntityString ¶
func (*BSPFile) FetchPlanes ¶
func (*BSPFile) FetchTextures ¶
func (bsp *BSPFile) FetchTextures() []BSPTexture
Get a slice of textures TODO: parse the location and orientation data too
func (*BSPFile) FetchVertices ¶
func (*BSPFile) FetchVisibility ¶
func (bsp *BSPFile) FetchVisibility() []Visibility
func (*BSPFile) ParseLumpData ¶
func (*BSPFile) ParseLumpMetadata ¶
func (bsp *BSPFile) ParseLumpMetadata()
find all the locations/sizes of the various lumps. There are always 18 of them.
type BSPLumpData ¶
type BSPLumpMeta ¶
type BSPLumpMeta struct {
// contains filtered or unexported fields
}
Collections of data are organized into "lumps" within the file
type BSPTexture ¶
type BSPTexture struct {
File string // max 64 chars
}
type Visibility ¶
Click to show internal directories.
Click to hide internal directories.