5 Raymath
(require raylib/raymath/unsafe) | package: raylib |
Manually written bindings for Raylib’s Raymath module.
These are marked as unsafe because safety cannot be guaranteed, but you are very unlikely to experience undefined behaviour using this.
These are converted to and from flvector?s of the given length.
procedure
(Remap value inputStart inputEnd outputStart outputEnd) → _float value : _float inputStart : _float inputEnd : _float outputStart : _float outputEnd : _float
procedure
(Vector2Zero) → _Vector2
procedure
(Vector2One) → _Vector2
procedure
(Vector2Add v1 v2) → _Vector2
v1 : _Vector2 v2 : _Vector2
procedure
(Vector2AddValue v add) → _Vector2
v : _Vector2 add : _float
procedure
(Vector2Subtract v1 v2) → _Vector2
v1 : _Vector2 v2 : _Vector2
procedure
(Vector2SubtractValue v sub) → _Vector2
v : _Vector2 sub : _float
procedure
(Vector2Length v) → _float
v : _Vector2
procedure
(Vector2LengthSqr v) → _float
v : _Vector2
procedure
(Vector2DotProduct v1 v2) → _float
v1 : _Vector2 v2 : _Vector2
procedure
(Vector2Distance v1 v2) → _float
v1 : _Vector2 v2 : _Vector2
procedure
(Vector2Angle v1 v2) → _float
v1 : _Vector2 v2 : _Vector2
procedure
(Vector2Scale v scale) → _Vector2
v : _Vector2 scale : _float
procedure
(Vector2Multiply v1 v2) → _Vector2
v1 : _Vector2 v2 : _Vector2
procedure
(Vector2Negate v) → _Vector2
v : _Vector2
procedure
(Vector2Divide v1 v2) → _Vector2
v1 : _Vector2 v2 : _Vector2
procedure
(Vector2Normalize v) → _Vector2
v : _Vector2
procedure
(Vector2Lerp v1 v2 amount) → _Vector2
v1 : _Vector2 v2 : _Vector2 amount : _float
procedure
(Vector2Reflect v normal) → _Vector2
v : _Vector2 normal : _Vector2
procedure
(Vector2Rotate v angle) → _Vector2
v : _Vector2 angle : _float
procedure
(Vector2MoveTowards v target maxDistance) → _Vector2
v : _Vector2 target : _Vector2 maxDistance : _float
procedure
(Vector3Zero) → _Vector3
procedure
(Vector3One) → _Vector3
procedure
(Vector3Add v1 v2) → _Vector3
v1 : _Vector3 v2 : _Vector3
procedure
(Vector3AddValue v add) → _Vector3
v : _Vector3 add : _float
procedure
(Vector3Subtract v1 v2) → _Vector3
v1 : _Vector3 v2 : _Vector3
procedure
(Vector3SubtractValue v sub) → _Vector3
v : _Vector3 sub : _float
procedure
(Vector3Scale v scalar) → _Vector3
v : _Vector3 scalar : _float
procedure
(Vector3Multiply v1 v2) → _Vector3
v1 : _Vector3 v2 : _Vector3
procedure
(Vector3CrossProduct v1 v2) → _Vector3
v1 : _Vector3 v2 : _Vector3
procedure
(Vector3Perpendicular v) → _Vector3
v : _Vector3
procedure
(Vector3Length v) → _float
v : _Vector3
procedure
(Vector3LengthSqr v) → _float
v : _Vector3
procedure
(Vector3DotProduct v1 v2) → _float
v1 : _Vector3 v2 : _Vector3
procedure
(Vector3Distance v1 v2) → _float
v1 : _Vector3 v2 : _Vector3
procedure
(Vector3Angle v1 v2) → _Vector2
v1 : _Vector3 v2 : _Vector3
procedure
(Vector3Negate v) → _Vector3
v : _Vector3
procedure
(Vector3Divide v1 v2) → _Vector3
v1 : _Vector3 v2 : _Vector3
procedure
(Vector3Normalize v) → _Vector3
v : _Vector3
procedure
(Vector3OrthoNormalize v1 v2) → _void
v1 : (_pointer-to _Vector3) v2 : (_pointer-to _Vector3)
Makes vectors normalized and orthogonal to each other
Gram-Schmidt function implementation
procedure
(Vector3Transform v mat) → _Vector3
v : _Vector3 mat : _Matrix
procedure
(Vector3RotateByQuaternion v q) → _Vector3
v : _Vector3 q : _Quaternion
procedure
(Vector3Lerp v1 v2 amount) → _Vector3
v1 : _Vector3 v2 : _Vector3 amount : _float
procedure
(Vector3Reflect v normal) → _Vector3
v : _Vector3 normal : _Vector3
procedure
(Vector3Min v1 v2) → _Vector3
v1 : _Vector3 v2 : _Vector3
procedure
(Vector3Max v1 v2) → _Vector3
v1 : _Vector3 v2 : _Vector3
NOTE: Assumes P is on the plane of the triangle
procedure
(Vector3Unproject source projection view) → _Vector3
source : _Vector3 projection : _Matrix view : _Matrix
NOTE: We are avoiding calling other raymath functions despite available
procedure
(Vector3ToFloatV v) → _float3
v : _Vector3
procedure
(MatrixDeterminant mat) → _float
mat : _Matrix
procedure
(MatrixTrace mat) → _float
mat : _Matrix
procedure
(MatrixTranspose mat) → _Matrix
mat : _Matrix
procedure
(MatrixInvert mat) → _Matrix
mat : _Matrix
procedure
(MatrixNormalize mat) → _Matrix
mat : _Matrix
procedure
procedure
(MatrixSubtract left right) → _Matrix
left : _Matrix right : _Matrix
procedure
(MatrixMultiply left right) → _Matrix
left : _Matrix right : _Matrix
NOTE: When multiplying matrices... the order matters!
procedure
(MatrixTranslate x y z) → _Matrix
x : _float y : _float z : _float
procedure
(MatrixRotate axis angle) → _Matrix
axis : _Vector3 angle : _float
NOTE: Angle should be provided in radians
procedure
(MatrixRotateX angle) → _Matrix
angle : _float
procedure
(MatrixRotateY angle) → _Matrix
angle : _float
procedure
(MatrixRotateZ angle) → _Matrix
angle : _float
procedure
(MatrixRotateXYZ ang) → _Matrix
ang : _Vector3
procedure
(MatrixRotateZYX ang) → _Matrix
ang : _Vector3
procedure
(MatrixScale x y z) → _Matrix
x : _float y : _float z : _float
procedure
(MatrixFrustum left right bottom top near far) → _Matrix
left : _double right : _double bottom : _double top : _double near : _double far : _double
procedure
(MatrixPerspective fovy aspect near far) → _Matrix
fovy : _double aspect : _double near : _double far : _double
NOTE: Angle should be provided in radians
procedure
(MatrixOrtho left right bottom top near far) → _Matrix
left : _double right : _double bottom : _double top : _double near : _double far : _double
procedure
(MatrixLookAt eye target up) → _Matrix
eye : _Vector3 target : _Vector3 up : _Vector3
procedure
(MatrixToFloatV mat) → _float16
mat : _Matrix
procedure
(QuaternionAdd q1 q2) → _Quaternion
q1 : _Quaternion q2 : _Quaternion
procedure
(QuaternionAddValue q add) → _Quaternion
q : _Quaternion add : _float
procedure
(QuaternionSubtract q1 q2) → _Quaternion
q1 : _Quaternion q2 : _Quaternion
procedure
(QuaternionSubtractValue q sub) → _Quaternion
q : _Quaternion sub : _float
procedure
procedure
(QuaternionLength q) → _float
q : _Quaternion
procedure
q : _Quaternion
procedure
(QuaternionInvert q) → _Quaternion
q : _Quaternion
procedure
(QuaternionMultiply q1 q2) → _Quaternion
q1 : _Quaternion q2 : _Quaternion
procedure
(QuaternionScale q mul) → _Quaternion
q : _Quaternion mul : _float
procedure
(QuaternionLerp q1 q2 amount) → _Quaternion
q1 : _Quaternion q2 : _Quaternion amount : _float
procedure
(QuaternionNlerp q1 q2 amount) → _Quaternion
q1 : _Quaternion q2 : _Quaternion amount : _float
procedure
(QuaternionSlerp q1 q2 amount) → _Quaternion
q1 : _Quaternion q2 : _Quaternion amount : _float
procedure
(QuaternionFromVector3ToVector3 from to) → _Quaternion
from : _Vector3 to : _Vector3
procedure
(QuaternionFromMatrix mat) → _Quaternion
mat : _Matrix
procedure
(QuaternionToMatrix q) → _Matrix
q : _Quaternion
procedure
(QuaternionFromAxisAngle axis angle) → _Quaternion
axis : _Vector3 angle : _float
NOTE: angle must be provided in radians
procedure
(QuaternionToAxisAngle q) →
_Vector3 _float q : _Quaternion
Get the rotation angle and axis for a given quaternion
procedure
(QuaternionFromEuler pitch yaw roll) → _Quaternion
pitch : _float yaw : _float roll : _float
NOTE: Rotation order is ZYX
procedure
(QuaternionToEuler q) → _Vector3
q : _Quaternion
NOTE: Angles are returned in a Vector3 struct in radians
procedure
(QuaternionTransform q mat) → _Quaternion
q : _Quaternion mat : _Matrix