Documentation
¶
Index ¶
Constants ¶
const LUMP_AREAPORTALS = 21
const LUMP_AREAS = 20
const LUMP_BRUSHES = 18
const LUMP_BRUSHSIDES = 19
const LUMP_CLIPPORTALVERTS = 41
const LUMP_CLUSTERPORTALS = 25
const LUMP_CLUSTERS = 23
const LUMP_CUBEMAPS = 42
const LUMP_DISPINFO = 26
const LUMP_DISP_LIGHTMAP_ALPHAS = 32 // contents is normally stripped out
const LUMP_DISP_LIGHTMAP_SAMPLE_POSITIONS = 34
const LUMP_DISP_MULTIBLEND = 63
const LUMP_DISP_TRIS = 48
const LUMP_DISP_VERTS = 33
const LUMP_EDGES = 12 // face edges. v1->v2, vertex order may be reversed
const LUMP_ENTITIES = 0 // Entity keyvalue data stored as string
const LUMP_FACEIDS = 11 // contents is normally stripped out by compiler
const LUMP_FACES = 7 // bsp faces
const LUMP_FACES_HDR = 58
const LUMP_FACE_MACRO_TEXTURE_INFO = 47
const LUMP_GAME_LUMP = 35 // game specific data. includes staticprop data
const LUMP_LEAFBRUSHES = 17 // brushes that define a leaf volume
const LUMP_LEAFFACES = 16 // faces that separate leaves.
const LUMP_LEAFMINDISTTOWATER = 46
const LUMP_LEAFS = 10
const LUMP_LEAFWATERDATA = 36
const LUMP_LEAF_AMBIENT_INDEX = 52
const LUMP_LEAF_AMBIENT_INDEX_HDR = 51
const LUMP_LEAF_AMBIENT_LIGHTING = 56
const LUMP_LEAF_AMBIENT_LIGHTING_HDR = 55
const LUMP_LIGHTING = 8
const LUMP_LIGHTING_HDR = 53
const LUMP_LIGHTMAPPAGES = 51
const LUMP_LIGHTMAPPAGESINFOS = 52
const LUMP_MAP_FLAGS = 59
const LUMP_MODELS = 14 // models are root bsp nodes. m[0] = worldspawn. m[0+n] are brush entity data
const LUMP_NODES = 5 // bsp node tree entries
const LUMP_OCCLUSION = 9
const LUMP_ORIGINALFACES = 27
const LUMP_OVERLAYS = 45
const LUMP_OVERLAY_FADES = 60
const LUMP_OVERLAY_SYSTEM_LEVELS = 61
const LUMP_PAKFILE = 40 // uncompressed zip of packed custom content
const LUMP_PHYSCOLLIDE = 29
const LUMP_PHYSCOLLIDESURFACE = 49 // deprecated
const LUMP_PHYSDISP = 28
const LUMP_PHYSLEVEL = 62
const LUMP_PLANES = 1 // bsp planes
const LUMP_PORTALS = 22
const LUMP_PORTALVERTS = 24
const LUMP_PRIMINDICES = 39
const LUMP_PRIMITIVES = 37
const LUMP_PRIMVERTS = 38
const LUMP_PROPCOLLISION = 22
const LUMP_PROPHULLS = 23
const LUMP_PROPHULLVERTS = 24
const LUMP_PROPTRIS = 25
const LUMP_PROP_BLOB = 49
const LUMP_SURFEDGES = 13 //
const LUMP_TEXDATA = 2 // texture data used by bsp faces
const LUMP_TEXDATA_STRING_DATA = 43 // raw string data of material paths
const LUMP_TEXDATA_STRING_TABLE = 44 // references entries in the string data lump
const LUMP_TEXINFO = 6 // face texture information
const LUMP_UNUSED0 = 22
const LUMP_UNUSED1 = 23
const LUMP_UNUSED2 = 24
const LUMP_UNUSED3 = 25
const LUMP_VERTEXES = 3 // vertex data
const LUMP_VERTNORMALINDICES = 31
const LUMP_VERTNORMALS = 30
const LUMP_VISIBILITY = 4 // vvis calculated visibility pvs & pas information
const LUMP_WATEROVERLAYS = 50
const LUMP_WORLDLIGHTS = 15
const LUMP_WORLDLIGHTS_HDR = 54
const LUMP_XZIPPAKFILE = 57 // deprecated, and xbox specific
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bsp ¶
type Bsp struct {
// contains filtered or unexported fields
}
Root .bsp filetype container. Consists of a 1036byte header and 64 lump blocks.
func ReadFromFile ¶
Wraps ReadFromStream to control the file access as well. Use ReadFromStream if you already have a file handle
func ReadFromStream ¶
Read from any struct that implements io.Reader handy for passing in a string/bytes/other stream
func (*Bsp) GetLumpRaw ¶
Get the lump for a given index.
type Header ¶
type Header struct {
Id int32
Version int32
Lumps [64]HeaderLump
Revision int32
}
Bsp header. Contains format and lump layout data. Do not trust lump information between import and export
type HeaderLump ¶
Layout information for a given lump, stored in the Header.
type Lump ¶
type Lump struct {
// contains filtered or unexported fields
}
Container for a lump. Also includes metadata about the lump. N.B. Some information mirrors the header's lump descriptor, but header information should not be trusted after import completion.
func (*Lump) GetContents ¶
Get the contents of a lump. NOTE: Will need to be cast to the relevant lumps
func (*Lump) GetRawContents ¶
Get the raw []byte contents of a lump. N.B. This is the raw imported value. To get the raw value of a modified lump, use GetContents().ToBytes()
func (*Lump) SetId ¶
Get lump identifier Id is the lump type index (not the index for the order the lumps are stored)
func (*Lump) SetRawContents ¶
Set raw []byte contents of a lump.