4 Commits

Author SHA1 Message Date
Ray
01b1c1c7a4 Inline EaseCubicInOut(), only used once 2026-11-21 20:40:24 +01:00
20a738b64a Invert browser horizontal scroll direction (#6437) 2026-11-21 14:24:40 +01:00
54a3e96b45 [rmodels] Use the per-bone normal matrices in CPU skinning again (#6434)
#6191 computes each bone's normal matrix once per update, but #5921
(merged later from an older branch) brought back the per-vertex
`MatrixTranspose(MatrixInvert(...))` call when it switched the loop to
`Mesh *`. Since then the normal matrices are computed and never used,
and every skinned vertex inverts up to four 4x4 matrices again.

Use `boneNormalMatrices[boneIndex]` in the vertex loop. The animated
vertices and normals are bit-identical.
2026-11-21 14:23:21 +01:00
a291e2437f miniaudio: Update to 0.11.26 (#6429) 2026-11-21 14:22:11 +01:00
4 changed files with 2232 additions and 1165 deletions

3355
src/external/miniaudio.h vendored

File diff suppressed because it is too large Load Diff

View File

@ -1710,8 +1710,8 @@ static EM_BOOL EmscriptenMouseWheelCallback(int eventType, const EmscriptenWheel
if (wheelEvent->deltaMode == DOM_DELTA_LINE) wheelScale = 1.0f/3.0f;
else if (wheelEvent->deltaMode == DOM_DELTA_PAGE) wheelScale = 80.0f;
CORE.Input.Mouse.currentWheelMove.x = (float)wheelEvent->deltaX*wheelScale;
CORE.Input.Mouse.currentWheelMove.y = -(float)wheelEvent->deltaY*wheelScale;
CORE.Input.Mouse.currentWheelMove.x -= (float)wheelEvent->deltaX*wheelScale;
CORE.Input.Mouse.currentWheelMove.y -= (float)wheelEvent->deltaY*wheelScale;
}
return 1; // The event was consumed by the callback handler

View File

@ -2587,7 +2587,7 @@ static void UpdateModelAnimationVertexBuffers(Model model)
if ((mesh->normals != NULL) && (mesh->animNormals != NULL ))
{
animNormal = (Vector3){ mesh->normals[vCounter], mesh->normals[vCounter + 1], mesh->normals[vCounter + 2] };
animNormal = Vector3Transform(animNormal, MatrixTranspose(MatrixInvert(model.boneMatrices[boneIndex])));
animNormal = Vector3Transform(animNormal, boneNormalMatrices[boneIndex]);
mesh->animNormals[vCounter] += animNormal.x*boneWeight;
mesh->animNormals[vCounter + 1] += animNormal.y*boneWeight;
mesh->animNormals[vCounter + 2] += animNormal.z*boneWeight;

View File

@ -79,11 +79,6 @@
static Texture2D texShapes = { 1, 1, 1, 1, 7 }; // Texture used on shapes drawing (white pixel loaded by rlgl)
static Rectangle texShapesRec = { 0.0f, 0.0f, 1.0f, 1.0f }; // Texture source rectangle used on shapes drawing
//----------------------------------------------------------------------------------
// Module Internal Functions Declaration
//----------------------------------------------------------------------------------
static float EaseCubicInOut(float t, float b, float c, float d); // Cubic easing
//----------------------------------------------------------------------------------
// Module Functions Definition
//----------------------------------------------------------------------------------
@ -237,10 +232,17 @@ void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color)
for (int i = 1; i <= SPLINE_SEGMENT_DIVISIONS; i++)
{
current.x = previous.x + (endPos.x - startPos.x)/(float)SPLINE_SEGMENT_DIVISIONS;
// Cubic easing in-out
// NOTE: Easing is calculated only for y position value
current.y = EaseCubicInOut((float)i, startPos.y, endPos.y - startPos.y, (float)SPLINE_SEGMENT_DIVISIONS);
current.x = previous.x + (endPos.x - startPos.x)/(float)SPLINE_SEGMENT_DIVISIONS;
float t = (float)i/(0.5f*(float)SPLINE_SEGMENT_DIVISIONS);
if (t < 1.0f) current.y = 0.5f*(endPos.y - startPos.y)*t*t*t + startPos.y;
else
{
t -= 2.0f;
current.y = 0.5f*(endPos.y - startPos.y)*(t*t*t + 2.0f) + startPos.y;
}
float dy = current.y - previous.y;
float dx = current.x - previous.x;
@ -4546,24 +4548,4 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2)
return overlap;
}
//----------------------------------------------------------------------------------
// Module Internal Functions Definition
//----------------------------------------------------------------------------------
// Cubic easing in-out
// NOTE: Used by DrawLineBezier() only
static float EaseCubicInOut(float t, float b, float c, float d)
{
float result = 0.0f;
t /= 0.5f*d;
if (t < 1) result = 0.5f*c*t*t*t + b;
else
{
t -= 2;
result = 0.5f*c*(t*t*t + 2.0f) + b;
}
return result;
}
#endif // SUPPORT_MODULE_RSHAPES