raylib 5.5.0.3rc1__cp314-cp314-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of raylib might be problematic. Click here for more details.

@@ -0,0 +1,249 @@
1
+ /**********************************************************************************************
2
+ *
3
+ * raymath v2.0 - Math functions to work with Vector2, Vector3, Matrix and Quaternions
4
+ *
5
+ * CONVENTIONS:
6
+ * - Matrix structure is defined as row-major (memory layout) but parameters naming AND all
7
+ * math operations performed by the library consider the structure as it was column-major
8
+ * It is like transposed versions of the matrices are used for all the maths
9
+ * It benefits some functions making them cache-friendly and also avoids matrix
10
+ * transpositions sometimes required by OpenGL
11
+ * Example: In memory order, row0 is [m0 m4 m8 m12] but in semantic math row0 is [m0 m1 m2 m3]
12
+ * - Functions are always self-contained, no function use another raymath function inside,
13
+ * required code is directly re-implemented inside
14
+ * - Functions input parameters are always received by value (2 unavoidable exceptions)
15
+ * - Functions use always a "result" variable for return (except C++ operators)
16
+ * - Functions are always defined inline
17
+ * - Angles are always in radians (DEG2RAD/RAD2DEG macros provided for convenience)
18
+ * - No compound literals used to make sure libray is compatible with C++
19
+ *
20
+ * CONFIGURATION:
21
+ * #define RAYMATH_IMPLEMENTATION
22
+ * Generates the implementation of the library into the included file.
23
+ * If not defined, the library is in header only mode and can be included in other headers
24
+ * or source files without problems. But only ONE file should hold the implementation.
25
+ *
26
+ * #define RAYMATH_STATIC_INLINE
27
+ * This may use up lots of memory.
28
+ *
29
+ * #define RAYMATH_DISABLE_CPP_OPERATORS
30
+ * Disables C++ operator overloads for raymath types.
31
+ *
32
+ * LICENSE: zlib/libpng
33
+ *
34
+ * Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
35
+ *
36
+ * This software is provided "as-is", without any express or implied warranty. In no event
37
+ * will the authors be held liable for any damages arising from the use of this software.
38
+ *
39
+ * Permission is granted to anyone to use this software for any purpose, including commercial
40
+ * applications, and to alter it and redistribute it freely, subject to the following restrictions:
41
+ *
42
+ * 1. The origin of this software must not be misrepresented; you must not claim that you
43
+ * wrote the original software. If you use this software in a product, an acknowledgment
44
+ * in the product documentation would be appreciated but is not required.
45
+ *
46
+ * 2. Altered source versions must be plainly marked as such, and must not be misrepresented
47
+ * as being the original software.
48
+ *
49
+ * 3. This notice may not be removed or altered from any source distribution.
50
+ *
51
+ **********************************************************************************************/
52
+ // Function specifiers definition
53
+ //----------------------------------------------------------------------------------
54
+ // Defines and Macros
55
+ //----------------------------------------------------------------------------------
56
+ // Get float vector for Matrix
57
+ // Get float vector for Vector3
58
+ //----------------------------------------------------------------------------------
59
+ // Types and Structures Definition
60
+ //----------------------------------------------------------------------------------
61
+ // NOTE: Helper types to be used instead of array return types for *ToFloat functions
62
+ typedef struct float3 {
63
+ float v[3];
64
+ } float3;
65
+ typedef struct float16 {
66
+ float v[16];
67
+ } float16;
68
+ //----------------------------------------------------------------------------------
69
+ // Module Functions Definition - Utils math
70
+ //----------------------------------------------------------------------------------
71
+ // Clamp float value
72
+ inline /* Functions may be inlined or external definition used*/ float Clamp(float value, float min, float max);// Calculate linear interpolation between two floats
73
+ inline /* Functions may be inlined or external definition used*/ float Lerp(float start, float end, float amount);// Normalize input value within input range
74
+ inline /* Functions may be inlined or external definition used*/ float Normalize(float value, float start, float end);// Remap input value within input range to output range
75
+ inline /* Functions may be inlined or external definition used*/ float Remap(float value, float inputStart, float inputEnd, float outputStart, float outputEnd);// Wrap input value from min to max
76
+ inline /* Functions may be inlined or external definition used*/ float Wrap(float value, float min, float max);// Check whether two given floats are almost equal
77
+ inline /* Functions may be inlined or external definition used*/ int FloatEquals(float x, float y);//----------------------------------------------------------------------------------
78
+ // Module Functions Definition - Vector2 math
79
+ //----------------------------------------------------------------------------------
80
+ // Vector with components value 0.0f
81
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Zero(void);// Vector with components value 1.0f
82
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2One(void);// Add two vectors (v1 + v2)
83
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Add(Vector2 v1, Vector2 v2);// Add vector and float value
84
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2AddValue(Vector2 v, float add);// Subtract two vectors (v1 - v2)
85
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Subtract(Vector2 v1, Vector2 v2);// Subtract vector by float value
86
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2SubtractValue(Vector2 v, float sub);// Calculate vector length
87
+ inline /* Functions may be inlined or external definition used*/ float Vector2Length(Vector2 v);// Calculate vector square length
88
+ inline /* Functions may be inlined or external definition used*/ float Vector2LengthSqr(Vector2 v);// Calculate two vectors dot product
89
+ inline /* Functions may be inlined or external definition used*/ float Vector2DotProduct(Vector2 v1, Vector2 v2);// Calculate distance between two vectors
90
+ inline /* Functions may be inlined or external definition used*/ float Vector2Distance(Vector2 v1, Vector2 v2);// Calculate square distance between two vectors
91
+ inline /* Functions may be inlined or external definition used*/ float Vector2DistanceSqr(Vector2 v1, Vector2 v2);// Calculate angle between two vectors
92
+ // NOTE: Angle is calculated from origin point (0, 0)
93
+ inline /* Functions may be inlined or external definition used*/ float Vector2Angle(Vector2 v1, Vector2 v2);// Calculate angle defined by a two vectors line
94
+ // NOTE: Parameters need to be normalized
95
+ // Current implementation should be aligned with glm::angle
96
+ inline /* Functions may be inlined or external definition used*/ float Vector2LineAngle(Vector2 start, Vector2 end);// Scale vector (multiply by value)
97
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Scale(Vector2 v, float scale);// Multiply vector by vector
98
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Multiply(Vector2 v1, Vector2 v2);// Negate vector
99
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Negate(Vector2 v);// Divide vector by vector
100
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Divide(Vector2 v1, Vector2 v2);// Normalize provided vector
101
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Normalize(Vector2 v);// Transforms a Vector2 by a given Matrix
102
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Transform(Vector2 v, Matrix mat);// Calculate linear interpolation between two vectors
103
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount);// Calculate reflected vector to normal
104
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Reflect(Vector2 v, Vector2 normal);// Get min value for each pair of components
105
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Min(Vector2 v1, Vector2 v2);// Get max value for each pair of components
106
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Max(Vector2 v1, Vector2 v2);// Rotate vector by angle
107
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Rotate(Vector2 v, float angle);// Move Vector towards target
108
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance);// Invert the given vector
109
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Invert(Vector2 v);// Clamp the components of the vector between
110
+ // min and max values specified by the given vectors
111
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max);// Clamp the magnitude of the vector between two min and max values
112
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2ClampValue(Vector2 v, float min, float max);// Check whether two given vectors are almost equal
113
+ inline /* Functions may be inlined or external definition used*/ int Vector2Equals(Vector2 p, Vector2 q);// Compute the direction of a refracted ray
114
+ // v: normalized direction of the incoming ray
115
+ // n: normalized normal vector of the interface of two optical media
116
+ // r: ratio of the refractive index of the medium from where the ray comes
117
+ // to the refractive index of the medium on the other side of the surface
118
+ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Refract(Vector2 v, Vector2 n, float r);//----------------------------------------------------------------------------------
119
+ // Module Functions Definition - Vector3 math
120
+ //----------------------------------------------------------------------------------
121
+ // Vector with components value 0.0f
122
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Zero(void);// Vector with components value 1.0f
123
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3One(void);// Add two vectors
124
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Add(Vector3 v1, Vector3 v2);// Add vector and float value
125
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3AddValue(Vector3 v, float add);// Subtract two vectors
126
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Subtract(Vector3 v1, Vector3 v2);// Subtract vector by float value
127
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3SubtractValue(Vector3 v, float sub);// Multiply vector by scalar
128
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Scale(Vector3 v, float scalar);// Multiply vector by vector
129
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Multiply(Vector3 v1, Vector3 v2);// Calculate two vectors cross product
130
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2);// Calculate one vector perpendicular vector
131
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Perpendicular(Vector3 v);// Calculate vector length
132
+ inline /* Functions may be inlined or external definition used*/ float Vector3Length(const Vector3 v);// Calculate vector square length
133
+ inline /* Functions may be inlined or external definition used*/ float Vector3LengthSqr(const Vector3 v);// Calculate two vectors dot product
134
+ inline /* Functions may be inlined or external definition used*/ float Vector3DotProduct(Vector3 v1, Vector3 v2);// Calculate distance between two vectors
135
+ inline /* Functions may be inlined or external definition used*/ float Vector3Distance(Vector3 v1, Vector3 v2);// Calculate square distance between two vectors
136
+ inline /* Functions may be inlined or external definition used*/ float Vector3DistanceSqr(Vector3 v1, Vector3 v2);// Calculate angle between two vectors
137
+ inline /* Functions may be inlined or external definition used*/ float Vector3Angle(Vector3 v1, Vector3 v2);// Negate provided vector (invert direction)
138
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Negate(Vector3 v);// Divide vector by vector
139
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Divide(Vector3 v1, Vector3 v2);// Normalize provided vector
140
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Normalize(Vector3 v);//Calculate the projection of the vector v1 on to v2
141
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Project(Vector3 v1, Vector3 v2);//Calculate the rejection of the vector v1 on to v2
142
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Reject(Vector3 v1, Vector3 v2);// Orthonormalize provided vectors
143
+ // Makes vectors normalized and orthogonal to each other
144
+ // Gram-Schmidt function implementation
145
+ inline /* Functions may be inlined or external definition used*/ void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2);// Transforms a Vector3 by a given Matrix
146
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Transform(Vector3 v, Matrix mat);// Transform a vector by quaternion rotation
147
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q);// Rotates a vector around an axis
148
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle);// Move Vector towards target
149
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3MoveTowards(Vector3 v, Vector3 target, float maxDistance);// Calculate linear interpolation between two vectors
150
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount);// Calculate cubic hermite interpolation between two vectors and their tangents
151
+ // as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic
152
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3CubicHermite(Vector3 v1, Vector3 tangent1, Vector3 v2, Vector3 tangent2, float amount);// Calculate reflected vector to normal
153
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Reflect(Vector3 v, Vector3 normal);// Get min value for each pair of components
154
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Min(Vector3 v1, Vector3 v2);// Get max value for each pair of components
155
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Max(Vector3 v1, Vector3 v2);// Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c)
156
+ // NOTE: Assumes P is on the plane of the triangle
157
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c);// Projects a Vector3 from screen space into object space
158
+ // NOTE: We are avoiding calling other raymath functions despite available
159
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view);// Get Vector3 as float array
160
+ inline /* Functions may be inlined or external definition used*/ float3 Vector3ToFloatV(Vector3 v);// Invert the given vector
161
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Invert(Vector3 v);// Clamp the components of the vector between
162
+ // min and max values specified by the given vectors
163
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max);// Clamp the magnitude of the vector between two values
164
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3ClampValue(Vector3 v, float min, float max);// Check whether two given vectors are almost equal
165
+ inline /* Functions may be inlined or external definition used*/ int Vector3Equals(Vector3 p, Vector3 q);// Compute the direction of a refracted ray
166
+ // v: normalized direction of the incoming ray
167
+ // n: normalized normal vector of the interface of two optical media
168
+ // r: ratio of the refractive index of the medium from where the ray comes
169
+ // to the refractive index of the medium on the other side of the surface
170
+ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Refract(Vector3 v, Vector3 n, float r);//----------------------------------------------------------------------------------
171
+ // Module Functions Definition - Vector4 math
172
+ //----------------------------------------------------------------------------------
173
+ inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Zero(void);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4One(void);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Add(Vector4 v1, Vector4 v2);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4AddValue(Vector4 v, float add);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Subtract(Vector4 v1, Vector4 v2);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4SubtractValue(Vector4 v, float add);inline /* Functions may be inlined or external definition used*/ float Vector4Length(Vector4 v);inline /* Functions may be inlined or external definition used*/ float Vector4LengthSqr(Vector4 v);inline /* Functions may be inlined or external definition used*/ float Vector4DotProduct(Vector4 v1, Vector4 v2);// Calculate distance between two vectors
174
+ inline /* Functions may be inlined or external definition used*/ float Vector4Distance(Vector4 v1, Vector4 v2);// Calculate square distance between two vectors
175
+ inline /* Functions may be inlined or external definition used*/ float Vector4DistanceSqr(Vector4 v1, Vector4 v2);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Scale(Vector4 v, float scale);// Multiply vector by vector
176
+ inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Multiply(Vector4 v1, Vector4 v2);// Negate vector
177
+ inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Negate(Vector4 v);// Divide vector by vector
178
+ inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Divide(Vector4 v1, Vector4 v2);// Normalize provided vector
179
+ inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Normalize(Vector4 v);// Get min value for each pair of components
180
+ inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Min(Vector4 v1, Vector4 v2);// Get max value for each pair of components
181
+ inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Max(Vector4 v1, Vector4 v2);// Calculate linear interpolation between two vectors
182
+ inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Lerp(Vector4 v1, Vector4 v2, float amount);// Move Vector towards target
183
+ inline /* Functions may be inlined or external definition used*/ Vector4 Vector4MoveTowards(Vector4 v, Vector4 target, float maxDistance);// Invert the given vector
184
+ inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Invert(Vector4 v);// Check whether two given vectors are almost equal
185
+ inline /* Functions may be inlined or external definition used*/ int Vector4Equals(Vector4 p, Vector4 q);//----------------------------------------------------------------------------------
186
+ // Module Functions Definition - Matrix math
187
+ //----------------------------------------------------------------------------------
188
+ // Compute matrix determinant
189
+ inline /* Functions may be inlined or external definition used*/ float MatrixDeterminant(Matrix mat);// Get the trace of the matrix (sum of the values along the diagonal)
190
+ inline /* Functions may be inlined or external definition used*/ float MatrixTrace(Matrix mat);// Transposes provided matrix
191
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixTranspose(Matrix mat);// Invert provided matrix
192
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixInvert(Matrix mat);// Get identity matrix
193
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixIdentity(void);// Add two matrices
194
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixAdd(Matrix left, Matrix right);// Subtract two matrices (left - right)
195
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixSubtract(Matrix left, Matrix right);// Get two matrix multiplication
196
+ // NOTE: When multiplying matrices... the order matters!
197
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixMultiply(Matrix left, Matrix right);// Get translation matrix
198
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixTranslate(float x, float y, float z);// Create rotation matrix from axis and angle
199
+ // NOTE: Angle should be provided in radians
200
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixRotate(Vector3 axis, float angle);// Get x-rotation matrix
201
+ // NOTE: Angle must be provided in radians
202
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixRotateX(float angle);// Get y-rotation matrix
203
+ // NOTE: Angle must be provided in radians
204
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixRotateY(float angle);// Get z-rotation matrix
205
+ // NOTE: Angle must be provided in radians
206
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixRotateZ(float angle);// Get xyz-rotation matrix
207
+ // NOTE: Angle must be provided in radians
208
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixRotateXYZ(Vector3 angle);// Get zyx-rotation matrix
209
+ // NOTE: Angle must be provided in radians
210
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixRotateZYX(Vector3 angle);// Get scaling matrix
211
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixScale(float x, float y, float z);// Get perspective projection matrix
212
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixFrustum(double left, double right, double bottom, double top, double nearPlane, double farPlane);// Get perspective projection matrix
213
+ // NOTE: Fovy angle must be provided in radians
214
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixPerspective(double fovY, double aspect, double nearPlane, double farPlane);// Get orthographic projection matrix
215
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixOrtho(double left, double right, double bottom, double top, double nearPlane, double farPlane);// Get camera look-at matrix (view matrix)
216
+ inline /* Functions may be inlined or external definition used*/ Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up);// Get float array of matrix data
217
+ inline /* Functions may be inlined or external definition used*/ float16 MatrixToFloatV(Matrix mat);//----------------------------------------------------------------------------------
218
+ // Module Functions Definition - Quaternion math
219
+ //----------------------------------------------------------------------------------
220
+ // Add two quaternions
221
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionAdd(Quaternion q1, Quaternion q2);// Add quaternion and float value
222
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionAddValue(Quaternion q, float add);// Subtract two quaternions
223
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2);// Subtract quaternion and float value
224
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionSubtractValue(Quaternion q, float sub);// Get identity quaternion
225
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionIdentity(void);// Computes the length of a quaternion
226
+ inline /* Functions may be inlined or external definition used*/ float QuaternionLength(Quaternion q);// Normalize provided quaternion
227
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionNormalize(Quaternion q);// Invert provided quaternion
228
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionInvert(Quaternion q);// Calculate two quaternion multiplication
229
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2);// Scale quaternion by float value
230
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionScale(Quaternion q, float mul);// Divide two quaternions
231
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionDivide(Quaternion q1, Quaternion q2);// Calculate linear interpolation between two quaternions
232
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount);// Calculate slerp-optimized interpolation between two quaternions
233
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount);// Calculates spherical linear interpolation between two quaternions
234
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);// Calculate quaternion cubic spline interpolation using Cubic Hermite Spline algorithm
235
+ // as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic
236
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionCubicHermiteSpline(Quaternion q1, Quaternion outTangent1, Quaternion q2, Quaternion inTangent2, float t);// Calculate quaternion based on the rotation from one vector to another
237
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to);// Get a quaternion for a given rotation matrix
238
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionFromMatrix(Matrix mat);// Get a matrix for a given quaternion
239
+ inline /* Functions may be inlined or external definition used*/ Matrix QuaternionToMatrix(Quaternion q);// Get rotation quaternion for an angle and axis
240
+ // NOTE: Angle must be provided in radians
241
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle);// Get the rotation angle and axis for a given quaternion
242
+ inline /* Functions may be inlined or external definition used*/ void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle);// Get the quaternion equivalent to Euler angles
243
+ // NOTE: Rotation order is ZYX
244
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionFromEuler(float pitch, float yaw, float roll);// Get the Euler angles equivalent to quaternion (roll, pitch, yaw)
245
+ // NOTE: Angles are returned in a Vector3 struct in radians
246
+ inline /* Functions may be inlined or external definition used*/ Vector3 QuaternionToEuler(Quaternion q);// Transform a quaternion given a transformation matrix
247
+ inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionTransform(Quaternion q, Matrix mat);// Check whether two given quaternions are almost equal
248
+ inline /* Functions may be inlined or external definition used*/ int QuaternionEquals(Quaternion p, Quaternion q);// Decompose a transformation matrix into its rotational, translational and scaling components
249
+ inline /* Functions may be inlined or external definition used*/ void MatrixDecompose(Matrix mat, Vector3 *translation, Quaternion *rotation, Vector3 *scale);