# absolute
function absolute(value)Implements the `absolute` operation for `miniquake.view` (absolute).
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `absolute`. |
src/miniquake/view.mlminiquake/common.ml as common → src/miniquake/common.mlminiquake/constants.ml as c → src/miniquake/constants.mlminiquake/cvar.ml as cvar → src/miniquake/cvar.mlminiquake/mathlib.ml as math → src/miniquake/mathlib.mlminiquake/native.ml as native → src/miniquake/native.mlminiquake/types.ml as t → src/miniquake/types.mlstd/math.ml as stdmath → ../MiniLangCompilerOptimization/MiniLangCompilerPy/std/math.ml external dependencyfunction absolute(value)Implements the `absolute` operation for `miniquake.view` (absolute).
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `absolute`. |
function addDamage(state, count, fromDirection, viewAngles, kickRoll, kickPitch, kickTime)Compatibility entry points retained for the existing focused tests.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `addDamage`. |
count | dynamic | — | Number of entries or units to process. |
fromDirection | dynamic | — | The from direction input consumed by `addDamage`. |
viewAngles | dynamic | — | The view angles input consumed by `addDamage`. |
kickRoll | dynamic | — | The kick roll input consumed by `addDamage`. |
kickPitch | dynamic | — | The kick pitch input consumed by `addDamage`. |
kickTime | dynamic | — | Time value used by the operation. |
function angledelta(angle)Implements the `angledelta` operation for `miniquake.view` (angledelta).
| Parameter | Type | Default | Description |
|---|---|---|---|
angle | dynamic | — | The angle input consumed by `angledelta`. |
function BuildGammaTable(state, gamma)Create and initialize gamma table.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `BuildGammaTable`. |
gamma | dynamic | — | The gamma input consumed by `BuildGammaTable`. |
function calcBob(time, velocity, bobAmount, bobCycle, bobUp)Implements the `calcBob` operation for `miniquake.view` (calc bob).
| Parameter | Type | Default | Description |
|---|---|---|---|
time | dynamic | — | Simulation or presentation time for the operation. |
velocity | dynamic | — | Velocity applied by the operation. |
bobAmount | dynamic | — | The bob amount input consumed by `calcBob`. |
bobCycle | dynamic | — | The bob cycle input consumed by `calcBob`. |
bobUp | dynamic | — | The bob up input consumed by `calcBob`. |
function CalcGunAngle(state, clientTime, frameTime, idleScale, yawCycle, rollCycle, pitchCycle, yawLevel, rollLevel, pitchLevel)Implements the `CalcGunAngle` operation for `miniquake.view` (calc gun angle).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `CalcGunAngle`. |
clientTime | dynamic | — | Time value used by the operation. |
frameTime | dynamic | — | Time value used by the operation. |
idleScale | dynamic | — | The idle scale input consumed by `CalcGunAngle`. |
yawCycle | dynamic | — | The yaw cycle input consumed by `CalcGunAngle`. |
rollCycle | dynamic | — | The roll cycle input consumed by `CalcGunAngle`. |
pitchCycle | dynamic | — | The pitch cycle input consumed by `CalcGunAngle`. |
yawLevel | dynamic | — | The yaw level input consumed by `CalcGunAngle`. |
rollLevel | dynamic | — | The roll level input consumed by `CalcGunAngle`. |
pitchLevel | dynamic | — | The pitch level input consumed by `CalcGunAngle`. |
function calcRoll(angles, velocity, rollAngle, rollSpeed)Implements the `calcRoll` operation for `miniquake.view` (calc roll).
| Parameter | Type | Default | Description |
|---|---|---|---|
angles | dynamic | — | Orientation angles used by the operation. |
velocity | dynamic | — | Velocity applied by the operation. |
rollAngle | dynamic | — | The roll angle input consumed by `calcRoll`. |
rollSpeed | dynamic | — | The roll speed input consumed by `calcRoll`. |
function calculate(state, player, cameraAngles, clientTime, frameTime, bobAmount, bobCycle, bobUp, rollAngle, rollSpeed, kickTime)Compute the requested value.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `calculate`. |
player | dynamic | — | The player input consumed by `calculate`. |
cameraAngles | dynamic | — | The camera angles input consumed by `calculate`. |
clientTime | dynamic | — | Time value used by the operation. |
frameTime | dynamic | — | Time value used by the operation. |
bobAmount | dynamic | — | The bob amount input consumed by `calculate`. |
bobCycle | dynamic | — | The bob cycle input consumed by `calculate`. |
bobUp | dynamic | — | The bob up input consumed by `calculate`. |
rollAngle | dynamic | — | The roll angle input consumed by `calculate`. |
rollSpeed | dynamic | — | The roll speed input consumed by `calculate`. |
kickTime | dynamic | — | Time value used by the operation. |
function create()Implements the `create` operation for `miniquake.view` (create).
const CSHIFT_BONUS = 2Defines the cshift bonus value used by `miniquake.view`.
const CSHIFT_CONTENTS = 0Defines the cshift contents value used by `miniquake.view`.
const CSHIFT_DAMAGE = 1Defines the cshift damage value used by `miniquake.view`.
const CSHIFT_POWERUP = 3Defines the cshift powerup value used by `miniquake.view`.
function decayDamage(state, frameTime, kickTime)Implements the `decayDamage` operation for `miniquake.view` (decay damage).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `decayDamage`. |
frameTime | dynamic | — | Time value used by the operation. |
kickTime | dynamic | — | Time value used by the operation. |
function emptyGamma()Implements the `emptyGamma` operation for `miniquake.view` (empty gamma).
function emptyRamps()Implements the `emptyRamps` operation for `miniquake.view` (empty ramps).
const NUM_CSHIFTS = 4Defines the num cshifts value used by `miniquake.view`.
const PI = 3.14159265358979Defines the pi value used by `miniquake.view`.
function reset(state, playerOrigin)Implements the `reset` operation for `miniquake.view` (reset).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `reset`. |
playerOrigin | dynamic | — | The player origin input consumed by `reset`. |
function smoothStairStep(state, player, frameTime)Implements the `smoothStairStep` operation for `miniquake.view` (smooth stair step).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `smoothStairStep`. |
player | dynamic | — | The player input consumed by `smoothStairStep`. |
frameTime | dynamic | — | Time value used by the operation. |
function V_AddIdle(state, clientTime, idleScale, yawCycle, rollCycle, pitchCycle, yawLevel, rollLevel, pitchLevel)Mirror Quake's V_AddIdle routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_AddIdle`. |
clientTime | dynamic | — | Time value used by the operation. |
idleScale | dynamic | — | The idle scale input consumed by `V_AddIdle`. |
yawCycle | dynamic | — | The yaw cycle input consumed by `V_AddIdle`. |
rollCycle | dynamic | — | The roll cycle input consumed by `V_AddIdle`. |
pitchCycle | dynamic | — | The pitch cycle input consumed by `V_AddIdle`. |
yawLevel | dynamic | — | The yaw level input consumed by `V_AddIdle`. |
rollLevel | dynamic | — | The roll level input consumed by `V_AddIdle`. |
pitchLevel | dynamic | — | The pitch level input consumed by `V_AddIdle`. |
function V_BonusFlash_f(state)Mirror Quake's V_BonusFlash_f routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_BonusFlash_f`. |
function V_BoundOffsets(state, entityOrigin)Mirror Quake's V_BoundOffsets routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_BoundOffsets`. |
entityOrigin | dynamic | — | The entity origin input consumed by `V_BoundOffsets`. |
function V_CalcBlend(state, cshiftPercent)Mirror Quake's V_CalcBlend routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_CalcBlend`. |
cshiftPercent | dynamic | — | The cshift percent input consumed by `V_CalcBlend`. |
function V_CalcBob(time, velocity, bobAmount, bobCycle, bobUp)Mirror Quake's V_CalcBob routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
time | dynamic | — | Simulation or presentation time for the operation. |
velocity | dynamic | — | Velocity applied by the operation. |
bobAmount | dynamic | — | The bob amount input consumed by `V_CalcBob`. |
bobCycle | dynamic | — | The bob cycle input consumed by `V_CalcBob`. |
bobUp | dynamic | — | The bob up input consumed by `V_CalcBob`. |
function V_CalcIntermissionRefdef(state, player, clientTime, yawCycle, rollCycle, pitchCycle, yawLevel, rollLevel, pitchLevel)Mirror Quake's V_CalcIntermissionRefdef routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_CalcIntermissionRefdef`. |
player | dynamic | — | The player input consumed by `V_CalcIntermissionRefdef`. |
clientTime | dynamic | — | Time value used by the operation. |
yawCycle | dynamic | — | The yaw cycle input consumed by `V_CalcIntermissionRefdef`. |
rollCycle | dynamic | — | The roll cycle input consumed by `V_CalcIntermissionRefdef`. |
pitchCycle | dynamic | — | The pitch cycle input consumed by `V_CalcIntermissionRefdef`. |
yawLevel | dynamic | — | The yaw level input consumed by `V_CalcIntermissionRefdef`. |
rollLevel | dynamic | — | The roll level input consumed by `V_CalcIntermissionRefdef`. |
pitchLevel | dynamic | — | The pitch level input consumed by `V_CalcIntermissionRefdef`. |
function V_CalcPowerupCshift(state, items)Mirror Quake's V_CalcPowerupCshift routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_CalcPowerupCshift`. |
items | dynamic | — | The items input consumed by `V_CalcPowerupCshift`. |
function V_CalcRefdef(state, player, viewAngles, idealPitch, forwardMove, forwardSpeed, clientTime, frameTime, stepFrameTime, demoPlayback, registry)Mirror Quake's V_CalcRefdef routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_CalcRefdef`. |
player | dynamic | — | The player input consumed by `V_CalcRefdef`. |
viewAngles | dynamic | — | The view angles input consumed by `V_CalcRefdef`. |
idealPitch | dynamic | — | The ideal pitch input consumed by `V_CalcRefdef`. |
forwardMove | dynamic | — | The forward move input consumed by `V_CalcRefdef`. |
forwardSpeed | dynamic | — | The forward speed input consumed by `V_CalcRefdef`. |
clientTime | dynamic | — | Time value used by the operation. |
frameTime | dynamic | — | Time value used by the operation. |
stepFrameTime | dynamic | — | Time value used by the operation. |
demoPlayback | dynamic | — | The demo playback input consumed by `V_CalcRefdef`. |
registry | dynamic | — | The registry input consumed by `V_CalcRefdef`. |
function V_CalcRoll(angles, velocity, rollAngle, rollSpeed)V_CalcRoll is also consumed by sv_user.c in the original engine.
| Parameter | Type | Default | Description |
|---|---|---|---|
angles | dynamic | — | Orientation angles used by the operation. |
velocity | dynamic | — | Velocity applied by the operation. |
rollAngle | dynamic | — | The roll angle input consumed by `V_CalcRoll`. |
rollSpeed | dynamic | — | The roll speed input consumed by `V_CalcRoll`. |
function V_CalcViewRoll(state, entityAngles, velocity, health, frameTime, rollAngle, rollSpeed, kickTime)Mirror Quake's V_CalcViewRoll routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_CalcViewRoll`. |
entityAngles | dynamic | — | The entity angles input consumed by `V_CalcViewRoll`. |
velocity | dynamic | — | Velocity applied by the operation. |
health | dynamic | — | The health input consumed by `V_CalcViewRoll`. |
frameTime | dynamic | — | Time value used by the operation. |
rollAngle | dynamic | — | The roll angle input consumed by `V_CalcViewRoll`. |
rollSpeed | dynamic | — | The roll speed input consumed by `V_CalcViewRoll`. |
kickTime | dynamic | — | Time value used by the operation. |
function V_CheckGamma(state, gamma)Mirror Quake's V_CheckGamma routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_CheckGamma`. |
gamma | dynamic | — | The gamma input consumed by `V_CheckGamma`. |
function V_ClearClientState(state)The cl-owned fields used by view.c are cleared by CL_ClearState's memset. Renderer statics (oldz, old gun angles, damage kick globals, gamma state and the user-configurable cshift_empty) intentionally survive map changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_ClearClientState`. |
function V_CommandTrace(state)Mirror Quake's V_CommandTrace routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_CommandTrace`. |
function V_cshift_f(state, arguments)Mirror Quake's V_cshift_f routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_cshift_f`. |
arguments | dynamic | — | Command-line arguments to inspect or execute. |
function V_DriftPitch(state, viewAngles, idealPitch, forwardMove, forwardSpeed, frameTime, clientTime, centerMove, centerSpeed, noclipAngleHack, onGround, demoPlayback)Mirror Quake's V_DriftPitch routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_DriftPitch`. |
viewAngles | dynamic | — | The view angles input consumed by `V_DriftPitch`. |
idealPitch | dynamic | — | The ideal pitch input consumed by `V_DriftPitch`. |
forwardMove | dynamic | — | The forward move input consumed by `V_DriftPitch`. |
forwardSpeed | dynamic | — | The forward speed input consumed by `V_DriftPitch`. |
frameTime | dynamic | — | Time value used by the operation. |
clientTime | dynamic | — | Time value used by the operation. |
centerMove | dynamic | — | The center move input consumed by `V_DriftPitch`. |
centerSpeed | dynamic | — | The center speed input consumed by `V_DriftPitch`. |
noclipAngleHack | dynamic | — | The noclip angle hack input consumed by `V_DriftPitch`. |
onGround | dynamic | — | The on ground input consumed by `V_DriftPitch`. |
demoPlayback | dynamic | — | The demo playback input consumed by `V_DriftPitch`. |
function V_Init(state)Mirror Quake's V_Init routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_Init`. |
function V_ParseDamage(state, armor, blood, source, entityOrigin, entityAngles, kickRoll, kickPitch, kickTime)Mirror Quake's V_ParseDamage routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_ParseDamage`. |
armor | dynamic | — | The armor input consumed by `V_ParseDamage`. |
blood | dynamic | — | The blood input consumed by `V_ParseDamage`. |
source | dynamic | — | Source value or collection to read. |
entityOrigin | dynamic | — | The entity origin input consumed by `V_ParseDamage`. |
entityAngles | dynamic | — | The entity angles input consumed by `V_ParseDamage`. |
kickRoll | dynamic | — | The kick roll input consumed by `V_ParseDamage`. |
kickPitch | dynamic | — | The kick pitch input consumed by `V_ParseDamage`. |
kickTime | dynamic | — | Time value used by the operation. |
function V_RenderView(state, player, client, registry, frameTime, paused, demoPlayback, intermission, forcedConsole)Mirror Quake's V_RenderView routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_RenderView`. |
player | dynamic | — | The player input consumed by `V_RenderView`. |
client | dynamic | — | Client state participating in the operation. |
registry | dynamic | — | The registry input consumed by `V_RenderView`. |
frameTime | dynamic | — | Time value used by the operation. |
paused | dynamic | — | The paused input consumed by `V_RenderView`. |
demoPlayback | dynamic | — | The demo playback input consumed by `V_RenderView`. |
intermission | dynamic | — | The intermission input consumed by `V_RenderView`. |
forcedConsole | dynamic | — | The forced console input consumed by `V_RenderView`. |
function V_SetContentsColor(state, contents)Mirror Quake's V_SetContentsColor routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_SetContentsColor`. |
contents | dynamic | — | The contents input consumed by `V_SetContentsColor`. |
function V_StartPitchDrift(state, clientTime, centerSpeed)Mirror Quake's V_StartPitchDrift routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_StartPitchDrift`. |
clientTime | dynamic | — | Time value used by the operation. |
centerSpeed | dynamic | — | The center speed input consumed by `V_StartPitchDrift`. |
function V_StopPitchDrift(state, clientTime)Mirror Quake's V_StopPitchDrift routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_StopPitchDrift`. |
clientTime | dynamic | — | Time value used by the operation. |
function V_UpdatePalette(state, items, frameTime, cshiftPercent, gamma)This is the GLQUAKE V_UpdatePalette path. It also constructs the original three gamma ramps so a diagnostic build can compare the software-palette result without asking the platform bridge to own game policy.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.view` state used by `V_UpdatePalette`. |
items | dynamic | — | The items input consumed by `V_UpdatePalette`. |
frameTime | dynamic | — | Time value used by the operation. |
cshiftPercent | dynamic | — | The cshift percent input consumed by `V_UpdatePalette`. |
gamma | dynamic | — | The gamma input consumed by `V_UpdatePalette`. |
viewTraceEmptyV_RenderView's compatibility trace contains only fixed stage names. Share the immutable variants instead of rebuilding nested arrays every frame.
viewTraceIntermissionTracks the module-level view trace intermission state owned by `miniquake.view`.
viewTraceIntermissionStereoTracks the module-level view trace intermission stereo state owned by `miniquake.view`.
viewTracePausedTracks the module-level view trace paused state owned by `miniquake.view`.
viewTracePausedStereoTracks the module-level view trace paused stereo state owned by `miniquake.view`.
viewTraceRefdefTracks the module-level view trace refdef state owned by `miniquake.view`.
viewTraceRefdefStereoTracks the module-level view trace refdef stereo state owned by `miniquake.view`.