MiniQuake2

src/miniquake2/collision/model.ml

Provides miniquake2 collision model facilities for this project.

Package
miniquake2.collision.model
Reachable
Yes

Imports

Declarations

areasConnected

function areasConnected(model, firstArea, secondArea)

Report whether areas connected.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
firstAreadynamic—firstArea value consumed by this operation.
secondAreadynamic—secondArea value consumed by this operation.

View source

boxLeafNumbers

function boxLeafNumbers(model, mins, maxs, headNode)

Return the box leaf numbers value.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
minsdynamic—mins value consumed by this operation.
maxsdynamic—maxs value consumed by this operation.
headNodedynamic—headNode value consumed by this operation.

View source

boxOnPlaneSide

function boxOnPlaneSide(mins, maxs, plane)

Report whether box on plane side.

ParameterTypeDefaultDescription
minsdynamic—mins value consumed by this operation.
maxsdynamic—maxs value consumed by this operation.
planedynamic—plane value consumed by this operation.

View source

boxTrace

function boxTrace(model, start, finish, mins, maxs, headNode, brushMask)

Trace box.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
startdynamic—start value consumed by this operation.
finishdynamic—finish value consumed by this operation.
minsdynamic—mins value consumed by this operation.
maxsdynamic—maxs value consumed by this operation.
headNodedynamic—headNode value consumed by this operation.
brushMaskdynamic—brushMask value consumed by this operation.

View source

clearVisibilityRows

function clearVisibilityRows(model)

Clear visibility rows.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.

View source

clipBoxToBrush

inline function clipBoxToBrush(model, mins, maxs, start, finish, trace, brush)

Clip box to brush.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
minsdynamic—mins value consumed by this operation.
maxsdynamic—maxs value consumed by this operation.
startdynamic—start value consumed by this operation.
finishdynamic—finish value consumed by this operation.
tracedynamic—trace value consumed by this operation.
brushdynamic—brush value consumed by this operation.

View source

collectBoxLeafs

function collectBoxLeafs(model, nodeNumber, mins, maxs, output, count)

Collect box leafs.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
nodeNumberdynamic—nodeNumber value consumed by this operation.
minsdynamic—mins value consumed by this operation.
maxsdynamic—maxs value consumed by this operation.
outputdynamic—Output collection or buffer populated by the operation.
countdynamic—Number of items or units to process.

View source

miniquake2.collision.model.CollisionModel struct

miniquake2.collision.model.CollisionSurface struct

component

function component(value, axis)

Return the component value.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.
axisdynamic—axis value consumed by this operation.

View source

create

function create(map)

Creates create for the miniquake2 collision model module.

ParameterTypeDefaultDescription
mapdynamic—map value consumed by this operation.

View source

DIST_EPSILON

const DIST_EPSILON = 3.125e-002

Defines the dist epsilon constant used by the miniquake2 collision model module.

View source

dot

function dot(a, b)

Performs the dot operation for the miniquake2 collision model module.

ParameterTypeDefaultDescription
adynamic—a value consumed by this operation.
bdynamic—b value consumed by this operation.

View source

floodArea

function floodArea(model, areaNumber, floodNumber)

Return the flood area value.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
areaNumberdynamic—areaNumber value consumed by this operation.
floodNumberdynamic—floodNumber value consumed by this operation.

View source

floodAreas

function floodAreas(model)

Return the flood areas value.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.

View source

hullCheck

function hullCheck(model, headNode, startX, startY, startZ, finishX, finishY, finishZ, mins, maxs, start, finish, brushMask, trace, checkCount, isPoint, extentX, extentY, extentZ)

Quake II CM_RecursiveHullCheck as an allocation-free iterative DFS. A MiniLang function call carries dynamic values, so the original C recursion is substantially more expensive here. The preallocated per-map stack keeps identical near-before-far BSP traversal and fraction pruning semantics.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
headNodedynamic—headNode value consumed by this operation.
startXdynamic—startX value consumed by this operation.
startYdynamic—startY value consumed by this operation.
startZdynamic—startZ value consumed by this operation.
finishXdynamic—finishX value consumed by this operation.
finishYdynamic—finishY value consumed by this operation.
finishZdynamic—finishZ value consumed by this operation.
minsdynamic—mins value consumed by this operation.
maxsdynamic—maxs value consumed by this operation.
startdynamic—start value consumed by this operation.
finishdynamic—finish value consumed by this operation.
brushMaskdynamic—brushMask value consumed by this operation.
tracedynamic—trace value consumed by this operation.
checkCountdynamic—Number of check to process.
isPointdynamic—isPoint value consumed by this operation.
extentXdynamic—extentX value consumed by this operation.
extentYdynamic—extentY value consumed by this operation.
extentZdynamic—extentZ value consumed by this operation.

View source

makeDefaultTrace

function makeDefaultTrace(endPosition)

Create default trace.

ParameterTypeDefaultDescription
endPositiondynamic—endPosition value consumed by this operation.

View source

maxValue

function maxValue(a, b)

Return the max value.

ParameterTypeDefaultDescription
adynamic—a value consumed by this operation.
bdynamic—b value consumed by this operation.

View source

minValue

function minValue(a, b)

Return the min value.

ParameterTypeDefaultDescription
adynamic—a value consumed by this operation.
bdynamic—b value consumed by this operation.

View source

offsetDistance

function offsetDistance(plane, mins, maxs)

Return the offset distance value.

ParameterTypeDefaultDescription
planedynamic—plane value consumed by this operation.
minsdynamic—mins value consumed by this operation.
maxsdynamic—maxs value consumed by this operation.

View source

pointContents

function pointContents(model, point, headNode)

Performs the pointContents operation for the miniquake2 collision model module.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
pointdynamic—point value consumed by this operation.
headNodedynamic—headNode value consumed by this operation.

View source

pointLeafNumber

function pointLeafNumber(model, point, headNode)

Return the point leaf number.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
pointdynamic—point value consumed by this operation.
headNodedynamic—headNode value consumed by this operation.

View source

requireCollisionVector

function requireCollisionVector(value, operation)

Require collision vector.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.
operationdynamic—operation value consumed by this operation.

View source

setAreaPortalState

function setAreaPortalState(model, portalNumber, isOpen)

Set area portal state.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
portalNumberdynamic—portalNumber value consumed by this operation.
isOpendynamic—isOpen value consumed by this operation.

View source

surfaceForSide

function surfaceForSide(model, side)

Return the surface for side value.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
sidedynamic—side value consumed by this operation.

View source

testBoxInBrush

inline function testBoxInBrush(model, mins, maxs, start, trace, brush)

Exact CM_TestBoxInBrush position test. Swept traces use the recursive BSP hull walk below; a stationary hull must instead visit every leaf touched by its expanded bounds and test whether the complete box starts in a brush.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
minsdynamic—mins value consumed by this operation.
maxsdynamic—maxs value consumed by this operation.
startdynamic—start value consumed by this operation.
tracedynamic—trace value consumed by this operation.
brushdynamic—brush value consumed by this operation.

View source

testInLeaf

function testInLeaf(model, leafNumber, mins, maxs, start, brushMask, trace, checkCount)

Verify in leaf.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
leafNumberdynamic—leafNumber value consumed by this operation.
minsdynamic—mins value consumed by this operation.
maxsdynamic—maxs value consumed by this operation.
startdynamic—start value consumed by this operation.
brushMaskdynamic—brushMask value consumed by this operation.
tracedynamic—trace value consumed by this operation.
checkCountdynamic—Number of check to process.

View source

miniquake2.collision.model.Trace struct

miniquake2.collision.model.TracePlane struct

traceToLeaf

inline function traceToLeaf(model, leafNumber, mins, maxs, start, finish, brushMask, trace, checkCount)

Exact CM_TraceToLeaf brush filtering with a generation table instead of clearing/copying a brush array for every trace.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
leafNumberdynamic—leafNumber value consumed by this operation.
minsdynamic—mins value consumed by this operation.
maxsdynamic—maxs value consumed by this operation.
startdynamic—start value consumed by this operation.
finishdynamic—finish value consumed by this operation.
brushMaskdynamic—brushMask value consumed by this operation.
tracedynamic—trace value consumed by this operation.
checkCountdynamic—Number of check to process.

View source

vec3

function vec3(x, y, z)

Return the vec 3 value.

ParameterTypeDefaultDescription
xdynamic—Horizontal coordinate used by the operation.
ydynamic—Vertical coordinate used by the operation.
zdynamic—z value consumed by this operation.

View source

visibilityRow

function visibilityRow(model, cluster, kind)

BSP visibility lumps are immutable after load in the product. Cache each decompressed cluster row once, matching the original engine's pointer-like visibility access instead of rebuilding RLE output for every entity/sound.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
clusterdynamic—cluster value consumed by this operation.
kinddynamic—kind value consumed by this operation.

View source

writeAreaBits

function writeAreaBits(model, areaNumber)

Write area bits.

ParameterTypeDefaultDescription
modeldynamic—model value consumed by this operation.
areaNumberdynamic—areaNumber value consumed by this operation.

View source