Files
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.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
firstArea | dynamic | — | firstArea value consumed by this operation. |
secondArea | dynamic | — | secondArea value consumed by this operation. |
View source
# boxLeafNumbers
function boxLeafNumbers(model, mins, maxs, headNode)
Return the box leaf numbers value.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
headNode | dynamic | — | headNode value consumed by this operation. |
View source
# boxOnPlaneSide
function boxOnPlaneSide(mins, maxs, plane)
Report whether box on plane side.
| Parameter | Type | Default | Description |
|---|
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
plane | dynamic | — | plane value consumed by this operation. |
View source
# boxTrace
function boxTrace(model, start, finish, mins, maxs, headNode, brushMask)
Trace box.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
start | dynamic | — | start value consumed by this operation. |
finish | dynamic | — | finish value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
headNode | dynamic | — | headNode value consumed by this operation. |
brushMask | dynamic | — | brushMask value consumed by this operation. |
View source
# clearVisibilityRows
function clearVisibilityRows(model)
Clear visibility rows.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
View source
# clipBoxToBrush
inline function clipBoxToBrush(model, mins, maxs, start, finish, trace, brush)
Clip box to brush.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
start | dynamic | — | start value consumed by this operation. |
finish | dynamic | — | finish value consumed by this operation. |
trace | dynamic | — | trace value consumed by this operation. |
brush | dynamic | — | brush value consumed by this operation. |
View source
# collectBoxLeafs
function collectBoxLeafs(model, nodeNumber, mins, maxs, output, count)
Collect box leafs.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
nodeNumber | dynamic | — | nodeNumber value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
output | dynamic | — | Output collection or buffer populated by the operation. |
count | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
axis | dynamic | — | axis value consumed by this operation. |
View source
# create
function create(map)
Creates create for the miniquake2 collision model module.
| Parameter | Type | Default | Description |
|---|
map | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | a value consumed by this operation. |
b | dynamic | — | b value consumed by this operation. |
View source
# floodArea
function floodArea(model, areaNumber, floodNumber)
Return the flood area value.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
areaNumber | dynamic | — | areaNumber value consumed by this operation. |
floodNumber | dynamic | — | floodNumber value consumed by this operation. |
View source
# floodAreas
function floodAreas(model)
Return the flood areas value.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
headNode | dynamic | — | headNode value consumed by this operation. |
startX | dynamic | — | startX value consumed by this operation. |
startY | dynamic | — | startY value consumed by this operation. |
startZ | dynamic | — | startZ value consumed by this operation. |
finishX | dynamic | — | finishX value consumed by this operation. |
finishY | dynamic | — | finishY value consumed by this operation. |
finishZ | dynamic | — | finishZ value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
start | dynamic | — | start value consumed by this operation. |
finish | dynamic | — | finish value consumed by this operation. |
brushMask | dynamic | — | brushMask value consumed by this operation. |
trace | dynamic | — | trace value consumed by this operation. |
checkCount | dynamic | — | Number of check to process. |
isPoint | dynamic | — | isPoint value consumed by this operation. |
extentX | dynamic | — | extentX value consumed by this operation. |
extentY | dynamic | — | extentY value consumed by this operation. |
extentZ | dynamic | — | extentZ value consumed by this operation. |
View source
# makeDefaultTrace
function makeDefaultTrace(endPosition)
Create default trace.
| Parameter | Type | Default | Description |
|---|
endPosition | dynamic | — | endPosition value consumed by this operation. |
View source
# maxValue
function maxValue(a, b)
Return the max value.
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | a value consumed by this operation. |
b | dynamic | — | b value consumed by this operation. |
View source
# minValue
function minValue(a, b)
Return the min value.
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | a value consumed by this operation. |
b | dynamic | — | b value consumed by this operation. |
View source
# offsetDistance
function offsetDistance(plane, mins, maxs)
Return the offset distance value.
| Parameter | Type | Default | Description |
|---|
plane | dynamic | — | plane value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
View source
# pointContents
function pointContents(model, point, headNode)
Performs the pointContents operation for the miniquake2 collision model module.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
point | dynamic | — | point value consumed by this operation. |
headNode | dynamic | — | headNode value consumed by this operation. |
View source
# pointLeafNumber
function pointLeafNumber(model, point, headNode)
Return the point leaf number.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
point | dynamic | — | point value consumed by this operation. |
headNode | dynamic | — | headNode value consumed by this operation. |
View source
# requireCollisionVector
function requireCollisionVector(value, operation)
Require collision vector.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
operation | dynamic | — | operation value consumed by this operation. |
View source
# setAreaPortalState
function setAreaPortalState(model, portalNumber, isOpen)
Set area portal state.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
portalNumber | dynamic | — | portalNumber value consumed by this operation. |
isOpen | dynamic | — | isOpen value consumed by this operation. |
View source
# surfaceForSide
function surfaceForSide(model, side)
Return the surface for side value.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
side | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
start | dynamic | — | start value consumed by this operation. |
trace | dynamic | — | trace value consumed by this operation. |
brush | dynamic | — | brush value consumed by this operation. |
View source
# testInLeaf
function testInLeaf(model, leafNumber, mins, maxs, start, brushMask, trace, checkCount)
Verify in leaf.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
leafNumber | dynamic | — | leafNumber value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
start | dynamic | — | start value consumed by this operation. |
brushMask | dynamic | — | brushMask value consumed by this operation. |
trace | dynamic | — | trace value consumed by this operation. |
checkCount | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
leafNumber | dynamic | — | leafNumber value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
start | dynamic | — | start value consumed by this operation. |
finish | dynamic | — | finish value consumed by this operation. |
brushMask | dynamic | — | brushMask value consumed by this operation. |
trace | dynamic | — | trace value consumed by this operation. |
checkCount | dynamic | — | Number of check to process. |
View source
# vec3
function vec3(x, y, z)
Return the vec 3 value.
| Parameter | Type | Default | Description |
|---|
x | dynamic | — | Horizontal coordinate used by the operation. |
y | dynamic | — | Vertical coordinate used by the operation. |
z | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
cluster | dynamic | — | cluster value consumed by this operation. |
kind | dynamic | — | kind value consumed by this operation. |
View source
# writeAreaBits
function writeAreaBits(model, areaNumber)
Write area bits.
| Parameter | Type | Default | Description |
|---|
model | dynamic | — | model value consumed by this operation. |
areaNumber | dynamic | — | areaNumber value consumed by this operation. |
View source