MiniQuake

src/miniquake/particles.ml

Package
miniquake.particles
Reachable
Yes

Imports

Declarations

ABSOLUTE_MIN_PARTICLES

const ABSOLUTE_MIN_PARTICLES = 512

Defines the absolute min particles value used by `miniquake.particles`.

View source

appendLimited

function appendLimited(target, source)

Add state for append limited.

ParameterTypeDefaultDescription
targetdynamic—The target input consumed by `appendLimited`.
sourcedynamic—Source value or collection to read.

View source

blobExplosion

function blobExplosion(origin, currentTime)

Implements the `blobExplosion` operation for `miniquake.particles` (blob explosion).

ParameterTypeDefaultDescription
origindynamic—World-space origin of the operation.
currentTimedynamic—Time value used by the operation.

View source

canonicalEntityNormals

function canonicalEntityNormals()

Returns whether `miniquake.particles` can onical entity normals.

View source

canonicalVertexNormals

canonicalVertexNormals

Tracks the module-level canonical vertex normals state owned by `miniquake.particles`.

View source

compatAngularVelocities

compatAngularVelocities

Tracks the module-level compat angular velocities state owned by `miniquake.particles`.

View source

compatibilitySystem

function compatibilitySystem()

Implements the `compatibilitySystem` operation for `miniquake.particles` (compatibility system).

View source

compatibilitySystemWithActive

function compatibilitySystemWithActive(active)

Report whether compatibility system with active holds for the active state.

ParameterTypeDefaultDescription
activedynamic—The active input consumed by `compatibilitySystemWithActive`.

View source

compatRand

function compatRand()

Implements the `compatRand` operation for `miniquake.particles` (compat rand).

View source

compatRandomSeed

compatRandomSeed

Tracks the module-level compat random seed state owned by `miniquake.particles`.

View source

compatTracerCount

compatTracerCount

Tracks the module-level compat tracer count state owned by `miniquake.particles`.

View source

createSystem

function createSystem(capacity)

Create and initialize system.

ParameterTypeDefaultDescription
capacitydynamic—Maximum number of entries the destination can hold.

View source

entityParticlesInto

function entityParticlesInto(active, entityOrigin, currentTime)

CL_RelinkEntities shares r_part.c's single active/free particle pool with temp entities. These integration helpers operate on that existing pool so saturation stops allocation (and random-number consumption) at the same particle as the original linked-list implementation.

ParameterTypeDefaultDescription
activedynamic—The active input consumed by `entityParticlesInto`.
entityOrigindynamic—The entity origin input consumed by `entityParticlesInto`.
currentTimedynamic—Time value used by the operation.

View source

explosion

function explosion(origin, currentTime)

Implements the `explosion` operation for `miniquake.particles` (explosion).

ParameterTypeDefaultDescription
origindynamic—World-space origin of the operation.
currentTimedynamic—Time value used by the operation.

View source

explosion2

function explosion2(origin, colorStart, colorLength, currentTime)

Implements the `explosion2` operation for `miniquake.particles` (explosion2).

ParameterTypeDefaultDescription
origindynamic—World-space origin of the operation.
colorStartdynamic—The color start input consumed by `explosion2`.
colorLengthdynamic—Length of the requested data in units appropriate to the operation.
currentTimedynamic—Time value used by the operation.

View source

finishCompatibility

function finishCompatibility(system)

Finalize state for finish compatibility.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `finishCompatibility`.

View source

initializeAngularVelocities

function initializeAngularVelocities(system, count)

Initialize state for initialize angular velocities.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `initializeAngularVelocities`.
countdynamic—Number of entries or units to process.

View source

lavaSplash

function lavaSplash(origin, currentTime)

Implements the `lavaSplash` operation for `miniquake.particles` (lava splash).

ParameterTypeDefaultDescription
origindynamic—World-space origin of the operation.
currentTimedynamic—Time value used by the operation.

View source

MAX_PARTICLES

const MAX_PARTICLES = 2048

Defines the max particles value used by `miniquake.particles`.

View source

NUM_VERTEX_NORMALS

const NUM_VERTEX_NORMALS = 162

Defines the num vertex normals value used by `miniquake.particles`.

View source

particleDrawCommand

function particleDrawCommand(particle, viewOrigin, viewForward, scaledUp, scaledRight)

Implements the `particleDrawCommand` operation for `miniquake.particles` (particle draw command).

ParameterTypeDefaultDescription
particledynamic—The particle input consumed by `particleDrawCommand`.
viewOrigindynamic—The view origin input consumed by `particleDrawCommand`.
viewForwarddynamic—The view forward input consumed by `particleDrawCommand`.
scaledUpdynamic—The scaled up input consumed by `particleDrawCommand`.
scaledRightdynamic—The scaled right input consumed by `particleDrawCommand`.

View source

particleFloat

function particleFloat(value)

Implements the `particleFloat` operation for `miniquake.particles` (particle float).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `particleFloat`.

View source

miniquake.particles.ParticleSystem struct

pointEffect

function pointEffect(origin, count, color, currentTime)

Implements the `pointEffect` operation for `miniquake.particles` (point effect).

ParameterTypeDefaultDescription
origindynamic—World-space origin of the operation.
countdynamic—Number of entries or units to process.
colordynamic—Color value used by the operation.
currentTimedynamic—Time value used by the operation.

View source

PT_BLOB

const PT_BLOB = 6

Defines the pt blob value used by `miniquake.particles`.

View source

PT_BLOB2

const PT_BLOB2 = 7

Defines the pt blob2 value used by `miniquake.particles`.

View source

PT_EXPLODE

const PT_EXPLODE = 4

Defines the pt explode value used by `miniquake.particles`.

View source

PT_EXPLODE2

const PT_EXPLODE2 = 5

Defines the pt explode2 value used by `miniquake.particles`.

View source

PT_FIRE

const PT_FIRE = 3

Defines the pt fire value used by `miniquake.particles`.

View source

PT_GRAVITY

const PT_GRAVITY = 1

Defines the pt gravity value used by `miniquake.particles`.

View source

PT_SLOW_GRAVITY

const PT_SLOW_GRAVITY = 2

Defines the pt slow gravity value used by `miniquake.particles`.

View source

PT_STATIC

const PT_STATIC = 0

Defines the pt static value used by `miniquake.particles`.

View source

R_AllocParticle

function R_AllocParticle(system)

Apply the Quake-compatible r alloc particle behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_AllocParticle`.

View source

R_BlobExplosion

function R_BlobExplosion(system, origin, currentTime)

Apply the Quake-compatible r blob explosion behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_BlobExplosion`.
origindynamic—World-space origin of the operation.
currentTimedynamic—Time value used by the operation.

View source

R_ClearParticles

function R_ClearParticles(system)

Apply the Quake-compatible r clear particles behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_ClearParticles`.

View source

R_DarkFieldParticles

function R_DarkFieldParticles(system, entityOrigin, currentTime)

Apply the Quake-compatible r dark field particles behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_DarkFieldParticles`.
entityOrigindynamic—The entity origin input consumed by `R_DarkFieldParticles`.
currentTimedynamic—Time value used by the operation.

View source

R_DrawParticles

function R_DrawParticles(system, currentTime, oldTime, gravity, viewOrigin, viewForward, viewUp, viewRight)

Produces the fixed-function MiniQuake command trace and advances particles in the same draw-before-simulate order as R_DrawParticles.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_DrawParticles`.
currentTimedynamic—Time value used by the operation.
oldTimedynamic—Time value used by the operation.
gravitydynamic—The gravity input consumed by `R_DrawParticles`.
viewOrigindynamic—The view origin input consumed by `R_DrawParticles`.
viewForwarddynamic—The view forward input consumed by `R_DrawParticles`.
viewUpdynamic—The view up input consumed by `R_DrawParticles`.
viewRightdynamic—The view right input consumed by `R_DrawParticles`.

View source

R_EntityParticles

function R_EntityParticles(system, entityOrigin, currentTime, vertexNormals)

r_avertexnormals belongs to the renderer rather than r_part.c, so callers provide that canonical 162-vector table as the explicit dependency.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_EntityParticles`.
entityOrigindynamic—The entity origin input consumed by `R_EntityParticles`.
currentTimedynamic—Time value used by the operation.
vertexNormalsdynamic—The vertex normals input consumed by `R_EntityParticles`.

View source

R_InitParticles

function R_InitParticles(arguments)

Apply the Quake-compatible r init particles behavior.

ParameterTypeDefaultDescription
argumentsdynamic—Command-line arguments to inspect or execute.

View source

R_LavaSplash

function R_LavaSplash(system, origin, currentTime)

Apply the Quake-compatible r lava splash behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_LavaSplash`.
origindynamic—World-space origin of the operation.
currentTimedynamic—Time value used by the operation.

View source

R_ParseParticleEffect

function R_ParseParticleEffect(system, reader, currentTime)

Apply the Quake-compatible r parse particle effect behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_ParseParticleEffect`.
readerdynamic—The reader input consumed by `R_ParseParticleEffect`.
currentTimedynamic—Time value used by the operation.

View source

R_ParticleExplosion

function R_ParticleExplosion(system, origin, currentTime)

Apply the Quake-compatible r particle explosion behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_ParticleExplosion`.
origindynamic—World-space origin of the operation.
currentTimedynamic—Time value used by the operation.

View source

R_ParticleExplosion2

function R_ParticleExplosion2(system, origin, colorStart, colorLength, currentTime)

Apply the Quake-compatible r particle explosion2 behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_ParticleExplosion2`.
origindynamic—World-space origin of the operation.
colorStartdynamic—The color start input consumed by `R_ParticleExplosion2`.
colorLengthdynamic—Length of the requested data in units appropriate to the operation.
currentTimedynamic—Time value used by the operation.

View source

R_Rand

function R_Rand(system)

MiniQuake's Win32 build uses the Microsoft C runtime rand() sequence.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_Rand`.

View source

R_ReadPointFile_f

function R_ReadPointFile_f(system, text)

Apply the Quake-compatible r read point file f behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_ReadPointFile_f`.
textdynamic—Text to parse or process.

View source

R_RocketTrail

function R_RocketTrail(system, start, finish, trailType, currentTime)

Apply the Quake-compatible r rocket trail behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_RocketTrail`.
startdynamic—The start input consumed by `R_RocketTrail`.
finishdynamic—The finish input consumed by `R_RocketTrail`.
trailTypedynamic—The trail type input consumed by `R_RocketTrail`.
currentTimedynamic—Time value used by the operation.

View source

R_RunParticleEffect

function R_RunParticleEffect(system, origin, direction, color, count, currentTime)

Apply the Quake-compatible r run particle effect behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_RunParticleEffect`.
origindynamic—World-space origin of the operation.
directiondynamic—The direction input consumed by `R_RunParticleEffect`.
colordynamic—Color value used by the operation.
countdynamic—Number of entries or units to process.
currentTimedynamic—Time value used by the operation.

View source

R_SetRandomSeed

function R_SetRandomSeed(system, seed)

Apply the Quake-compatible r set random seed behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_SetRandomSeed`.
seeddynamic—The seed input consumed by `R_SetRandomSeed`.

View source

R_TeleportSplash

function R_TeleportSplash(system, origin, currentTime)

Apply the Quake-compatible r teleport splash behavior.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `R_TeleportSplash`.
origindynamic—World-space origin of the operation.
currentTimedynamic—Time value used by the operation.

View source

ramp1

ramp1

Tracks the module-level ramp1 state owned by `miniquake.particles`.

View source

ramp2

ramp2

Tracks the module-level ramp2 state owned by `miniquake.particles`.

View source

ramp3

ramp3

Tracks the module-level ramp3 state owned by `miniquake.particles`.

View source

rampColor

function rampColor(values, ramp)

Implements the `rampColor` operation for `miniquake.particles` (ramp color).

ParameterTypeDefaultDescription
valuesdynamic—The values input consumed by `rampColor`.
rampdynamic—The ramp input consumed by `rampColor`.

View source

randomExplosionVector

function randomExplosionVector(system, origin, particle)

Return random explosion vector derived from the active module state.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `randomExplosionVector`.
origindynamic—World-space origin of the operation.
particledynamic—The particle input consumed by `randomExplosionVector`.

View source

resetRandom

function resetRandom(seed)

Update module state for random.

ParameterTypeDefaultDescription
seeddynamic—The seed input consumed by `resetRandom`.

View source

rocketTrail

function rocketTrail(start, finish, trailType, currentTime)

Implements the `rocketTrail` operation for `miniquake.particles` (rocket trail).

ParameterTypeDefaultDescription
startdynamic—The start input consumed by `rocketTrail`.
finishdynamic—The finish input consumed by `rocketTrail`.
trailTypedynamic—The trail type input consumed by `rocketTrail`.
currentTimedynamic—Time value used by the operation.

View source

rocketTrailInto

function rocketTrailInto(active, start, finish, trailType, currentTime)

Implements the `rocketTrailInto` operation for `miniquake.particles` (rocket trail into).

ParameterTypeDefaultDescription
activedynamic—The active input consumed by `rocketTrailInto`.
startdynamic—The start input consumed by `rocketTrailInto`.
finishdynamic—The finish input consumed by `rocketTrailInto`.
trailTypedynamic—The trail type input consumed by `rocketTrailInto`.
currentTimedynamic—Time value used by the operation.

View source

runEffect

function runEffect(origin, direction, count, color, currentTime)

Execute effect.

ParameterTypeDefaultDescription
origindynamic—World-space origin of the operation.
directiondynamic—The direction input consumed by `runEffect`.
countdynamic—Number of entries or units to process.
colordynamic—Color value used by the operation.
currentTimedynamic—Time value used by the operation.

View source

spawn

function spawn(origin, velocity, dieTime, color, type)

Implements the `spawn` operation for `miniquake.particles` (spawn).

ParameterTypeDefaultDescription
origindynamic—World-space origin of the operation.
velocitydynamic—Velocity applied by the operation.
dieTimedynamic—Time value used by the operation.
colordynamic—Color value used by the operation.
typedynamic—The type input consumed by `spawn`.

View source

teleportSplash

function teleportSplash(origin, currentTime)

Implements the `teleportSplash` operation for `miniquake.particles` (teleport splash).

ParameterTypeDefaultDescription
origindynamic—World-space origin of the operation.
currentTimedynamic—Time value used by the operation.

View source

update

function update(particles, currentTime, deltaTime)

Compatibility wrapper for callers that do not own the server cvar table. The integrated Host_Frame path uses updateWithGravity and passes the current sv_gravity value, matching R_DrawParticles' extern cvar dependency.

ParameterTypeDefaultDescription
particlesdynamic—The particles input consumed by `update`.
currentTimedynamic—Time value used by the operation.
deltaTimedynamic—Time value used by the operation.

View source

updateParticlePhysics

function updateParticlePhysics(particle, frameTime, gravity)

Update module state for particle physics.

ParameterTypeDefaultDescription
particledynamic—The particle input consumed by `updateParticlePhysics`.
frameTimedynamic—Time value used by the operation.
gravitydynamic—The gravity input consumed by `updateParticlePhysics`.

View source

updateWithGravity

function updateWithGravity(particles, currentTime, deltaTime, gravity)

Update module state for with gravity.

ParameterTypeDefaultDescription
particlesdynamic—The particles input consumed by `updateWithGravity`.
currentTimedynamic—Time value used by the operation.
deltaTimedynamic—Time value used by the operation.
gravitydynamic—The gravity input consumed by `updateWithGravity`.

View source

zeroVector

function zeroVector()

Implements the `zeroVector` operation for `miniquake.particles` (zero vector).

View source