core.libraries.thirdparty.niknaks.modules.sh_bsp_module

(no description)

Functions

ClearLump(lump_id)

View source »

Deletes lump_data cached in the BSP module.

Parameters

  • lump_id number

ClusterFromPoint(position)

View source »

Returns the vis-cluster from said point.

Parameters

  • position Vector

Returns

  • number

ComputeDetailLeaf(position)

View source »

Computes the leaf-id the detail is within. -1 for none.

Parameters

  • position Vector

Returns

  • number

FindBModelIDByFaceIndex(faceId)

View source »

Locates the BModelIndex for the said faceIndex

Parameters

  • faceId number

Returns

  • number

FindGameLump(GameLumpID)

View source »

Returns gamelump number, matching the gLumpID.

Parameters

  • GameLumpID number

Returns

  • BSPLumpHeader

FindNearestCubemap(pos)

View source »

Returns the nearest cubemap to a position.

Parameters

  • pos Vector

Returns

  • CubeMap

GetBModels()

View source »

Returns a list of BModels ( Brush Models )

Returns

  • BModel

GetBrushBounds()

View source »

Returns the map-bounds. These are not the size of the map, but the bounds where brushes are within.

Returns

  • Vector

  • Vector

GetCubemaps()

View source »

Returns the CubeMaps in the map.

Returns

  • CubeMap[]

GetDetailMaterial()

View source »

Returns the detail-metail the map uses.

Returns

GetDispInfo()

View source »

Returns the DispInfo data.

Returns

  • DispInfo[]

GetDispTris()

View source »

Holds flags for the triangle in the displacment mesh. Returns the DispTris data

Returns

  • number[]

GetDispVerts()

View source »

Returns the DispVerts data.

Returns

  • DispVert[]

GetEdges()

View source »

Returns all edges. An edge is two points forming a line. Note: First edge seems to be [0 0 0] - [0 0 0]

Returns

GetFaces()

View source »

Returns a list of Faces making up this bmodel

Returns

  • FaceObject[]

GetGameLump(gameLumpID)

View source »

Returns the game lump as a bytebuffer. This will also be cached on the BSP object.

Parameters

  • gameLumpID any

Returns

GetGameLumpHeaders()

View source »

Returns a list of gamelumps.

Returns

  • BSPLumpHeader[]

GetLeafBrushes()

View source »

Returns an array of leafbrush-data.

Returns

  • BrushObject[]

GetLeafClusters()

View source »

Returns map-leafs in a table with cluster-IDs as key. Note: -1 is no cluster ID.

Returns

GetLeafFaces()

View source »

Returns the leaf_face array. This is used to return a list of faces from a leaf. FaceID = LeafFace[ Leaf.firstleafface + [0 -> Leaf.numleaffaces - 1] ]

Returns

  • number[]

GetLump(lump_id)

View source »

Returns the data lump as a bytebuffer. This will also be cached onto the BSP object.

Parameters

  • lump_id number

Returns

  • BitBuffer

GetLumpString(lump_id)

View source »

Returns the data lump as a datastring. This won't be cached or saved, but it is faster than to parse the data into a bytebuffer and useful if you need the raw data.

Parameters

  • lump_id number

Returns

GetLumpVersion(lump_id)

View source »

Returns the lump version.

Parameters

  • lump_id

Returns

  • number

GetMapFile()

View source »

Returns the mapfile.

Returns

GetMapName()

View source »

Returns the mapname.

Returns

GetMaterialMeshs()

View source »

!! DEBUG FUNCTIONS !!

GetMaterials()

View source »

Returns a list of all materials used by the map.

Returns

  • IMaterial[]

GetOriginalFaces()

View source »

Returns all original faces. ( Warning, uses a lot of memory )

Returns

GetPlanes()

View source »

Returns a list of all planes

Returns

  • Plane[]

GetSize()

View source »

Returns the size of the map in bytes.

Returns

  • number

GetSkyBoxPos()

View source »

Returns the skybox position. Returns [0,0,0] if none are found.

Returns

  • Vector

GetSkyBoxScale()

View source »

Returns the skybox scale. Returns 1 if none are found.

Returns

  • number

GetSkyboxLeafs()

View source »

Returns a list of skybox leafs (If the map has a skybox)

Returns

  • LeafObject[]

GetSkyboxSize()

View source »

Returns the size of the skybox

Returns

  • Vector or nil

  • Vector or nil

GetSurfEdges()

View source »

Returns all surfedges. A surfedge is an index to edges with a direction. If positive First -> Second, if negative Second -> First.

Returns

  • number[]

GetSurfEdgesIndex(num)

View source »

Returns the two edge-positions using surf index

Parameters

  • num number

Returns

  • Vector, Vector

GetTexData()

View source »

Returns a list of material-data used by the map.

Returns

  • TextureData[]

GetTexInfo()

View source »

Returns a list of material-data used by the map.

Returns

GetTexdataStringData()

View source »
Incomplete

Documentation for this section is incomplete and needs expanding.

Returns

GetTextures()

View source »
Incomplete

Documentation for this section is incomplete and needs expanding.

Returns

GetVersion()

View source »

Returns the map-version.

Returns

  • number

GetVertex()

View source »

Returns an array of coordinates of all the vertices (corners) of brushes in the map geometry.

Returns

  • Vector[]

GetVisibility()

View source »

Returns the visibility data.

Returns

HasLumpFile(lump_id)

View source »

Returns true if the server has a lumpfile for the given lump

Parameters

  • lump_id number

Returns

  • bool

HasMaterial(material)

View source »

Returns true if the material is used by the map.

Parameters

  • material IMaterial

Returns

  • boolean

HasSkyBox()

View source »

Returns true if the map has a 3D skybox.

Returns

  • boolean

HasTexture(texture)

View source »

Returns true if the texture is used by the map.

Parameters

Returns

  • boolean

IsColdWorld()

View source »

Returns true if the map is a cold world. ( Flag set in the BSP )

Returns

  • boolean

IsOutsideMap(position)

View source »

Returns true if the position is outside the map

Parameters

  • position Vector

Returns

  • boolean

IsRenderingSkyboxAtPosition(position)

View source »

Returns true if the skybox is rendering at this position. Note: Seems to be broken in EP2 and beyond, where the skybox is rendered at all times regardless of position.

Parameters

  • position

Returns

  • boolean

NikNaks.Map(fileName)

View source »

Reads the BSP file and returns it as an object.

Parameters

Returns

  • BSPObject

  • optional

PointInLeaf(iNode, point)

View source »

Returns the leaf the point is within. Use 0 If unsure about iNode.

Parameters

  • iNode number

  • point Vector

Returns

  • LeafObject

PointInLeafCache(iNode, point, lastVis)

View source »

Returns the leaf the point is within, but allows caching by feeding the old VisLeaf. Will also return a boolean indicating if the leaf is new.

Parameters

  • iNode number

  • point Vector

  • lastVis optional

Returns

  • LeafObject

  • boolean newLeaf

SkyBoxToWorld(vec)

View source »

Returns a position in the world that matches the one in the skybox.

Parameters

  • vec Vector

Returns

  • Vector

WorldMax()

View source »

Returns the max-position where brushes are within the map.

Returns

  • Vector

WorldMin()

View source »

Returns the min-positions where brushes are within the map.

Returns

  • Vector

WorldToSkyBox(vec)

View source »

Returns a position in the skybox that matches the one in the world.

Parameters

  • vec Vector

Returns

  • Vector

Tables

GameLump

View source »
Incomplete

Documentation for this section is incomplete and needs expanding.

Fields

  • buffer BitBuffer

  • version number

  • flags number

OriginalFace

View source »
Incomplete

Documentation for this section is incomplete and needs expanding.

Fields

  • styles number[]

TextureInfo

View source »
Incomplete

Documentation for this section is incomplete and needs expanding.

Fields

VisibilityInfo

View source »
Incomplete

Documentation for this section is incomplete and needs expanding.

Fields

  • VisData VisbilityData[]

self._originalfaces

View source »
Incomplete

Documentation for this section is incomplete and needs expanding.