MiniQuake2

src/miniquake2/physics/vector.ml

Provides miniquake2 physics vector facilities for this project.

Package
miniquake2.physics.vector
Reachable
Yes

Imports

Declarations

add

function add(first, second)

Adds add to the state managed by the miniquake2 physics vector module.

ParameterTypeDefaultDescription
firstdynamic—first value consumed by this operation.
seconddynamic—second value consumed by this operation.

View source

angleVectors

function angleVectors(angles)

Return the angle vectors value.

ParameterTypeDefaultDescription
anglesdynamic—angles value consumed by this operation.

View source

component

function component(value, axis)

Return the component value.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.
axisdynamic—axis value consumed by this operation.

View source

copy

function copy(value)

Performs the copy operation for the miniquake2 physics vector module.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.

View source

cross

function cross(first, second)

Performs the cross operation for the miniquake2 physics vector module.

ParameterTypeDefaultDescription
firstdynamic—first value consumed by this operation.
seconddynamic—second value consumed by this operation.

View source

dot

function dot(first, second)

Performs the dot operation for the miniquake2 physics vector module.

ParameterTypeDefaultDescription
firstdynamic—first value consumed by this operation.
seconddynamic—second value consumed by this operation.

View source

length

function length(value)

Performs the length operation for the miniquake2 physics vector module.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.

View source

multiplyAdd

function multiplyAdd(value, amount, direction)

Performs the multiplyAdd operation for the miniquake2 physics vector module.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.
amountdynamic—amount value consumed by this operation.
directiondynamic—direction value consumed by this operation.

View source

normalized

function normalized(value)

Return [normalized vector, original length], matching VectorNormalize's useful result without relying on reference parameters.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.

View source

physicsVectorComponents

function physicsVectorComponents(value, operation)

Return the physics vector components value.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.
operationdynamic—operation value consumed by this operation.

View source

scale

function scale(value, amount)

Performs the scale operation for the miniquake2 physics vector module.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.
amountdynamic—amount value consumed by this operation.

View source

setComponent

function setComponent(value, axis, componentValue)

Set component.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.
axisdynamic—axis value consumed by this operation.
componentValuedynamic—componentValue value consumed by this operation.

View source

subtract

function subtract(first, second)

Performs the subtract operation for the miniquake2 physics vector module.

ParameterTypeDefaultDescription
firstdynamic—first value consumed by this operation.
seconddynamic—second value consumed by this operation.

View source

validatePhysicsVector

inline function validatePhysicsVector(value, operation)

Validate dynamic Vec3-shaped values without materializing a temporary three-element array. Pmove calls dot/length/multiplyAdd hundreds of times per prediction frame, so the former component array dominated its GC rate.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.
operationdynamic—operation value consumed by this operation.

View source