# absoluteValue
function absoluteValue(value)Return absolute value derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `absoluteValue`. |
src/miniquake/world_bsp.mlminiquake/array_util.ml as arrayutil → src/miniquake/array_util.mlminiquake/constants.ml as c → src/miniquake/constants.mlminiquake/format/bsp.ml as bsp → src/miniquake/format/bsp.mlminiquake/mathlib.ml as math → src/miniquake/mathlib.mlminiquake/types.ml as t → src/miniquake/types.mlfunction absoluteValue(value)Return absolute value derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `absoluteValue`. |
function addToFatPvs(map, origin, nodeNumber, destination)Add state for add to fat pvs.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `addToFatPvs`. |
origin | dynamic | — | World-space origin of the operation. |
nodeNumber | dynamic | — | The node number input consumed by `addToFatPvs`. |
destination | dynamic | — | Destination value or collection to update. |
function anyLeafVisible(pvs, leaves)Report whether any leaf visible holds for the active state.
| Parameter | Type | Default | Description |
|---|---|---|---|
pvs | dynamic | — | The pvs input consumed by `anyLeafVisible`. |
leaves | dynamic | — | The leaves input consumed by `anyLeafVisible`. |
function appendTouchedLeaves(map, nodeNumber, mins, maxs, limit, result)Add state for append touched leaves.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `appendTouchedLeaves`. |
nodeNumber | dynamic | — | The node number input consumed by `appendTouchedLeaves`. |
mins | dynamic | — | The mins input consumed by `appendTouchedLeaves`. |
maxs | dynamic | — | The maxs input consumed by `appendTouchedLeaves`. |
limit | dynamic | — | The limit input consumed by `appendTouchedLeaves`. |
result | dynamic | — | Result value to report or translate into a status code. |
function boxOnBspPlaneSide(mins, maxs, plane)SV_FindTouchedLeafs stores every non-solid world leaf intersected by an entity's linked abs bounds (up to MAX_ENT_LEAFS). Large doors and moving walls often have their origin in a different PVS from the face seen by the player, so testing only Mod_PointInLeaf(origin) makes a physically present brush model disappear.
| Parameter | Type | Default | Description |
|---|---|---|---|
mins | dynamic | — | The mins input consumed by `boxOnBspPlaneSide`. |
maxs | dynamic | — | The maxs input consumed by `boxOnBspPlaneSide`. |
plane | dynamic | — | The plane input consumed by `boxOnBspPlaneSide`. |
function child(node, side)Implements the `child` operation for `miniquake.world_bsp` (child).
| Parameter | Type | Default | Description |
|---|---|---|---|
node | dynamic | — | The node input consumed by `child`. |
side | dynamic | — | The side input consumed by `child`. |
collisionHullCacheTracks the module-level collision hull cache state owned by `miniquake.world_bsp`.
collisionHullCacheMapKeyTracks the module-level collision hull cache map key state owned by `miniquake.world_bsp`.
function createHull(map, hullIndex)Create and initialize hull.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `createHull`. |
hullIndex | dynamic | — | Zero-based index of the requested entry. |
function createModelHull(map, modelIndex, hullIndex)Create and initialize model hull.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `createModelHull`. |
modelIndex | dynamic | — | Zero-based index of the requested entry. |
hullIndex | dynamic | — | Zero-based index of the requested entry. |
function decompressLeafPvs(map, leafIndex)Decompress one leaf visibility row without consulting the level cache.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `decompressLeafPvs`. |
leafIndex | dynamic | — | Zero-based index of the requested entry. |
function drawingClipNodes(map)Draws ing clip nodes for `miniquake.world_bsp`.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `drawingClipNodes`. |
function emptyPlane()Implements the `emptyPlane` operation for `miniquake.world_bsp` (empty plane).
function fatPvs(map, origin)SV_FatPVS merges the PVS on both sides of planes within eight units of the view point. This prevents entities on a doorway/portal boundary from blinking out as the camera crosses it.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `fatPvs`. |
origin | dynamic | — | World-space origin of the operation. |
fatPvsScratchTracks the module-level fat pvs scratch state owned by `miniquake.world_bsp`.
fatPvsScratchMapKeyTracks the module-level fat pvs scratch map key state owned by `miniquake.world_bsp`.
function findPlayerStart(map)Return player start.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `findPlayerStart`. |
function hullForBounds(map, mins, maxs)Implements the `hullForBounds` operation for `miniquake.world_bsp` (hull for bounds).
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `hullForBounds`. |
mins | dynamic | — | The mins input consumed by `hullForBounds`. |
maxs | dynamic | — | The maxs input consumed by `hullForBounds`. |
function hullIndexForBounds(mins, maxs)----------------------------------------------------------------------------- Server brush-model collision. WinQuake selects the hull from the moving object's width, then uses the headnode of the addressed BSP submodel. This is what makes func_door, func_plat, func_train and other SOLID_BSP entities participate in the same exact collision path as the world. -----------------------------------------------------------------------------
| Parameter | Type | Default | Description |
|---|---|---|---|
mins | dynamic | — | The mins input consumed by `hullIndexForBounds`. |
maxs | dynamic | — | The maxs input consumed by `hullIndexForBounds`. |
function leafForPoint(map, point)Implements the `leafForPoint` operation for `miniquake.world_bsp` (leaf for point).
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `leafForPoint`. |
point | dynamic | — | The point input consumed by `leafForPoint`. |
function leafPvs(map, leafIndex)Implements the `leafPvs` operation for `miniquake.world_bsp` (leaf pvs).
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `leafPvs`. |
leafIndex | dynamic | — | Zero-based index of the requested entry. |
leafPvsCacheTracks the module-level leaf pvs cache state owned by `miniquake.world_bsp`.
leafPvsCacheMapKeyThe original engine keeps one decompression buffer, but MiniQuake's immutable protocol/render consumers otherwise allocate and expand the same leaf row on every server frame and whenever the camera enters a new leaf. Populate this map-local table while the loading plaque is visible.
function leafVisible(pvs, leafIndex)Return the pre-expanded world-face visibility mask for one view leaf. Report whether leaf visible holds for the active state.
| Parameter | Type | Default | Description |
|---|---|---|---|
pvs | dynamic | — | The pvs input consumed by `leafVisible`. |
leafIndex | dynamic | — | Zero-based index of the requested entry. |
function Mod_LeafPVS(leafIndex, map)Mirror Quake's Mod_LeafPVS routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
leafIndex | dynamic | — | Zero-based index of the requested entry. |
map | dynamic | — | The map input consumed by `Mod_LeafPVS`. |
function Mod_MakeHull0(map)Mirror Quake's Mod_MakeHull0 routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `Mod_MakeHull0`. |
function Mod_PointInLeaf(point, map)Mirror Quake's Mod_PointInLeaf routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
point | dynamic | — | The point input consumed by `Mod_PointInLeaf`. |
map | dynamic | — | The map input consumed by `Mod_PointInLeaf`. |
modelHullCacheTracks the module-level model hull cache state owned by `miniquake.world_bsp`.
modelHullCacheMapKeyTracks the module-level model hull cache map key state owned by `miniquake.world_bsp`.
function orVisibility(destination, source)Implements the `orVisibility` operation for `miniquake.world_bsp` (or visibility).
| Parameter | Type | Default | Description |
|---|---|---|---|
destination | dynamic | — | Destination value or collection to update. |
source | dynamic | — | Source value or collection to read. |
function planeDistance(plane, point)Implements the `planeDistance` operation for `miniquake.world_bsp` (plane distance).
| Parameter | Type | Default | Description |
|---|---|---|---|
plane | dynamic | — | The plane input consumed by `planeDistance`. |
point | dynamic | — | The point input consumed by `planeDistance`. |
function playerHull(map)Original WinQuake naming aliases used by the host, QuakeC builtins and GL renderer. Keeping these at the world boundary avoids duplicating hull rules.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `playerHull`. |
function pointContents(hull, point)Implements the `pointContents` operation for `miniquake.world_bsp` (point contents).
| Parameter | Type | Default | Description |
|---|---|---|---|
hull | dynamic | — | The hull input consumed by `pointContents`. |
point | dynamic | — | The point input consumed by `pointContents`. |
function pointContentsFromNode(hull, number, point)Implements the `pointContentsFromNode` operation for `miniquake.world_bsp` (point contents from node).
| Parameter | Type | Default | Description |
|---|---|---|---|
hull | dynamic | — | The hull input consumed by `pointContentsFromNode`. |
number | dynamic | — | The number input consumed by `pointContentsFromNode`. |
point | dynamic | — | The point input consumed by `pointContentsFromNode`. |
function pointContentsWorld(map, point)Implements the `pointContentsWorld` operation for `miniquake.world_bsp` (point contents world).
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `pointContentsWorld`. |
point | dynamic | — | The point input consumed by `pointContentsWorld`. |
function pointLeaf(map, point)Implements the `pointLeaf` operation for `miniquake.world_bsp` (point leaf).
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `pointLeaf`. |
point | dynamic | — | The point input consumed by `pointLeaf`. |
function precacheCollisionHulls(map)Build the three immutable world hull descriptors while the loading plaque is active. Hull zero includes Mod_MakeHull0's expanded drawing nodes and was previously rebuilt for every point trace, producing hundreds of kilobytes of short-lived objects per gameplay frame.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `precacheCollisionHulls`. |
function precacheLeafPvs(map)Pre-expand all visibility rows before gameplay starts.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `precacheLeafPvs`. |
function RadiusFromBounds(mins, maxs)Implements the `RadiusFromBounds` operation for `miniquake.world_bsp` (radius from bounds).
| Parameter | Type | Default | Description |
|---|---|---|---|
mins | dynamic | — | The mins input consumed by `RadiusFromBounds`. |
maxs | dynamic | — | The maxs input consumed by `RadiusFromBounds`. |
function recursiveHullCheck(hull, number, p1Fraction, p2Fraction, p1, p2, trace)Implements the `recursiveHullCheck` operation for `miniquake.world_bsp` (recursive hull check).
| Parameter | Type | Default | Description |
|---|---|---|---|
hull | dynamic | — | The hull input consumed by `recursiveHullCheck`. |
number | dynamic | — | The number input consumed by `recursiveHullCheck`. |
p1Fraction | dynamic | — | The p1 fraction input consumed by `recursiveHullCheck`. |
p2Fraction | dynamic | — | The p2 fraction input consumed by `recursiveHullCheck`. |
p1 | dynamic | — | The p1 input consumed by `recursiveHullCheck`. |
p2 | dynamic | — | The p2 input consumed by `recursiveHullCheck`. |
trace | dynamic | — | The trace input consumed by `recursiveHullCheck`. |
function touchedLeaves(map, mins, maxs, limit)Implements the `touchedLeaves` operation for `miniquake.world_bsp` (touched leaves).
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `touchedLeaves`. |
mins | dynamic | — | The mins input consumed by `touchedLeaves`. |
maxs | dynamic | — | The maxs input consumed by `touchedLeaves`. |
limit | dynamic | — | The limit input consumed by `touchedLeaves`. |
function trace(map, start, mins, maxs, finish)Trace the requested value through the collision world.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `trace`. |
start | dynamic | — | The start input consumed by `trace`. |
mins | dynamic | — | The mins input consumed by `trace`. |
maxs | dynamic | — | The maxs input consumed by `trace`. |
finish | dynamic | — | The finish input consumed by `trace`. |
function traceBrushModel(map, modelIndex, entityOrigin, start, mins, maxs, finish)Trace brush model through the collision world.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `traceBrushModel`. |
modelIndex | dynamic | — | Zero-based index of the requested entry. |
entityOrigin | dynamic | — | The entity origin input consumed by `traceBrushModel`. |
start | dynamic | — | The start input consumed by `traceBrushModel`. |
mins | dynamic | — | The mins input consumed by `traceBrushModel`. |
maxs | dynamic | — | The maxs input consumed by `traceBrushModel`. |
finish | dynamic | — | The finish input consumed by `traceBrushModel`. |
function traceInHull(hull, start, finish)Trace in hull through the collision world.
| Parameter | Type | Default | Description |
|---|---|---|---|
hull | dynamic | — | The hull input consumed by `traceInHull`. |
start | dynamic | — | The start input consumed by `traceInHull`. |
finish | dynamic | — | The finish input consumed by `traceInHull`. |
function traceLine(map, start, finish)Implements the `traceLine` operation for `miniquake.world_bsp` (trace line).
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `traceLine`. |
start | dynamic | — | The start input consumed by `traceLine`. |
finish | dynamic | — | The finish input consumed by `traceLine`. |
function tracePlayer(map, start, finish)Trace player through the collision world.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `tracePlayer`. |
start | dynamic | — | The start input consumed by `tracePlayer`. |
finish | dynamic | — | The finish input consumed by `tracePlayer`. |
function tracePoint(map, start, finish)Trace point through the collision world.
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `tracePoint`. |
start | dynamic | — | The start input consumed by `tracePoint`. |
finish | dynamic | — | The finish input consumed by `tracePoint`. |
function truePointContents(map, point)Implements the `truePointContents` operation for `miniquake.world_bsp` (true point contents).
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `truePointContents`. |
point | dynamic | — | The point input consumed by `truePointContents`. |
function worldPointContents(map, point)Implements the `worldPointContents` operation for `miniquake.world_bsp` (world point contents).
| Parameter | Type | Default | Description |
|---|---|---|---|
map | dynamic | — | The map input consumed by `worldPointContents`. |
point | dynamic | — | The point input consumed by `worldPointContents`. |
function zeroVector()Implements the `zeroVector` operation for `miniquake.world_bsp` (zero vector).