Files
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.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | first value consumed by this operation. |
second | dynamic | — | second value consumed by this operation. |
View source
# angleVectors
function angleVectors(angles)
Return the angle vectors value.
| Parameter | Type | Default | Description |
|---|
angles | dynamic | — | angles value consumed by this operation. |
View source
# component
function component(value, axis)
Return the component value.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
axis | dynamic | — | axis value consumed by this operation. |
View source
# copy
function copy(value)
Performs the copy operation for the miniquake2 physics vector module.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# cross
function cross(first, second)
Performs the cross operation for the miniquake2 physics vector module.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | first value consumed by this operation. |
second | dynamic | — | second value consumed by this operation. |
View source
# dot
function dot(first, second)
Performs the dot operation for the miniquake2 physics vector module.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | first value consumed by this operation. |
second | dynamic | — | second value consumed by this operation. |
View source
# length
function length(value)
Performs the length operation for the miniquake2 physics vector module.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
amount | dynamic | — | amount value consumed by this operation. |
direction | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# physicsVectorComponents
function physicsVectorComponents(value, operation)
Return the physics vector components value.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
operation | dynamic | — | operation value consumed by this operation. |
View source
# scale
function scale(value, amount)
Performs the scale operation for the miniquake2 physics vector module.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
amount | dynamic | — | amount value consumed by this operation. |
View source
# setComponent
function setComponent(value, axis, componentValue)
Set component.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
axis | dynamic | — | axis value consumed by this operation. |
componentValue | dynamic | — | componentValue value consumed by this operation. |
View source
# subtract
function subtract(first, second)
Performs the subtract operation for the miniquake2 physics vector module.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | first value consumed by this operation. |
second | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
operation | dynamic | — | operation value consumed by this operation. |
View source