New raylib 5.5 raymath functions.

This commit is contained in:
jussi
2024-11-21 14:54:10 +02:00
parent 6317547502
commit 3d5eeac3d7
6 changed files with 1086 additions and 0 deletions

290
API.md
View File

@@ -8835,6 +8835,22 @@ Calculate reflected vector to normal
---
> result = RL.Vector2Min( Vector2 v1, Vector2 v2 )
Get min value for each pair of components
- Success return Vector2
---
> result = RL.Vector2Max( Vector2 v1, Vector2 v2 )
Get max value for each pair of components
- Success return Vector2
---
> result = RL.Vector2Rotate( Vector2 v, float angle )
Rotate vector by angle
@@ -8884,6 +8900,18 @@ Check whether two given vectors are almost equal
---
> result = RL.Vector2Refract( Vector2 v, Vector2 n, float r )
Compute the direction of a refracted ray
v: normalized direction of the incoming ray
n: normalized normal vector of the interface of two optical media
r: ratio of the refractive index of the medium from where the ray comes
to the refractive index of the medium on the other side of the surface
- Success return Vector2
---
## Math - Vector 3
---
@@ -9089,6 +9117,14 @@ Rotates a vector around an axis
---
> result = RL.Vector3MoveTowards( Vector3 v, Vector3 target, float maxDistance )
Move Vector towards target
- Success return Vector3
---
> result = RL.Vector3Lerp( Vector3 v1, Vector3 v2, float amount )
Calculate linear interpolation between two vectors
@@ -9097,6 +9133,15 @@ Calculate linear interpolation between two vectors
---
> result = RL.Vector3CubicHermite( Vector3 v1, Vector3 tangent1, Vector3 v2, Vector3 tangent2, float amount )
Calculate cubic hermite interpolation between two vectors and their tangents
as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic
- Success return Vector3
---
> result = RL.Vector3Reflect( Vector3 v, Vector3 normal )
Calculate reflected vector to normal
@@ -9185,6 +9230,186 @@ on the other side of the surface
---
## Math - Vector4
---
> result = RL.Vector4Zero()
Vector with components value 0.0f
- Success return Vector4
---
> result = RL.Vector4One()
Vector with components value 1.0f
- Success return Vector4
---
> result = RL.Vector4Add( Vector4 v1, Vector4 v2 )
Add two vectors
- Success return Vector4
---
> result = RL.Vector4AddValue( Vector4 v, float add )
Add vector and float value
- Success return Vector4
---
> result = RL.Vector4Subtract( Vector4 v1, Vector4 v2 )
Subtract two vectors
- Success return Vector4
---
> result = RL.Vector4SubtractValue( Vector4 v, float sub )
Subtract vector by float value
- Success return Vector4
---
> result = RL.Vector4Length( Vector4 v )
Calculate vector length
- Success return float
---
> result = RL.Vector4LengthSqr( Vector4 v )
Calculate vector square length
- Success return float
---
> result = RL.Vector4DotProduct( Vector4 v1, Vector4 v2 )
Calculate two vectors dot product
- Success return float
---
> result = RL.Vector4Distance( Vector4 v1, Vector4 v2 )
Calculate distance between two vectors
- Success return float
---
> result = RL.Vector4DistanceSqr( Vector4 v1, Vector4 v2 )
Calculate square distance between two vectors
- Success return float
---
> result = RL.Vector4Scale( Vector4 v, float scalar )
Multiply vector by scalar
- Success return Vector4
---
> result = RL.Vector4Multiply( Vector4 v1, Vector4 v2 )
Multiply vector by vector
- Success return Vector4
---
> result = RL.Vector4Negate( Vector4 v )
Negate provided vector (invert direction)
- Success return Vector4
---
> result = RL.Vector4Divide( Vector4 v1, Vector4 v2 )
Divide vector by vector
- Success return Vector4
---
> result = RL.Vector4Normalize( Vector4 v )
Normalize provided vector
- Success return Vector4
---
> result = RL.Vector4Min( Vector4 v1, Vector4 v2 )
Get min value for each pair of components
- Success return Vector4
---
> result = RL.Vector4Max( Vector4 v1, Vector4 v2 )
Get max value for each pair of components
- Success return Vector4
---
> result = RL.Vector4Lerp( Vector4 v1, Vector4 v2, float amount )
Calculate linear interpolation between two vectors
- Success return Vector4
---
> result = RL.Vector4MoveTowards( Vector4 v, Vector4 target, float maxDistance )
Move Vector towards target
- Success return Vector4
---
> result = RL.Vector4Invert( Vector4 v )
Invert the given vector
- Success return Vector4
---
> result = RL.Vector4Equals( Vector4 v1, Vector4 v2 )
Check whether two given vectors are almost equal
- Success return bool
---
## Math - Matrix
---
@@ -9349,6 +9574,14 @@ Get camera look-at matrix (View matrix)
---
> translation, rotation, scale = RL.MatrixDecompose( Matrix mat )
Decompose a transformation matrix into its rotational, translational and scaling components
- Success return Vector3, Quaternion, Vector3
---
## Math - Quaternion
---
@@ -9465,6 +9698,15 @@ Calculates spherical linear interpolation between two quaternions
---
> result = RL.QuaternionCubicHermiteSpline( Quaternion q1, Quaternion outTangent1, Quaternion q2, Quaternion inTangent2, float t )
Calculate quaternion cubic spline interpolation using Cubic Hermite Spline algorithm
as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic
- Success return Quaternion
---
> result = RL.QuaternionFromVector3ToVector3( Vector3 from, Vector3 to )
Calculate quaternion based on the rotation from one vector to another
@@ -10202,6 +10444,28 @@ NOTE: We store current viewport dimensions
---
> RL.rlSetClipPlanes( float nearPlane, float farPlane )
Set clip planes distances
---
> distance = RL.rlGetCullDistanceNear()
Get cull plane distance near
- Success return float
---
> distance = RL.rlGetCullDistanceFar()
Get cull plane distance far
- Success return float
---
## RLGL - Vertex level operations
---
@@ -10407,6 +10671,14 @@ Disable render texture (fbo), return to default framebuffer
---
> framebuffer = RL.rlGetActiveFramebuffer()
Get the currently active render texture (fbo), 0 for default framebuffer
- Success return int
---
> RL.rlActiveDrawBuffers( int count )
Activate multiple draw color buffers
@@ -10419,6 +10691,12 @@ Blit active framebuffer to main framebuffer
---
> RL.rlBindFramebuffer( int target, int framebuffer )
Bind framebuffer (FBO)
---
## RLGL - General render state
---
@@ -10471,6 +10749,12 @@ Disable backface culling
---
> RL.rlColorMask( bool r, bool g, bool b, bool a )
Color mask control
---
> RL.rlSetCullFace( int mode )
Set face culling mode
@@ -10977,6 +11261,12 @@ Set shader value matrix
---
> RL.rlSetUniformMatrices( int locIndex, Matrix{} mat )
Set shader value matrices
---
> RL.rlSetUniformSampler( int locIndex, int textureId )
Set shader value sampler