MiniQuake

src/miniquake/render/entities.ml

Package
miniquake.render.entities
Reachable
Yes

Imports

Declarations

aliasAffineModels

aliasAffineModels

Tracks the module-level alias affine models state owned by `miniquake.render.entities`.

View source

aliasDoubleEyes

aliasDoubleEyes

Tracks the module-level alias double eyes state owned by `miniquake.render.entities`.

View source

aliasFrame

function aliasFrame(source, frameNumber, time)

Implements the `aliasFrame` operation for `miniquake.render.entities` (alias frame).

ParameterTypeDefaultDescription
sourcedynamic—Source value or collection to read.
frameNumberdynamic—The frame number input consumed by `aliasFrame`.
timedynamic—Simulation or presentation time for the operation.

View source

aliasLightingScratch

aliasLightingScratch

Tracks the module-level alias lighting scratch state owned by `miniquake.render.entities`.

View source

aliasModelCastsShadow

function aliasModelCastsShadow(model)

Return whether an alias model represents opaque physical geometry. Flames and beam/light effects are alias MDLs in retail Quake rather than sprites; projecting them created bright duplicate torches and energy streaks on the receiver floor on backends that defer fixed-function texture state.

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.

View source

aliasNoColors

aliasNoColors

Tracks the module-level alias no colors state owned by `miniquake.render.entities`.

View source

aliasPoseBlend

function aliasPoseBlend(source, entity, currentFrame, time, viewModel)

Return [previous pose, current pose, blend fraction] for one render entity. Networked Quake changes MDL frame numbers at the 10 Hz server cadence; this short history removes visible pose stepping without changing simulation.

ParameterTypeDefaultDescription
sourcedynamic—Source value or collection to read.
entitydynamic—Entity affected by the operation.
currentFramedynamic—The current frame input consumed by `aliasPoseBlend`.
timedynamic—Simulation or presentation time for the operation.
viewModeldynamic—The view model input consumed by `aliasPoseBlend`.

View source

aliasPoseChangeTimes

aliasPoseChangeTimes

Tracks the module-level alias pose change times state owned by `miniquake.render.entities`.

View source

aliasPoseCurrent

aliasPoseCurrent

Tracks the module-level alias pose current state owned by `miniquake.render.entities`.

View source

aliasPoseInterpolation

aliasPoseInterpolation

Tracks the module-level alias pose interpolation state owned by `miniquake.render.entities`.

View source

aliasPoseModels

aliasPoseModels

Tracks the module-level alias pose models state owned by `miniquake.render.entities`.

View source

aliasPosePrevious

aliasPosePrevious

Tracks the module-level alias pose previous state owned by `miniquake.render.entities`.

View source

AliasRenderingConfiguration

function AliasRenderingConfiguration()

Implements the `AliasRenderingConfiguration` operation for `miniquake.render.entities` (alias rendering configuration).

View source

aliasShade

function aliasShade(model, entity, time, viewModel)

Implements the `aliasShade` operation for `miniquake.render.entities` (alias shade).

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.
entitydynamic—Entity affected by the operation.
timedynamic—Simulation or presentation time for the operation.
viewModeldynamic—The view model input consumed by `aliasShade`.

View source

aliasShadeCacheAmbient

aliasShadeCacheAmbient

Tracks the module-level alias shade cache ambient state owned by `miniquake.render.entities`.

View source

aliasShadeCacheColormap

aliasShadeCacheColormap

Tracks the module-level alias shade cache colormap state owned by `miniquake.render.entities`.

View source

aliasShadeCacheModel

aliasShadeCacheModel

Tracks the module-level alias shade cache model state owned by `miniquake.render.entities`.

View source

aliasShadeCacheOriginX

aliasShadeCacheOriginX

Tracks the module-level alias shade cache origin x state owned by `miniquake.render.entities`.

View source

aliasShadeCacheOriginY

aliasShadeCacheOriginY

Tracks the module-level alias shade cache origin y state owned by `miniquake.render.entities`.

View source

aliasShadeCacheOriginZ

aliasShadeCacheOriginZ

Tracks the module-level alias shade cache origin z state owned by `miniquake.render.entities`.

View source

aliasShadeCacheReceiverHit

aliasShadeCacheReceiverHit

Tracks the module-level alias shade cache receiver hit state owned by `miniquake.render.entities`.

View source

aliasShadeCacheShade

aliasShadeCacheShade

Tracks the module-level alias shade cache shade state owned by `miniquake.render.entities`.

View source

aliasShadeCacheSpot

aliasShadeCacheSpot

Tracks the module-level alias shade cache spot state owned by `miniquake.render.entities`.

View source

aliasShadeCacheStamp

aliasShadeCacheStamp

Tracks the module-level alias shade cache stamp state owned by `miniquake.render.entities`.

View source

aliasShadeCacheValid

aliasShadeCacheValid

Tracks the module-level alias shade cache valid state owned by `miniquake.render.entities`.

View source

aliasShadeCacheViewModel

aliasShadeCacheViewModel

Tracks the module-level alias shade cache view model state owned by `miniquake.render.entities`.

View source

aliasShadowQuality

aliasShadowQuality

Tracks the module-level alias shadow quality state owned by `miniquake.render.entities`.

View source

aliasShadows

aliasShadows

Tracks the module-level alias shadows state owned by `miniquake.render.entities`.

View source

aliasSmoothModels

aliasSmoothModels

Tracks the module-level alias smooth models state owned by `miniquake.render.entities`.

View source

aliasVertex

function aliasVertex(source, packed)

Implements the `aliasVertex` operation for `miniquake.render.entities` (alias vertex).

ParameterTypeDefaultDescription
sourcedynamic—Source value or collection to read.
packeddynamic—The packed input consumed by `aliasVertex`.

View source

brushModelIndex

function brushModelIndex(name)

Return brush model index derived from the active module state.

ParameterTypeDefaultDescription
namedynamic—Stable name that identifies the requested object or option.

View source

brushRendererForModel

function brushRendererForModel(model)

Implements the `brushRendererForModel` operation for `miniquake.render.entities` (brush renderer for model).

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.

View source

brushShadowSource

function brushShadowSource(entity, time)

Select the dynamic light with the strongest local contribution and retain its world-space source for BSP ray projection. When no live point light reaches the object, the projector uses a stable directional fallback.

ParameterTypeDefaultDescription
entitydynamic—Entity affected by the operation.
timedynamic—Simulation or presentation time for the operation.

View source

brushShadowSourceScratch

brushShadowSourceScratch

Tracks the module-level brush shadow source scratch state owned by `miniquake.render.entities`.

View source

ConfigureAliasRendering

function ConfigureAliasRendering(smoothModels, affineModels, shadows, noColors, doubleEyes)

Update subsystem configuration for configure alias rendering.

ParameterTypeDefaultDescription
smoothModelsdynamic—The smooth models input consumed by `ConfigureAliasRendering`.
affineModelsdynamic—The affine models input consumed by `ConfigureAliasRendering`.
shadowsdynamic—The shadows input consumed by `ConfigureAliasRendering`.
noColorsdynamic—The no colors input consumed by `ConfigureAliasRendering`.
doubleEyesdynamic—The double eyes input consumed by `ConfigureAliasRendering`.

View source

configureAliasShadowSource

function configureAliasShadowSource(entity, enabled, lightX, lightY, lightZ)

Transform the strongest world-space point light into the alias model's yaw-local coordinates used by the projected silhouette routine.

ParameterTypeDefaultDescription
entitydynamic—Entity affected by the operation.
enableddynamic—Whether the optional behavior is enabled.
lightXdynamic—The light x input consumed by `configureAliasShadowSource`.
lightYdynamic—The light y input consumed by `configureAliasShadowSource`.
lightZdynamic—The light z input consumed by `configureAliasShadowSource`.

View source

ConfigureEnhancedShadowQuality

function ConfigureEnhancedShadowQuality(value)

Configure the backend-neutral projected-shadow sampling level.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `ConfigureEnhancedShadowQuality`.

View source

ConfigureModelInterpolation

function ConfigureModelInterpolation(enabled)

Enable or disable temporal interpolation between consecutive MDL poses.

ParameterTypeDefaultDescription
enableddynamic—Whether the optional behavior is enabled.

View source

create

function create(filesystem, palette, modelPrecache)

Implements the `create` operation for `miniquake.render.entities` (create).

ParameterTypeDefaultDescription
filesystemdynamic—The filesystem input consumed by `create`.
palettedynamic—The palette input consumed by `create`.
modelPrecachedynamic—The model precache input consumed by `create`.

View source

cycleIndex

function cycleIndex(intervals, time, count)

Return cycle index derived from the active module state.

ParameterTypeDefaultDescription
intervalsdynamic—The intervals input consumed by `cycleIndex`.
timedynamic—Simulation or presentation time for the operation.
countdynamic—Number of entries or units to process.

View source

destroy

function destroy(renderer)

Implements the `destroy` operation for `miniquake.render.entities` (destroy).

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.

View source

drawAlias

function drawAlias(renderer, model, entity, time, viewModel, enhancedOverlay)

Render alias.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
modeldynamic—Model resource processed by the operation.
entitydynamic—Entity affected by the operation.
timedynamic—Simulation or presentation time for the operation.
viewModeldynamic—The view model input consumed by `drawAlias`.
enhancedOverlaydynamic—The enhanced overlay input consumed by `drawAlias`.

View source

drawBrush

function drawBrush(worldRendererValue, model, entity, time)

Render brush.

ParameterTypeDefaultDescription
worldRendererValuedynamic—The world renderer value input consumed by `drawBrush`.
modeldynamic—Model resource processed by the operation.
entitydynamic—Entity affected by the operation.
timedynamic—Simulation or presentation time for the operation.

View source

drawBrushEnhanced

function drawBrushEnhanced(worldRendererValue, model, entity, time)

Render one brush entity without its classic lightmap pass so the optional additive GPU program can light the geometry exactly once.

ParameterTypeDefaultDescription
worldRendererValuedynamic—The world renderer value input consumed by `drawBrushEnhanced`.
modeldynamic—Model resource processed by the operation.
entitydynamic—Entity affected by the operation.
timedynamic—Simulation or presentation time for the operation.

View source

drawBrushShadow

function drawBrushShadow(worldRendererValue, model, entity, time)

Render a backend-neutral soft footprint for BSP pickups, crates, doors and platforms. Sprite effects stay emissive and intentionally cast no shadow.

ParameterTypeDefaultDescription
worldRendererValuedynamic—The world renderer value input consumed by `drawBrushShadow`.
modeldynamic—Model resource processed by the operation.
entitydynamic—Entity affected by the operation.
timedynamic—Simulation or presentation time for the operation.

View source

drawBrushShadowSample

function drawBrushShadowSample(worldRendererValue, model, entity, floorWorldZ, source, offsetX, offsetY, contactOnly)

Draw one projected footprint sample for either an external pickup BSP or an inline moving brush model.

ParameterTypeDefaultDescription
worldRendererValuedynamic—The world renderer value input consumed by `drawBrushShadowSample`.
modeldynamic—Model resource processed by the operation.
entitydynamic—Entity affected by the operation.
floorWorldZdynamic—The floor world z input consumed by `drawBrushShadowSample`.
sourcedynamic—Source value or collection to read.
offsetXdynamic—The offset x input consumed by `drawBrushShadowSample`.
offsetYdynamic—The offset y input consumed by `drawBrushShadowSample`.
contactOnlydynamic—The contact only input consumed by `drawBrushShadowSample`.

View source

drawSprite

function drawSprite(renderer, model, entity, viewRight, viewUp, time)

Render sprite.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
modeldynamic—Model resource processed by the operation.
entitydynamic—Entity affected by the operation.
viewRightdynamic—The view right input consumed by `drawSprite`.
viewUpdynamic—The view up input consumed by `drawSprite`.
timedynamic—Simulation or presentation time for the operation.

View source

emptyModel

function emptyModel(name, kind)

Implements the `emptyModel` operation for `miniquake.render.entities` (empty model).

ParameterTypeDefaultDescription
namedynamic—Stable name that identifies the requested object or option.
kinddynamic—The kind input consumed by `emptyModel`.

View source

endsWithInsensitive

function endsWithInsensitive(text, suffix)

Finalize state for ends with insensitive.

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.
suffixdynamic—The suffix input consumed by `endsWithInsensitive`.

View source

externalBrushForName

function externalBrushForName(name)

Return external brush for name derived from the active module state.

ParameterTypeDefaultDescription
namedynamic—Stable name that identifies the requested object or option.

View source

externalBrushRendererNames

externalBrushRendererNames

Tracks the module-level external brush renderer names state owned by `miniquake.render.entities`.

View source

externalBrushRendererRoots

externalBrushRendererRoots

Root complete external renderers (map, textures, surfaces and lightmaps) for the lifetime of the entity renderer. These are independent BSP models and therefore are not owned by the active WorldRenderer.

View source

finishEnhancedEntityOverlay

function finishEnhancedEntityOverlay()

Restore compatibility blend/depth state after any enhanced entity replay, including error exits from malformed external models.

View source

loadModel

function loadModel(renderer, name)

Read and validate model.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
namedynamic—Stable name that identifies the requested object or option.

View source

loadWorldModel

function loadWorldModel(renderer, name)

Read and validate world model.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
namedynamic—Stable name that identifies the requested object or option.

View source

MODEL_ALIAS

const MODEL_ALIAS = 2

Defines the model alias value used by `miniquake.render.entities`.

View source

MODEL_BRUSH

const MODEL_BRUSH = 1

Defines the model brush value used by `miniquake.render.entities`.

View source

MODEL_NONE

const MODEL_NONE = 0

Defines the model none value used by `miniquake.render.entities`.

View source

MODEL_SPRITE

const MODEL_SPRITE = 3

Defines the model sprite value used by `miniquake.render.entities`.

View source

objectShadowFloorZ

function objectShadowFloorZ(worldRendererValue, entity)

Resolve a stable receiver height from the main BSP beneath an object. A production miss must suppress the shadow: lightspot retains reusable storage and may still contain another entity's receiver from an earlier trace.

ParameterTypeDefaultDescription
worldRendererValuedynamic—The world renderer value input consumed by `objectShadowFloorZ`.
entitydynamic—Entity affected by the operation.

View source

precache

function precache(renderer)

Preload and register the the requested value asset.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.

View source

render

function render(renderer, worldRendererValue, entities, viewEntity, viewRight, viewUp, time)

Implements the `render` operation for `miniquake.render.entities` (render).

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
worldRendererValuedynamic—The world renderer value input consumed by `render`.
entitiesdynamic—The entities input consumed by `render`.
viewEntitydynamic—The view entity input consumed by `render`.
viewRightdynamic—The view right input consumed by `render`.
viewUpdynamic—The view up input consumed by `render`.
timedynamic—Simulation or presentation time for the operation.

View source

renderEnhancedSubmitted

function renderEnhancedSubmitted(renderer, worldRendererValue, entities, hiddenEntityNumber, time)

Draw the entity portion of the optional additive per-pixel light layer. Sprites remain emissive/alpha-tested and intentionally do not receive it.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
worldRendererValuedynamic—The world renderer value input consumed by `renderEnhancedSubmitted`.
entitiesdynamic—The entities input consumed by `renderEnhancedSubmitted`.
hiddenEntityNumberdynamic—The hidden entity number input consumed by `renderEnhancedSubmitted`.
timedynamic—Simulation or presentation time for the operation.

View source

renderModelRegistry

renderModelRegistry

Tracks the module-level render model registry state owned by `miniquake.render.entities`.

View source

renderSubmitted

function renderSubmitted(renderer, worldRendererValue, entities, hiddenEntityNumber, viewRight, viewUp, time)

Render submitted.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
worldRendererValuedynamic—The world renderer value input consumed by `renderSubmitted`.
entitiesdynamic—The entities input consumed by `renderSubmitted`.
hiddenEntityNumberdynamic—The hidden entity number input consumed by `renderSubmitted`.
viewRightdynamic—The view right input consumed by `renderSubmitted`.
viewUpdynamic—The view up input consumed by `renderSubmitted`.
timedynamic—Simulation or presentation time for the operation.

View source

renderViewModel

function renderViewModel(renderer, player, view, time)

Render view model.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
playerdynamic—The player input consumed by `renderViewModel`.
viewdynamic—The view input consumed by `renderViewModel`.
timedynamic—Simulation or presentation time for the operation.

View source

renderViewModelEnhanced

function renderViewModelEnhanced(renderer, player, view, time)

Add per-pixel dynamic light to the first-person weapon using the same compressed depth range as the classic viewmodel draw.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
playerdynamic—The player input consumed by `renderViewModelEnhanced`.
viewdynamic—The view input consumed by `renderViewModelEnhanced`.
timedynamic—Simulation or presentation time for the operation.

View source

resetAliasPoseCache

function resetAliasPoseCache()

Reset per-entity MDL pose history at every map/renderer transition.

View source

resetAliasShadeCache

function resetAliasShadeCache()

Update module state for alias shade cache.

View source

setTranslatedPlayerTexture

function setTranslatedPlayerTexture(entityNumber, texture)

Update module state for translated player texture.

ParameterTypeDefaultDescription
entityNumberdynamic—The entity number input consumed by `setTranslatedPlayerTexture`.
texturedynamic—Texture resource processed by the operation.

View source

SPR_ORIENTED

const SPR_ORIENTED = 3

Defines the spr oriented value used by `miniquake.render.entities`.

View source

spriteFrameAndTexture

function spriteFrameAndTexture(model, entity, time)

Implements the `spriteFrameAndTexture` operation for `miniquake.render.entities` (sprite frame and texture).

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.
entitydynamic—Entity affected by the operation.
timedynamic—Simulation or presentation time for the operation.

View source

startsWith

function startsWith(text, prefix)

Starts s with for `miniquake.render.entities`.

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.
prefixdynamic—The prefix input consumed by `startsWith`.

View source

synchronize

function synchronize(renderer, modelPrecache)

Update module state for the requested value.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
modelPrecachedynamic—The model precache input consumed by `synchronize`.

View source

translatedPlayerTexture

inline function translatedPlayerTexture(entityNumber)

Implements the `translatedPlayerTexture` operation for `miniquake.render.entities` (translated player texture).

ParameterTypeDefaultDescription
entityNumberdynamic—The entity number input consumed by `translatedPlayerTexture`.

View source

translatedPlayerTextures

translatedPlayerTextures

Tracks the module-level translated player textures state owned by `miniquake.render.entities`.

View source

upload

function upload(renderer, model)

Upload the requested value to the active renderer.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
modeldynamic—Model resource processed by the operation.

View source

uploadAlias

function uploadAlias(renderer, model)

Upload alias to the active renderer.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
modeldynamic—Model resource processed by the operation.

View source

uploadIndexedTexture

function uploadIndexedTexture(width, height, pixels, palette, transparent)

Upload indexed texture to the active renderer.

ParameterTypeDefaultDescription
widthdynamic—Requested width in pixels or data units.
heightdynamic—Requested height in pixels or data units.
pixelsdynamic—The pixels input consumed by `uploadIndexedTexture`.
palettedynamic—The palette input consumed by `uploadIndexedTexture`.
transparentdynamic—The transparent input consumed by `uploadIndexedTexture`.

View source

uploadSprite

function uploadSprite(renderer, model)

Upload sprite to the active renderer.

ParameterTypeDefaultDescription
rendererdynamic—Renderer instance or backend used for drawing.
modeldynamic—Model resource processed by the operation.

View source

viewModelDepthRange

function viewModelDepthRange(depthMin, depthMax)

R_DrawViewModel / V_CalcRefdef. The gun is a normal alias model drawn from the view entity, with a compressed depth range so it cannot poke through nearby world surfaces.

ParameterTypeDefaultDescription
depthMindynamic—The depth min input consumed by `viewModelDepthRange`.
depthMaxdynamic—The depth max input consumed by `viewModelDepthRange`.

View source

viewModelScratch

viewModelScratch

Tracks the module-level view model scratch state owned by `miniquake.render.entities`.

View source