MiniQuake

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).

ParameterTypeDefaultDescription
firstdynamic—The first input consumed by `_DotProduct`.
seconddynamic—The second input consumed by `_DotProduct`.

View source

_VectorAdd

function _VectorAdd(first, second)

Implements the `_VectorAdd` operation for `miniquake.mathlib` (vector add).

ParameterTypeDefaultDescription
firstdynamic—The first input consumed by `_VectorAdd`.
seconddynamic—The second input consumed by `_VectorAdd`.

View source

_VectorCopy

function _VectorCopy(value)

Implements the `_VectorCopy` operation for `miniquake.mathlib` (vector copy).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `_VectorCopy`.

View source

_VectorSubtract

function _VectorSubtract(first, second)

Implements the `_VectorSubtract` operation for `miniquake.mathlib` (vector subtract).

ParameterTypeDefaultDescription
firstdynamic—The first input consumed by `_VectorSubtract`.
seconddynamic—The second input consumed by `_VectorSubtract`.

View source

add

function add(a, b)

Add state for add.

ParameterTypeDefaultDescription
adynamic—The a input consumed by `add`.
bdynamic—The b input consumed by `add`.

View source

angleMod

function angleMod(angle)

Implements the `angleMod` operation for `miniquake.mathlib` (angle mod).

ParameterTypeDefaultDescription
angledynamic—The angle input consumed by `angleMod`.

View source

anglemod

function anglemod(angle)

Implements the `anglemod` operation for `miniquake.mathlib` (anglemod).

ParameterTypeDefaultDescription
angledynamic—The angle input consumed by `anglemod`.

View source

AngleVectors

function AngleVectors(angles)

Implements the `AngleVectors` operation for `miniquake.mathlib` (angle vectors).

ParameterTypeDefaultDescription
anglesdynamic—Orientation angles used by the operation.

View source

angleVectors

function angleVectors(angles)

Implements the `angleVectors` operation for `miniquake.mathlib` (angle vectors).

ParameterTypeDefaultDescription
anglesdynamic—Orientation angles used by the operation.

View source

atan2

function atan2(y, x)

Implements the `atan2` operation for `miniquake.mathlib` (atan2).

ParameterTypeDefaultDescription
ydynamic—The y input consumed by `atan2`.
xdynamic—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.

ParameterTypeDefaultDescription
eminsdynamic—The emins input consumed by `BOX_ON_PLANE_SIDE`.
emaxsdynamic—The emaxs input consumed by `BOX_ON_PLANE_SIDE`.
planedynamic—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).

ParameterTypeDefaultDescription
eminsdynamic—The emins input consumed by `BoxOnPlaneSide`.
emaxsdynamic—The emaxs input consumed by `BoxOnPlaneSide`.
planedynamic—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).

ParameterTypeDefaultDescription
eminsdynamic—The emins input consumed by `boxOnPlaneSide`.
emaxsdynamic—The emaxs input consumed by `boxOnPlaneSide`.
planedynamic—The plane input consumed by `boxOnPlaneSide`.

View source

clamp

function clamp(value, minimum, maximum)

Return a validated clamp value.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `clamp`.
minimumdynamic—Smallest accepted value.
maximumdynamic—Largest accepted value.

View source

copy

function copy(value)

Existing MiniQuake convenience spellings preserve value semantics.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `copy`.

View source

cos

function cos(value)

Implements the `cos` operation for `miniquake.mathlib` (cos).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `cos`.

View source

cross

function cross(a, b)

Implements the `cross` operation for `miniquake.mathlib` (cross).

ParameterTypeDefaultDescription
adynamic—The a input consumed by `cross`.
bdynamic—The b input consumed by `cross`.

View source

CrossProduct

function CrossProduct(first, second)

Implements the `CrossProduct` operation for `miniquake.mathlib` (cross product).

ParameterTypeDefaultDescription
firstdynamic—The first input consumed by `CrossProduct`.
seconddynamic—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).

ParameterTypeDefaultDescription
adynamic—The a input consumed by `dot`.
bdynamic—The b input consumed by `dot`.

View source

DotProduct

inline function DotProduct(a, b)

mathlib.h macro counterparts.

ParameterTypeDefaultDescription
adynamic—The a input consumed by `DotProduct`.
bdynamic—The b input consumed by `DotProduct`.

View source

FloorDivMod

function FloorDivMod(numerator, denominator)

Implements the `FloorDivMod` operation for `miniquake.mathlib` (floor div mod).

ParameterTypeDefaultDescription
numeratordynamic—The numerator input consumed by `FloorDivMod`.
denominatordynamic—The denominator input consumed by `FloorDivMod`.

View source

GreatestCommonDivisor

function GreatestCommonDivisor(first, second)

Implements the `GreatestCommonDivisor` operation for `miniquake.mathlib` (greatest common divisor).

ParameterTypeDefaultDescription
firstdynamic—The first input consumed by `GreatestCommonDivisor`.
seconddynamic—The second input consumed by `GreatestCommonDivisor`.

View source

greatestCommonDivisor

function greatestCommonDivisor(first, second)

Implements the `greatestCommonDivisor` operation for `miniquake.mathlib` (greatest common divisor).

ParameterTypeDefaultDescription
firstdynamic—The first input consumed by `greatestCommonDivisor`.
seconddynamic—The second input consumed by `greatestCommonDivisor`.

View source

Invert24To16

function Invert24To16(value)

Implements the `Invert24To16` operation for `miniquake.mathlib` (invert24 to16).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `Invert24To16`.

View source

IS_NAN

function IS_NAN(value)

Report whether is nan.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `IS_NAN`.

View source

Length

function Length(value)

Return length derived from the active module state.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `Length`.

View source

length

function length(value)

Return length derived from the active module state.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `length`.

View source

lengthSquared

function lengthSquared(value)

Return length squared for the active module state.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `lengthSquared`.

View source

multiplyAdd

function multiplyAdd(a, scalar, b)

Implements the `multiplyAdd` operation for `miniquake.mathlib` (multiply add).

ParameterTypeDefaultDescription
adynamic—The a input consumed by `multiplyAdd`.
scalardynamic—The scalar input consumed by `multiplyAdd`.
bdynamic—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.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `normalize`.

View source

PerpendicularVector

function PerpendicularVector(source)

Return perpendicular vector derived from the active module state.

ParameterTypeDefaultDescription
sourcedynamic—Source value or collection to read.

View source

perpendicularVector

function perpendicularVector(source)

Return perpendicular vector derived from the active module state.

ParameterTypeDefaultDescription
sourcedynamic—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).

ParameterTypeDefaultDescription
pointdynamic—The point input consumed by `ProjectPointOnPlane`.
normaldynamic—The normal input consumed by `ProjectPointOnPlane`.

View source

projectPointOnPlane

function projectPointOnPlane(point, normal)

Implements the `projectPointOnPlane` operation for `miniquake.mathlib` (project point on plane).

ParameterTypeDefaultDescription
pointdynamic—The point input consumed by `projectPointOnPlane`.
normaldynamic—The normal input consumed by `projectPointOnPlane`.

View source

Q_log2

function Q_log2(value)

Provide the Quake-compatible log2 entry point.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `Q_log2`.

View source

R_ConcatRotations

function R_ConcatRotations(first, second)

Apply the Quake-compatible r concat rotations behavior.

ParameterTypeDefaultDescription
firstdynamic—The first input consumed by `R_ConcatRotations`.
seconddynamic—The second input consumed by `R_ConcatRotations`.

View source

R_ConcatTransforms

function R_ConcatTransforms(first, second)

Apply the Quake-compatible r concat transforms behavior.

ParameterTypeDefaultDescription
firstdynamic—The first input consumed by `R_ConcatTransforms`.
seconddynamic—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.

ParameterTypeDefaultDescription
directiondynamic—The direction input consumed by `RotatePointAroundVector`.
pointdynamic—The point input consumed by `RotatePointAroundVector`.
degreesdynamic—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.

ParameterTypeDefaultDescription
directiondynamic—The direction input consumed by `rotatePointAroundVector`.
pointdynamic—The point input consumed by `rotatePointAroundVector`.
degreesdynamic—The degrees input consumed by `rotatePointAroundVector`.

View source

scale

function scale(value, scalar)

Implements the `scale` operation for `miniquake.mathlib` (scale).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `scale`.
scalardynamic—The scalar input consumed by `scale`.

View source

sin

function sin(value)

Implements the `sin` operation for `miniquake.mathlib` (sin).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `sin`.

View source

sqrt

function sqrt(value)

Implements the `sqrt` operation for `miniquake.mathlib` (sqrt).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `sqrt`.

View source

subtract

function subtract(a, b)

Implements the `subtract` operation for `miniquake.mathlib` (subtract).

ParameterTypeDefaultDescription
adynamic—The a input consumed by `subtract`.
bdynamic—The b input consumed by `subtract`.

View source

vec3

function vec3(x, y, z)

Implements the `vec3` operation for `miniquake.mathlib` (vec3).

ParameterTypeDefaultDescription
xdynamic—The x input consumed by `vec3`.
ydynamic—The y input consumed by `vec3`.
zdynamic—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).

ParameterTypeDefaultDescription
adynamic—The a input consumed by `VectorAdd`.
bdynamic—The b input consumed by `VectorAdd`.

View source

VectorCompare

function VectorCompare(first, second)

Implements the `VectorCompare` operation for `miniquake.mathlib` (vector compare).

ParameterTypeDefaultDescription
firstdynamic—The first input consumed by `VectorCompare`.
seconddynamic—The second input consumed by `VectorCompare`.

View source

VectorCopy

function VectorCopy(value)

Implements the `VectorCopy` operation for `miniquake.mathlib` (vector copy).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `VectorCopy`.

View source

VectorInverse

function VectorInverse(value)

Implements the `VectorInverse` operation for `miniquake.mathlib` (vector inverse).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `VectorInverse`.

View source

VectorMA

function VectorMA(first, scalar, second)

Implements the `VectorMA` operation for `miniquake.mathlib` (vector ma).

ParameterTypeDefaultDescription
firstdynamic—The first input consumed by `VectorMA`.
scalardynamic—The scalar input consumed by `VectorMA`.
seconddynamic—The second input consumed by `VectorMA`.

View source

VectorNormalize

function VectorNormalize(value)

Implements the `VectorNormalize` operation for `miniquake.mathlib` (vector normalize).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `VectorNormalize`.

View source

VectorScale

function VectorScale(value, scalar)

Implements the `VectorScale` operation for `miniquake.mathlib` (vector scale).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `VectorScale`.
scalardynamic—The scalar input consumed by `VectorScale`.

View source

VectorSubtract

function VectorSubtract(a, b)

Implements the `VectorSubtract` operation for `miniquake.mathlib` (vector subtract).

ParameterTypeDefaultDescription
adynamic—The a input consumed by `VectorSubtract`.
bdynamic—The b input consumed by `VectorSubtract`.

View source