Vectors, matrices and quaternions (raymath, as rl.math). 146 functions, from raylib's raymath.
Clamp float value
Zigfn clamp(value: f32, min: f32, max: f32) f32
Cfloat Clamp(float value, float min, float max)
Used in core_2d_camera_mouse_zoom, core_3d_camera_fps, shapes_clock_of_clocks, shapes_math_sine_cosine, shapes_starfield_effect, shapes_lines_drawing and 8 more.
Calculate linear interpolation between two floats
Zigfn lerp(start: f32, end: f32, amount: f32) f32
Cfloat Lerp(float start, float end, float amount)
Used in core_3d_camera_fps, core_text_file_loading, shapes_clock_of_clocks, shapes_starfield_effect, text_words_alignment, models_mesh_uv_painting.
Normalize input value within input range
Zigfn normalize(value: f32, start: f32, end: f32) f32
Cfloat Normalize(float value, float start, float end)
Remap input value within input range to output range
Zigfn remap(value: f32, inputStart: f32, inputEnd: f32, outputStart: f32, outputEnd: f32) f32
Cfloat Remap(float value, float inputStart, float inputEnd, float outputStart, float outputEnd)
Used in core_random_sequence.
Wrap input value from min to max
Zigfn wrap(value: f32, min: f32, max: f32) f32
Cfloat Wrap(float value, float min, float max)
Used in shapes_math_sine_cosine.
Check whether two given floats are almost equal
Zigfn floatEquals(x: f32, y: f32) i32
Cint FloatEquals(float x, float y)
Vector with components value 0.0f
Zigfn vector2Zero() Vector2
CVector2 Vector2Zero(void)
Used in shapes_top_down_lights, shapes_lines_drawing, shaders_deferred_rendering.
Vector with components value 1.0f
Zigfn vector2One() Vector2
CVector2 Vector2One(void)
Used in models_directional_billboard.
Add two vectors (v1 + v2)
Zigfn vector2Add(v1: Vector2, v2: Vector2) Vector2
CVector2 Vector2Add(Vector2 v1, Vector2 v2)
Used in core_2d_camera_mouse_zoom, core_2d_camera_platformer, shapes_top_down_lights, shapes_vector_angle, shapes_rlgl_color_wheel, shapes_ball_physics and 3 more.
Add vector and float value
Zigfn vector2AddValue(v: Vector2, add: f32) Vector2
CVector2 Vector2AddValue(Vector2 v, float add)
Subtract two vectors (v1 - v2)
Zigfn vector2Subtract(v1: Vector2, v2: Vector2) Vector2
CVector2 Vector2Subtract(Vector2 v1, Vector2 v2)
Used in core_2d_camera_platformer, shapes_top_down_lights, shapes_vector_angle, shapes_kaleidoscope, shapes_rlgl_color_wheel, shapes_ball_physics and 1 more.
Subtract vector by float value
Zigfn vector2SubtractValue(v: Vector2, sub: f32) Vector2
CVector2 Vector2SubtractValue(Vector2 v, float sub)
Calculate vector length
Zigfn vector2Length(v: Vector2) f32
Cfloat Vector2Length(Vector2 v)
Used in core_2d_camera_platformer, core_3d_camera_fps, shapes_ball_physics, textures_textured_curve.
Calculate vector square length
Zigfn vector2LengthSqr(v: Vector2) f32
Cfloat Vector2LengthSqr(Vector2 v)
Calculate two vectors dot product
Zigfn vector2DotProduct(v1: Vector2, v2: Vector2) f32
Cfloat Vector2DotProduct(Vector2 v1, Vector2 v2)
Calculate two vectors cross product
Zigfn vector2CrossProduct(v1: Vector2, v2: Vector2) f32
Cfloat Vector2CrossProduct(Vector2 v1, Vector2 v2)
Calculate distance between two vectors
Zigfn vector2Distance(v1: Vector2, v2: Vector2) f32
Cfloat Vector2Distance(Vector2 v1, Vector2 v2)
Used in shapes_lines_drawing, shapes_rlgl_color_wheel, shapes_drag_puzzle, models_mesh_uv_painting.
Calculate square distance between two vectors
Zigfn vector2DistanceSqr(v1: Vector2, v2: Vector2) f32
Cfloat Vector2DistanceSqr(Vector2 v1, Vector2 v2)
positive angles appear clockwise, and negative angles appear counterclockwise
Zigfn vector2Angle(v1: Vector2, v2: Vector2) f32
Cfloat Vector2Angle(Vector2 v1, Vector2 v2)
Used in shapes_vector_angle, shapes_rlgl_color_wheel, models_directional_billboard.
Current implementation should be aligned with glm::angle
Zigfn vector2LineAngle(start: Vector2, end: Vector2) f32
Cfloat Vector2LineAngle(Vector2 start, Vector2 end)
Used in shapes_vector_angle.
Scale vector (multiply by value)
Zigfn vector2Scale(v: Vector2, scale: f32) Vector2
CVector2 Vector2Scale(Vector2 v, float scale)
Used in core_2d_camera_mouse_zoom, core_2d_camera_platformer, shapes_top_down_lights, shapes_ball_physics, textures_textured_curve, models_billboard_rendering.
Multiply vector by vector
Zigfn vector2Multiply(v1: Vector2, v2: Vector2) Vector2
CVector2 Vector2Multiply(Vector2 v1, Vector2 v2)
Used in core_2d_camera_mouse_zoom, core_2d_camera_split_screen, shapes_kaleidoscope, shapes_rlgl_color_wheel, textures_magnifying_glass, shaders_spotlight_rendering.
Negate vector
Zigfn vector2Negate(v: Vector2) Vector2
CVector2 Vector2Negate(Vector2 v)
Divide vector by vector
Zigfn vector2Divide(v1: Vector2, v2: Vector2) Vector2
CVector2 Vector2Divide(Vector2 v1, Vector2 v2)
Normalize provided vector
Zigfn vector2Normalize(v: Vector2) Vector2
CVector2 Vector2Normalize(Vector2 v)
Used in core_3d_camera_fps, shapes_top_down_lights, shapes_vector_angle, textures_textured_curve.
Transforms a Vector2 by a given Matrix
Zigfn vector2Transform(v: Vector2, mat: Matrix) Vector2
CVector2 Vector2Transform(Vector2 v, Matrix mat)
Calculate linear interpolation between two vectors
Zigfn vector2Lerp(v1: Vector2, v2: Vector2, amount: f32) Vector2
CVector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount)
Calculate reflected vector to normal
Zigfn vector2Reflect(v: Vector2, normal: Vector2) Vector2
CVector2 Vector2Reflect(Vector2 v, Vector2 normal)
Get min value for each pair of components
Zigfn vector2Min(v1: Vector2, v2: Vector2) Vector2
CVector2 Vector2Min(Vector2 v1, Vector2 v2)
Get max value for each pair of components
Zigfn vector2Max(v1: Vector2, v2: Vector2) Vector2
CVector2 Vector2Max(Vector2 v1, Vector2 v2)
Rotate vector by angle
Zigfn vector2Rotate(v: Vector2, angle: f32) Vector2
CVector2 Vector2Rotate(Vector2 v, float angle)
Used in shapes_kaleidoscope, textures_polygon_drawing, models_tesseract_view.
Move Vector towards target
Zigfn vector2MoveTowards(v: Vector2, target: Vector2, maxDistance: f32) Vector2
CVector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance)
Invert the given vector
Zigfn vector2Invert(v: Vector2) Vector2
CVector2 Vector2Invert(Vector2 v)
min and max values specified by the given vectors
Zigfn vector2Clamp(v: Vector2, min: Vector2, max: Vector2) Vector2
CVector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max)
Used in core_window_letterbox.
Clamp the magnitude of the vector between two min and max values
Zigfn vector2ClampValue(v: Vector2, min: f32, max: f32) Vector2
CVector2 Vector2ClampValue(Vector2 v, float min, float max)
Check whether two given vectors are almost equal
Zigfn vector2Equals(p: Vector2, q: Vector2) i32
Cint Vector2Equals(Vector2 p, Vector2 q)
to the refractive index of the medium on the other side of the surface
Zigfn vector2Refract(v: Vector2, n: Vector2, r: f32) Vector2
CVector2 Vector2Refract(Vector2 v, Vector2 n, float r)
Vector with components value 0.0f
Zigfn vector3Zero() Vector3
CVector3 Vector3Zero(void)
Used in models_loading_vox, models_directional_billboard, models_mesh_uv_painting, models_procedural_decals, shaders_basic_lighting, shaders_fog_rendering and 5 more.
Vector with components value 1.0f
Zigfn vector3One() Vector3
CVector3 Vector3One(void)
Used in shaders_shadowmap_rendering.
Add two vectors
Zigfn vector3Add(v1: Vector3, v2: Vector3) Vector3
CVector3 Vector3Add(Vector3 v1, Vector3 v2)
Used in core_3d_camera_fps, textures_portal_window, models_decals, models_procedural_decals, shaders_normalmap_rendering.
Add vector and float value
Zigfn vector3AddValue(v: Vector3, add: f32) Vector3
CVector3 Vector3AddValue(Vector3 v, float add)
Subtract two vectors
Zigfn vector3Subtract(v1: Vector3, v2: Vector3) Vector3
CVector3 Vector3Subtract(Vector3 v1, Vector3 v2)
Used in textures_portal_window, shaders_hybrid_rendering, audio_sound_positioning.
Subtract vector by float value
Zigfn vector3SubtractValue(v: Vector3, sub: f32) Vector3
CVector3 Vector3SubtractValue(Vector3 v, float sub)
Multiply vector by scalar
Zigfn vector3Scale(v: Vector3, scalar: f32) Vector3
CVector3 Vector3Scale(Vector3 v, float scalar)
Used in core_3d_camera_fps, models_decals, shaders_normalmap_rendering, shaders_hybrid_rendering, shaders_shadowmap_rendering.
Multiply vector by vector
Zigfn vector3Multiply(v1: Vector3, v2: Vector3) Vector3
CVector3 Vector3Multiply(Vector3 v1, Vector3 v2)
Calculate two vectors cross product
Zigfn vector3CrossProduct(v1: Vector3, v2: Vector3) Vector3
CVector3 Vector3CrossProduct(Vector3 v1, Vector3 v2)
Used in core_3d_camera_fps, textures_portal_window, audio_sound_positioning.
Calculate one vector perpendicular vector
Zigfn vector3Perpendicular(v: Vector3) Vector3
CVector3 Vector3Perpendicular(Vector3 v)
Calculate vector length
Zigfn vector3Length(v: Vector3) f32
Cfloat Vector3Length(const Vector3 v)
Used in core_3d_camera_fps, audio_sound_positioning.
Calculate vector square length
Zigfn vector3LengthSqr(v: Vector3) f32
Cfloat Vector3LengthSqr(const Vector3 v)
Calculate two vectors dot product
Zigfn vector3DotProduct(v1: Vector3, v2: Vector3) f32
Cfloat Vector3DotProduct(Vector3 v1, Vector3 v2)
Used in core_3d_camera_fps, textures_portal_window, models_decals, models_procedural_decals, audio_sound_positioning.
Calculate distance between two vectors
Zigfn vector3Distance(v1: Vector3, v2: Vector3) f32
Cfloat Vector3Distance(Vector3 v1, Vector3 v2)
Used in textures_framebuffer_rendering, models_billboard_rendering.
Calculate square distance between two vectors
Zigfn vector3DistanceSqr(v1: Vector3, v2: Vector3) f32
Cfloat Vector3DistanceSqr(Vector3 v1, Vector3 v2)
Calculate angle between two vectors
Zigfn vector3Angle(v1: Vector3, v2: Vector3) f32
Cfloat Vector3Angle(Vector3 v1, Vector3 v2)
Used in core_3d_camera_fps.
Negate provided vector (invert direction)
Zigfn vector3Negate(v: Vector3) Vector3
CVector3 Vector3Negate(Vector3 v)
Used in core_3d_camera_fps.
Divide vector by vector
Zigfn vector3Divide(v1: Vector3, v2: Vector3) Vector3
CVector3 Vector3Divide(Vector3 v1, Vector3 v2)
Normalize provided vector
Zigfn vector3Normalize(v: Vector3) Vector3
CVector3 Vector3Normalize(Vector3 v)
Used in core_3d_camera_fps, textures_portal_window, shaders_mesh_instancing, shaders_normalmap_rendering, shaders_hybrid_rendering, shaders_shadowmap_rendering and 1 more.
Calculate the projection of the vector v1 on to v2
Zigfn vector3Project(v1: Vector3, v2: Vector3) Vector3
CVector3 Vector3Project(Vector3 v1, Vector3 v2)
Calculate the rejection of the vector v1 on to v2
Zigfn vector3Reject(v1: Vector3, v2: Vector3) Vector3
CVector3 Vector3Reject(Vector3 v1, Vector3 v2)
Gram-Schmidt function implementation
Zigfn vector3OrthoNormalize(v1: *Vector3, v2: *Vector3) void
Cvoid Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2)
Transforms a Vector3 by a given Matrix
Zigfn vector3Transform(v: Vector3, mat: Matrix) Vector3
CVector3 Vector3Transform(Vector3 v, Matrix mat)
Used in models_decals, models_animation_blend_custom, models_mesh_uv_painting, models_procedural_decals.
Transform a vector by quaternion rotation
Zigfn vector3RotateByQuaternion(v: Vector3, q: Quaternion) Vector3
CVector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q)
Rotates a vector around an axis
Zigfn vector3RotateByAxisAngle(v: Vector3, axis: Vector3, angle: f32) Vector3
CVector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle)
Used in core_3d_camera_fps.
Move Vector towards target
Zigfn vector3MoveTowards(v: Vector3, target: Vector3, maxDistance: f32) Vector3
CVector3 Vector3MoveTowards(Vector3 v, Vector3 target, float maxDistance)
Calculate linear interpolation between two vectors
Zigfn vector3Lerp(v1: Vector3, v2: Vector3, amount: f32) Vector3
CVector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount)
Used in core_3d_camera_fps, models_decals, models_animation_blend_custom, models_procedural_decals.
as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic
Zigfn vector3CubicHermite(v1: Vector3, tangent1: Vector3, v2: Vector3, tangent2: Vector3, amount: f32) Vector3
CVector3 Vector3CubicHermite(Vector3 v1, Vector3 tangent1, Vector3 v2, Vector3 tangent2, float amount)
Calculate reflected vector to normal
Zigfn vector3Reflect(v: Vector3, normal: Vector3) Vector3
CVector3 Vector3Reflect(Vector3 v, Vector3 normal)
Get min value for each pair of components
Zigfn vector3Min(v1: Vector3, v2: Vector3) Vector3
CVector3 Vector3Min(Vector3 v1, Vector3 v2)
Get max value for each pair of components
Zigfn vector3Max(v1: Vector3, v2: Vector3) Vector3
CVector3 Vector3Max(Vector3 v1, Vector3 v2)
NOTE: Assumes P is on the plane of the triangle
Zigfn vector3Barycenter(p: Vector3, v1: Vector3, v2: Vector3, v3: Vector3) Vector3
CVector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c)
Used in models_mesh_picking, models_mesh_uv_painting.
NOTE: Self-contained function, no other raymath functions are called
Zigfn vector3Unproject(source: Vector3, projection: Matrix, view: Matrix) Vector3
CVector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view)
Get Vector3 as float array
Zigfn vector3ToFloatV(v: Vector3) float3
Cfloat3 Vector3ToFloatV(Vector3 v)
Invert the given vector
Zigfn vector3Invert(v: Vector3) Vector3
CVector3 Vector3Invert(Vector3 v)
min and max values specified by the given vectors
Zigfn vector3Clamp(v: Vector3, min: Vector3, max: Vector3) Vector3
CVector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max)
Clamp the magnitude of the vector between two values
Zigfn vector3ClampValue(v: Vector3, min: f32, max: f32) Vector3
CVector3 Vector3ClampValue(Vector3 v, float min, float max)
Check whether two given vectors are almost equal
Zigfn vector3Equals(p: Vector3, q: Vector3) i32
Cint Vector3Equals(Vector3 p, Vector3 q)
to the refractive index of the medium on the other side of the surface
Zigfn vector3Refract(v: Vector3, n: Vector3, r: f32) Vector3
CVector3 Vector3Refract(Vector3 v, Vector3 n, float r)
Get vector zero
Zigfn vector4Zero() Vector4
CVector4 Vector4Zero(void)
Get vector one
Zigfn vector4One() Vector4
CVector4 Vector4One(void)
Add two vectors
Zigfn vector4Add(v1: Vector4, v2: Vector4) Vector4
CVector4 Vector4Add(Vector4 v1, Vector4 v2)
Add value to vector components
Zigfn vector4AddValue(v: Vector4, add: f32) Vector4
CVector4 Vector4AddValue(Vector4 v, float add)
Substract vectors
Zigfn vector4Subtract(v1: Vector4, v2: Vector4) Vector4
CVector4 Vector4Subtract(Vector4 v1, Vector4 v2)
Substract value from vector components
Zigfn vector4SubtractValue(v: Vector4, add: f32) Vector4
CVector4 Vector4SubtractValue(Vector4 v, float add)
Vector length
Zigfn vector4Length(v: Vector4) f32
Cfloat Vector4Length(Vector4 v)
Vector square length
Zigfn vector4LengthSqr(v: Vector4) f32
Cfloat Vector4LengthSqr(Vector4 v)
Vectors dot product
Zigfn vector4DotProduct(v1: Vector4, v2: Vector4) f32
Cfloat Vector4DotProduct(Vector4 v1, Vector4 v2)
Calculate distance between two vectors
Zigfn vector4Distance(v1: Vector4, v2: Vector4) f32
Cfloat Vector4Distance(Vector4 v1, Vector4 v2)
Calculate square distance between two vectors
Zigfn vector4DistanceSqr(v1: Vector4, v2: Vector4) f32
Cfloat Vector4DistanceSqr(Vector4 v1, Vector4 v2)
Scale vector components by value (multiply)
Zigfn vector4Scale(v: Vector4, scale: f32) Vector4
CVector4 Vector4Scale(Vector4 v, float scale)
Multiply vector by vector
Zigfn vector4Multiply(v1: Vector4, v2: Vector4) Vector4
CVector4 Vector4Multiply(Vector4 v1, Vector4 v2)
Negate vector
Zigfn vector4Negate(v: Vector4) Vector4
CVector4 Vector4Negate(Vector4 v)
Divide vector by vector
Zigfn vector4Divide(v1: Vector4, v2: Vector4) Vector4
CVector4 Vector4Divide(Vector4 v1, Vector4 v2)
Normalize provided vector
Zigfn vector4Normalize(v: Vector4) Vector4
CVector4 Vector4Normalize(Vector4 v)
Get min value for each pair of components
Zigfn vector4Min(v1: Vector4, v2: Vector4) Vector4
CVector4 Vector4Min(Vector4 v1, Vector4 v2)
Get max value for each pair of components
Zigfn vector4Max(v1: Vector4, v2: Vector4) Vector4
CVector4 Vector4Max(Vector4 v1, Vector4 v2)
Calculate linear interpolation between two vectors
Zigfn vector4Lerp(v1: Vector4, v2: Vector4, amount: f32) Vector4
CVector4 Vector4Lerp(Vector4 v1, Vector4 v2, float amount)
Move Vector towards target
Zigfn vector4MoveTowards(v: Vector4, target: Vector4, maxDistance: f32) Vector4
CVector4 Vector4MoveTowards(Vector4 v, Vector4 target, float maxDistance)
Invert the given vector
Zigfn vector4Invert(v: Vector4) Vector4
CVector4 Vector4Invert(Vector4 v)
Check whether two given vectors are almost equal
Zigfn vector4Equals(p: Vector4, q: Vector4) i32
Cint Vector4Equals(Vector4 p, Vector4 q)
Compute matrix determinant
Zigfn matrixDeterminant(mat: Matrix) f32
Cfloat MatrixDeterminant(Matrix mat)
Get the trace of the matrix (sum of the values along the diagonal)
Zigfn matrixTrace(mat: Matrix) f32
Cfloat MatrixTrace(Matrix mat)
Transposes provided matrix
Zigfn matrixTranspose(mat: Matrix) Matrix
CMatrix MatrixTranspose(Matrix mat)
Used in models_animation_blend_custom.
Invert provided matrix
Zigfn matrixInvert(mat: Matrix) Matrix
CMatrix MatrixInvert(Matrix mat)
Used in textures_framebuffer_rendering, models_decals, models_animation_blend_custom, models_procedural_decals.
Get identity matrix
Zigfn matrixIdentity() Matrix
CMatrix MatrixIdentity(void)
Used in shaders_lightmap_rendering.
Add two matrices
Zigfn matrixAdd(left: Matrix, right: Matrix) Matrix
CMatrix MatrixAdd(Matrix left, Matrix right)
Subtract two matrices (left - right)
Zigfn matrixSubtract(left: Matrix, right: Matrix) Matrix
CMatrix MatrixSubtract(Matrix left, Matrix right)
NOTE: When multiplying matrices... the order matters!
Zigfn matrixMultiply(left: Matrix, right: Matrix) Matrix
CMatrix MatrixMultiply(Matrix left, Matrix right)
Used in textures_framebuffer_rendering, models_bone_socket, models_decals, models_animation_blend_custom, models_procedural_decals, shaders_fog_rendering and 3 more.
Multiply matrix components by value
Zigfn matrixMultiplyValue(left: Matrix, value: f32) Matrix
CMatrix MatrixMultiplyValue(Matrix left, float value)
Get translation matrix
Zigfn matrixTranslate(x: f32, y: f32, z: f32) Matrix
CMatrix MatrixTranslate(float x, float y, float z)
Used in models_loading_vox, models_bone_socket, models_animation_blend_custom, models_mesh_uv_painting, shaders_mesh_instancing.
NOTE: Angle should be provided in radians
Zigfn matrixRotate(axis: Vector3, angle: f32) Matrix
CMatrix MatrixRotate(Vector3 axis, float angle)
Used in shaders_mesh_instancing.
NOTE: Angle must be provided in radians
Zigfn matrixRotateX(angle: f32) Matrix
CMatrix MatrixRotateX(float angle)
Used in shaders_fog_rendering.
NOTE: Angle must be provided in radians
Zigfn matrixRotateY(angle: f32) Matrix
CMatrix MatrixRotateY(float angle)
Used in shaders_normalmap_rendering.
NOTE: Angle must be provided in radians
Zigfn matrixRotateZ(angle: f32) Matrix
CMatrix MatrixRotateZ(float angle)
Used in models_decals, models_procedural_decals, shaders_fog_rendering.
NOTE: Angle must be provided in radians
Zigfn matrixRotateXYZ(angle: Vector3) Matrix
CMatrix MatrixRotateXYZ(Vector3 angle)
Used in models_yaw_pitch_roll, shaders_simple_mask.
NOTE: Angle must be provided in radians
Zigfn matrixRotateZYX(angle: Vector3) Matrix
CMatrix MatrixRotateZYX(Vector3 angle)
Get scaling matrix
Zigfn matrixScale(x: f32, y: f32, z: f32) Matrix
CMatrix MatrixScale(float x, float y, float z)
Used in models_animation_blend_custom.
Get perspective projection matrix
Zigfn matrixFrustum(left: f64, right: f64, bottom: f64, top: f64, nearPlane: f64, farPlane: f64) Matrix
CMatrix MatrixFrustum(double left, double right, double bottom, double top, double nearPlane, double farPlane)
Used in textures_portal_window.
NOTE: Fovy angle must be provided in radians
Zigfn matrixPerspective(fovY: f64, aspect: f64, nearPlane: f64, farPlane: f64) Matrix
CMatrix MatrixPerspective(double fovY, double aspect, double nearPlane, double farPlane)
Used in textures_framebuffer_rendering, models_skybox_rendering.
Get orthographic projection matrix
Zigfn matrixOrtho(left: f64, right: f64, bottom: f64, top: f64, nearPlane: f64, farPlane: f64) Matrix
CMatrix MatrixOrtho(double left, double right, double bottom, double top, double nearPlane, double farPlane)
Get camera look-at matrix (view matrix)
Zigfn matrixLookAt(eye: Vector3, target: Vector3, up: Vector3) Matrix
CMatrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up)
Used in textures_portal_window, models_skybox_rendering, models_decals, models_procedural_decals.
Get float array of matrix data
Zigfn matrixToFloatV(mat: Matrix) float16
Cfloat16 MatrixToFloatV(Matrix mat)
Used in textures_portal_window, raylib_opengl_interop.
Add two quaternions
Zigfn quaternionAdd(q1: Quaternion, q2: Quaternion) Quaternion
CQuaternion QuaternionAdd(Quaternion q1, Quaternion q2)
Add quaternion and float value
Zigfn quaternionAddValue(q: Quaternion, add: f32) Quaternion
CQuaternion QuaternionAddValue(Quaternion q, float add)
Subtract two quaternions
Zigfn quaternionSubtract(q1: Quaternion, q2: Quaternion) Quaternion
CQuaternion QuaternionSubtract(Quaternion q1, Quaternion q2)
Subtract quaternion and float value
Zigfn quaternionSubtractValue(q: Quaternion, sub: f32) Quaternion
CQuaternion QuaternionSubtractValue(Quaternion q, float sub)
Get identity quaternion
Zigfn quaternionIdentity() Quaternion
CQuaternion QuaternionIdentity(void)
Computes the length of a quaternion
Zigfn quaternionLength(q: Quaternion) f32
Cfloat QuaternionLength(Quaternion q)
Normalize provided quaternion
Zigfn quaternionNormalize(q: Quaternion) Quaternion
CQuaternion QuaternionNormalize(Quaternion q)
Invert provided quaternion
Zigfn quaternionInvert(q: Quaternion) Quaternion
CQuaternion QuaternionInvert(Quaternion q)
Used in models_bone_socket.
Calculate two quaternion multiplication
Zigfn quaternionMultiply(q1: Quaternion, q2: Quaternion) Quaternion
CQuaternion QuaternionMultiply(Quaternion q1, Quaternion q2)
Used in models_bone_socket.
Scale quaternion by float value
Zigfn quaternionScale(q: Quaternion, mul: f32) Quaternion
CQuaternion QuaternionScale(Quaternion q, float mul)
Divide two quaternions
Zigfn quaternionDivide(q1: Quaternion, q2: Quaternion) Quaternion
CQuaternion QuaternionDivide(Quaternion q1, Quaternion q2)
Calculate linear interpolation between two quaternions
Zigfn quaternionLerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion
CQuaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount)
Calculate slerp-optimized interpolation between two quaternions
Zigfn quaternionNlerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion
CQuaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount)
Calculates spherical linear interpolation between two quaternions
Zigfn quaternionSlerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion
CQuaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount)
Used in models_animation_blend_custom.
as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic
Zigfn quaternionCubicHermiteSpline(q1: Quaternion, outTangent1: Quaternion, q2: Quaternion, inTangent2: Quaternion, t: f32) Quaternion
CQuaternion QuaternionCubicHermiteSpline(Quaternion q1, Quaternion outTangent1, Quaternion q2, Quaternion inTangent2, float t)
Calculate quaternion based on the rotation from one vector to another
Zigfn quaternionFromVector3ToVector3(from: Vector3, to: Vector3) Quaternion
CQuaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to)
Get a quaternion for a given rotation matrix
Zigfn quaternionFromMatrix(mat: Matrix) Quaternion
CQuaternion QuaternionFromMatrix(Matrix mat)
Get a matrix for a given quaternion
Zigfn quaternionToMatrix(q: Quaternion) Matrix
CMatrix QuaternionToMatrix(Quaternion q)
Used in models_bone_socket, models_animation_blend_custom.
NOTE: Angle must be provided in radians
Zigfn quaternionFromAxisAngle(axis: Vector3, angle: f32) Quaternion
CQuaternion QuaternionFromAxisAngle(Vector3 axis, float angle)
Used in models_bone_socket.
Get the rotation angle and axis for a given quaternion
Zigfn quaternionToAxisAngle(q: Quaternion, outAxis: *Vector3, outAngle: *f32) void
Cvoid QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle)
NOTE: Rotation order is ZYX
Zigfn quaternionFromEuler(pitch: f32, yaw: f32, roll: f32) Quaternion
CQuaternion QuaternionFromEuler(float pitch, float yaw, float roll)
NOTE: Angles are returned in a Vector3 struct in radians
Zigfn quaternionToEuler(q: Quaternion) Vector3
CVector3 QuaternionToEuler(Quaternion q)
Transform a quaternion given a transformation matrix
Zigfn quaternionTransform(q: Quaternion, mat: Matrix) Quaternion
CQuaternion QuaternionTransform(Quaternion q, Matrix mat)
Check whether two given quaternions are almost equal
Zigfn quaternionEquals(p: Quaternion, q: Quaternion) i32
Cint QuaternionEquals(Quaternion p, Quaternion q)
Compose a transformation matrix from rotational, translational and scaling components
Zigfn matrixCompose(translation: Vector3, rotation: Quaternion, scale: Vector3) Matrix
CMatrix MatrixCompose(Vector3 translation, Quaternion rotation, Vector3 scale)
TODO: WARNING: Following raymath convention and make the function self-contained
Zigfn matrixDecompose(mat: Matrix, translation: *Vector3, rotation: *Quaternion, scale: *Vector3) void
Cvoid MatrixDecompose(Matrix mat, Vector3 *translation, Quaternion *rotation, Vector3 *scale)