Files
src/miniquake/mathlib.ml
- Package
miniquake.mathlib- Reachable
- Yes
Imports
Declarations
# _DotProduct
function _DotProduct(first, second)
Implements the `_DotProduct` operation for `miniquake.mathlib` (dot product).
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | The first input consumed by `_DotProduct`. |
second | dynamic | — | The second input consumed by `_DotProduct`. |
View source
# _VectorAdd
function _VectorAdd(first, second)
Implements the `_VectorAdd` operation for `miniquake.mathlib` (vector add).
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | The first input consumed by `_VectorAdd`. |
second | dynamic | — | The second input consumed by `_VectorAdd`. |
View source
# _VectorCopy
function _VectorCopy(value)
Implements the `_VectorCopy` operation for `miniquake.mathlib` (vector copy).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `_VectorCopy`. |
View source
# _VectorSubtract
function _VectorSubtract(first, second)
Implements the `_VectorSubtract` operation for `miniquake.mathlib` (vector subtract).
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | The first input consumed by `_VectorSubtract`. |
second | dynamic | — | The second input consumed by `_VectorSubtract`. |
View source
# add
function add(a, b)
Add state for add.
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | The a input consumed by `add`. |
b | dynamic | — | The b input consumed by `add`. |
View source
# angleMod
function angleMod(angle)
Implements the `angleMod` operation for `miniquake.mathlib` (angle mod).
| Parameter | Type | Default | Description |
|---|
angle | dynamic | — | The angle input consumed by `angleMod`. |
View source
# anglemod
function anglemod(angle)
Implements the `anglemod` operation for `miniquake.mathlib` (anglemod).
| Parameter | Type | Default | Description |
|---|
angle | dynamic | — | The angle input consumed by `anglemod`. |
View source
# AngleVectors
function AngleVectors(angles)
Implements the `AngleVectors` operation for `miniquake.mathlib` (angle vectors).
| Parameter | Type | Default | Description |
|---|
angles | dynamic | — | Orientation angles used by the operation. |
View source
# angleVectors
function angleVectors(angles)
Implements the `angleVectors` operation for `miniquake.mathlib` (angle vectors).
| Parameter | Type | Default | Description |
|---|
angles | dynamic | — | Orientation angles used by the operation. |
View source
# atan2
function atan2(y, x)
Implements the `atan2` operation for `miniquake.mathlib` (atan2).
| Parameter | Type | Default | Description |
|---|
y | dynamic | — | The y input consumed by `atan2`. |
x | dynamic | — | The x input consumed by `atan2`. |
View source
# BOPS_Error
function BOPS_Error()
Mirror Quake's BOPS_Error routine and its observable state changes.
View source
# BOX_ON_PLANE_SIDE
function BOX_ON_PLANE_SIDE(emins, emaxs, plane)
Mirror Quake's BOX_ON_PLANE_SIDE routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|
emins | dynamic | — | The emins input consumed by `BOX_ON_PLANE_SIDE`. |
emaxs | dynamic | — | The emaxs input consumed by `BOX_ON_PLANE_SIDE`. |
plane | dynamic | — | The plane input consumed by `BOX_ON_PLANE_SIDE`. |
View source
# BoxOnPlaneSide
function BoxOnPlaneSide(emins, emaxs, plane)
Implements the `BoxOnPlaneSide` operation for `miniquake.mathlib` (box on plane side).
| Parameter | Type | Default | Description |
|---|
emins | dynamic | — | The emins input consumed by `BoxOnPlaneSide`. |
emaxs | dynamic | — | The emaxs input consumed by `BoxOnPlaneSide`. |
plane | dynamic | — | The plane input consumed by `BoxOnPlaneSide`. |
View source
# boxOnPlaneSide
function boxOnPlaneSide(emins, emaxs, plane)
Implements the `boxOnPlaneSide` operation for `miniquake.mathlib` (box on plane side).
| Parameter | Type | Default | Description |
|---|
emins | dynamic | — | The emins input consumed by `boxOnPlaneSide`. |
emaxs | dynamic | — | The emaxs input consumed by `boxOnPlaneSide`. |
plane | dynamic | — | The plane input consumed by `boxOnPlaneSide`. |
View source
# clamp
function clamp(value, minimum, maximum)
Return a validated clamp value.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `clamp`. |
minimum | dynamic | — | Smallest accepted value. |
maximum | dynamic | — | Largest accepted value. |
View source
# copy
function copy(value)
Existing MiniQuake convenience spellings preserve value semantics.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `copy`. |
View source
# cos
function cos(value)
Implements the `cos` operation for `miniquake.mathlib` (cos).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `cos`. |
View source
# cross
function cross(a, b)
Implements the `cross` operation for `miniquake.mathlib` (cross).
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | The a input consumed by `cross`. |
b | dynamic | — | The b input consumed by `cross`. |
View source
# CrossProduct
function CrossProduct(first, second)
Implements the `CrossProduct` operation for `miniquake.mathlib` (cross product).
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | The first input consumed by `CrossProduct`. |
second | dynamic | — | The second input consumed by `CrossProduct`. |
View source
# DEG_TO_RAD
const DEG_TO_RAD = 1.74532925199433e-002
Defines the deg to rad value used by `miniquake.mathlib`.
View source
# dot
function dot(a, b)
Implements the `dot` operation for `miniquake.mathlib` (dot).
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | The a input consumed by `dot`. |
b | dynamic | — | The b input consumed by `dot`. |
View source
# DotProduct
inline function DotProduct(a, b)
mathlib.h macro counterparts.
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | The a input consumed by `DotProduct`. |
b | dynamic | — | The b input consumed by `DotProduct`. |
View source
# FloorDivMod
function FloorDivMod(numerator, denominator)
Implements the `FloorDivMod` operation for `miniquake.mathlib` (floor div mod).
| Parameter | Type | Default | Description |
|---|
numerator | dynamic | — | The numerator input consumed by `FloorDivMod`. |
denominator | dynamic | — | The denominator input consumed by `FloorDivMod`. |
View source
# GreatestCommonDivisor
function GreatestCommonDivisor(first, second)
Implements the `GreatestCommonDivisor` operation for `miniquake.mathlib` (greatest common divisor).
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | The first input consumed by `GreatestCommonDivisor`. |
second | dynamic | — | The second input consumed by `GreatestCommonDivisor`. |
View source
# greatestCommonDivisor
function greatestCommonDivisor(first, second)
Implements the `greatestCommonDivisor` operation for `miniquake.mathlib` (greatest common divisor).
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | The first input consumed by `greatestCommonDivisor`. |
second | dynamic | — | The second input consumed by `greatestCommonDivisor`. |
View source
# Invert24To16
function Invert24To16(value)
Implements the `Invert24To16` operation for `miniquake.mathlib` (invert24 to16).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `Invert24To16`. |
View source
# IS_NAN
function IS_NAN(value)
Report whether is nan.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `IS_NAN`. |
View source
# Length
function Length(value)
Return length derived from the active module state.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `Length`. |
View source
# length
function length(value)
Return length derived from the active module state.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `length`. |
View source
# lengthSquared
function lengthSquared(value)
Return length squared for the active module state.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `lengthSquared`. |
View source
# multiplyAdd
function multiplyAdd(a, scalar, b)
Implements the `multiplyAdd` operation for `miniquake.mathlib` (multiply add).
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | The a input consumed by `multiplyAdd`. |
scalar | dynamic | — | The scalar input consumed by `multiplyAdd`. |
b | dynamic | — | The b input consumed by `multiplyAdd`. |
View source
# NAN_MASK
const NAN_MASK = 2139095040
Defines the nan mask value used by `miniquake.mathlib`.
View source
# normalize
function normalize(value)
Convert the requested value into its canonical representation.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `normalize`. |
View source
# PerpendicularVector
function PerpendicularVector(source)
Return perpendicular vector derived from the active module state.
| Parameter | Type | Default | Description |
|---|
source | dynamic | — | Source value or collection to read. |
View source
# perpendicularVector
function perpendicularVector(source)
Return perpendicular vector derived from the active module state.
| Parameter | Type | Default | Description |
|---|
source | dynamic | — | Source value or collection to read. |
View source
# PI
const PI = 3.14159265358979
Defines the pi value used by `miniquake.mathlib`.
View source
# ProjectPointOnPlane
function ProjectPointOnPlane(point, normal)
Implements the `ProjectPointOnPlane` operation for `miniquake.mathlib` (project point on plane).
| Parameter | Type | Default | Description |
|---|
point | dynamic | — | The point input consumed by `ProjectPointOnPlane`. |
normal | dynamic | — | The normal input consumed by `ProjectPointOnPlane`. |
View source
# projectPointOnPlane
function projectPointOnPlane(point, normal)
Implements the `projectPointOnPlane` operation for `miniquake.mathlib` (project point on plane).
| Parameter | Type | Default | Description |
|---|
point | dynamic | — | The point input consumed by `projectPointOnPlane`. |
normal | dynamic | — | The normal input consumed by `projectPointOnPlane`. |
View source
# Q_log2
function Q_log2(value)
Provide the Quake-compatible log2 entry point.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `Q_log2`. |
View source
# R_ConcatRotations
function R_ConcatRotations(first, second)
Apply the Quake-compatible r concat rotations behavior.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | The first input consumed by `R_ConcatRotations`. |
second | dynamic | — | The second input consumed by `R_ConcatRotations`. |
View source
# R_ConcatTransforms
function R_ConcatTransforms(first, second)
Apply the Quake-compatible r concat transforms behavior.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | The first input consumed by `R_ConcatTransforms`. |
second | dynamic | — | The second input consumed by `R_ConcatTransforms`. |
View source
# RAD_TO_DEG
const RAD_TO_DEG = 57.2957795130823
Defines the rad to deg value used by `miniquake.mathlib`.
View source
# RotatePointAroundVector
function RotatePointAroundVector(direction, point, degrees)
Return rotate point around vector derived from the active module state.
| Parameter | Type | Default | Description |
|---|
direction | dynamic | — | The direction input consumed by `RotatePointAroundVector`. |
point | dynamic | — | The point input consumed by `RotatePointAroundVector`. |
degrees | dynamic | — | The degrees input consumed by `RotatePointAroundVector`. |
View source
# rotatePointAroundVector
function rotatePointAroundVector(direction, point, degrees)
Return rotate point around vector derived from the active module state.
| Parameter | Type | Default | Description |
|---|
direction | dynamic | — | The direction input consumed by `rotatePointAroundVector`. |
point | dynamic | — | The point input consumed by `rotatePointAroundVector`. |
degrees | dynamic | — | The degrees input consumed by `rotatePointAroundVector`. |
View source
# scale
function scale(value, scalar)
Implements the `scale` operation for `miniquake.mathlib` (scale).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `scale`. |
scalar | dynamic | — | The scalar input consumed by `scale`. |
View source
# sin
function sin(value)
Implements the `sin` operation for `miniquake.mathlib` (sin).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `sin`. |
View source
# sqrt
function sqrt(value)
Implements the `sqrt` operation for `miniquake.mathlib` (sqrt).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `sqrt`. |
View source
# subtract
function subtract(a, b)
Implements the `subtract` operation for `miniquake.mathlib` (subtract).
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | The a input consumed by `subtract`. |
b | dynamic | — | The b input consumed by `subtract`. |
View source
# vec3
function vec3(x, y, z)
Implements the `vec3` operation for `miniquake.mathlib` (vec3).
| Parameter | Type | Default | Description |
|---|
x | dynamic | — | The x input consumed by `vec3`. |
y | dynamic | — | The y input consumed by `vec3`. |
z | dynamic | — | The z input consumed by `vec3`. |
View source
# vec3Origin
function vec3Origin()
Return vec3 origin derived from the active module state.
View source
# VectorAdd
function VectorAdd(a, b)
Implements the `VectorAdd` operation for `miniquake.mathlib` (vector add).
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | The a input consumed by `VectorAdd`. |
b | dynamic | — | The b input consumed by `VectorAdd`. |
View source
# VectorCompare
function VectorCompare(first, second)
Implements the `VectorCompare` operation for `miniquake.mathlib` (vector compare).
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | The first input consumed by `VectorCompare`. |
second | dynamic | — | The second input consumed by `VectorCompare`. |
View source
# VectorCopy
function VectorCopy(value)
Implements the `VectorCopy` operation for `miniquake.mathlib` (vector copy).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `VectorCopy`. |
View source
# VectorInverse
function VectorInverse(value)
Implements the `VectorInverse` operation for `miniquake.mathlib` (vector inverse).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `VectorInverse`. |
View source
# VectorMA
function VectorMA(first, scalar, second)
Implements the `VectorMA` operation for `miniquake.mathlib` (vector ma).
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | The first input consumed by `VectorMA`. |
scalar | dynamic | — | The scalar input consumed by `VectorMA`. |
second | dynamic | — | The second input consumed by `VectorMA`. |
View source
# VectorNormalize
function VectorNormalize(value)
Implements the `VectorNormalize` operation for `miniquake.mathlib` (vector normalize).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `VectorNormalize`. |
View source
# VectorScale
function VectorScale(value, scalar)
Implements the `VectorScale` operation for `miniquake.mathlib` (vector scale).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `VectorScale`. |
scalar | dynamic | — | The scalar input consumed by `VectorScale`. |
View source
# VectorSubtract
function VectorSubtract(a, b)
Implements the `VectorSubtract` operation for `miniquake.mathlib` (vector subtract).
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | The a input consumed by `VectorSubtract`. |
b | dynamic | — | The b input consumed by `VectorSubtract`. |
View source