This commit is contained in:
Jeffery Myers 2026-08-24 08:10:39 +08:00 • committed by GitHub
commit 497fd0e0d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 299 additions and 151 deletions

View file

@ -43,7 +43,7 @@
// Module Functions Declaration // Module Functions Declaration
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
static bool IsUpperBodyBone(const char *boneName); static bool IsUpperBodyBone(const char *boneName);
static void UpdateModelAnimationBones(Model *model, ModelAnimation *anim1, int frame1, static void UpdateModelAnimationBoneCustom(Model *model, ModelAnimation *anim1, int frame1,
ModelAnimation *anim2, int frame2, float blend, bool upperBodyBlend); ModelAnimation *anim2, int frame2, float blend, bool upperBodyBlend);
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
@ -117,7 +117,7 @@ int main(void)
// When upperBodyBlend is ON: upper body = attack (1.0), lower body = walk (0.0) // When upperBodyBlend is ON: upper body = attack (1.0), lower body = walk (0.0)
// When upperBodyBlend is OFF: uniform blend at 0.5 (50% walk, 50% attack) // When upperBodyBlend is OFF: uniform blend at 0.5 (50% walk, 50% attack)
float blendFactor = (upperBodyBlend? 1.0f : 0.5f); float blendFactor = (upperBodyBlend? 1.0f : 0.5f);
UpdateModelAnimationBones(&model, &anim0, animCurrentFrame0, UpdateModelAnimationBoneCustom(&model, &anim0, animCurrentFrame0,
&anim1, animCurrentFrame1, blendFactor, upperBodyBlend); &anim1, animCurrentFrame1, blendFactor, upperBodyBlend);
// raylib provided animation blending function // raylib provided animation blending function
@ -194,7 +194,7 @@ static bool IsUpperBodyBone(const char *boneName)
} }
// Blend two animations per-bone with selective upper/lower body blending // Blend two animations per-bone with selective upper/lower body blending
static void UpdateModelAnimationBones(Model *model, ModelAnimation *anim0, int frame0, static void UpdateModelAnimationBoneCustom(Model *model, ModelAnimation *anim0, int frame0,
ModelAnimation *anim1, int frame1, float blend, bool upperBodyBlend) ModelAnimation *anim1, int frame1, float blend, bool upperBodyBlend)
{ {
// Validate inputs // Validate inputs

View file

@ -328,8 +328,9 @@
#define SUPPORT_MESH_GENERATION 1 #define SUPPORT_MESH_GENERATION 1
#endif #endif
#ifndef SUPPORT_GPU_SKINNING #ifndef SUPPORT_GPU_SKINNING
// GPU skinning disabled by default, some GPUs do not support more than 8 VBOs // GPU skinning enabled by default for GL3.3+,
#define SUPPORT_GPU_SKINNING 0 // Some GPUs do not support more than 8 VBOs so you may need to disable it if you have issues loading animated models
#define SUPPORT_GPU_SKINNING 1
#endif #endif
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------

View file

@ -1655,6 +1655,8 @@ RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId);
RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount); // Load model animations from file RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount); // Load model animations from file
RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, float frame); // Update model animation pose (vertex buffers and bone matrices) RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, float frame); // Update model animation pose (vertex buffers and bone matrices)
RLAPI void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend); // Update model animation pose, blending two animations RLAPI void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend); // Update model animation pose, blending two animations
RLAPI void UpdateModelAnimationBones(Model model, ModelAnimation anim, float frame); // Update model animation pose (bones only)
RLAPI void UpdateModelAnimationBonesEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend); // Update model animation bones to pose, blending two animations
RLAPI void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data RLAPI void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data
RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match

View file

@ -182,6 +182,21 @@ static void ProcessMaterialsOBJ(Material *rayMaterials, tinyobj_material_t *mate
// Update model vertex data (positions and normals) // Update model vertex data (positions and normals)
static void UpdateModelAnimationVertexBuffers(Model model); static void UpdateModelAnimationVertexBuffers(Model model);
// Lazy allocation of CPU animation buffers for vertex positions and normals, used for software skinning
static void AllocateMeshCPUAnimBuffers(Mesh* mesh)
{
if (mesh == NULL || mesh->animVertices != NULL || mesh->animNormals != NULL) return; // Buffers already allocated
mesh->animVertices = (float*)RL_CALLOC(mesh->vertexCount * 3, sizeof(float));
memcpy(mesh->animVertices, mesh->vertices, mesh->vertexCount * 3 * sizeof(float));
if (mesh->normals != NULL)
{
mesh->animNormals = (float*)RL_CALLOC(mesh->vertexCount * 3, sizeof(float));
memcpy(mesh->animNormals, mesh->normals, mesh->vertexCount * 3 * sizeof(float));
}
}
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module Functions Definition // Module Functions Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
@ -2306,11 +2321,9 @@ ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount)
return animations; return animations;
} }
// Update model animation data (vertex buffers / bone matrices) for a specific pose // Update model animation data (bone matrices) for a specific pose
// NOTE 1: Request frame could be fractional, using a lerp interpolation between two frames // NOTE 1: Request frame could be fractional, using a lerp interpolation between two frames
// NOTE 2: Updated vertex animation data is uploaded to GPU in case of CPU skinning, void UpdateModelAnimationBones(Model model, ModelAnimation anim, float frame)
// for GPU skinning, bone matrices are uploaded to shader on DrawModelEx()
void UpdateModelAnimation(Model model, ModelAnimation anim, float frame)
{ {
if (model.boneMatrices == NULL) return; if (model.boneMatrices == NULL) return;
@ -2324,8 +2337,8 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, float frame)
int nextFrame = currentFrame + 1; int nextFrame = currentFrame + 1;
float blend = frame - currentFrame; float blend = frame - currentFrame;
blend = Clamp(blend, 0.0f, 1.0f); blend = Clamp(blend, 0.0f, 1.0f);
if (currentFrame >= anim.keyframeCount) currentFrame = currentFrame%anim.keyframeCount; if (currentFrame >= anim.keyframeCount) currentFrame = currentFrame % anim.keyframeCount;
if (nextFrame >= anim.keyframeCount) nextFrame = nextFrame%anim.keyframeCount; if (nextFrame >= anim.keyframeCount) nextFrame = nextFrame % anim.keyframeCount;
Matrix bindPoseMatrix = { 0 }; Matrix bindPoseMatrix = { 0 };
Matrix currentPoseMatrix = { 0 }; Matrix currentPoseMatrix = { 0 };
@ -2347,13 +2360,13 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, float frame)
// Compute runtime bone matrix from model current pose // Compute runtime bone matrix from model current pose
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
Transform *bindPoseTransform = &model.skeleton.bindPose[boneIndex]; Transform* bindPoseTransform = &model.skeleton.bindPose[boneIndex];
bindPoseMatrix = MatrixMultiply( bindPoseMatrix = MatrixMultiply(
MatrixMultiply(MatrixScale(bindPoseTransform->scale.x, bindPoseTransform->scale.y, bindPoseTransform->scale.z), MatrixMultiply(MatrixScale(bindPoseTransform->scale.x, bindPoseTransform->scale.y, bindPoseTransform->scale.z),
QuaternionToMatrix(bindPoseTransform->rotation)), QuaternionToMatrix(bindPoseTransform->rotation)),
MatrixTranslate(bindPoseTransform->translation.x, bindPoseTransform->translation.y, bindPoseTransform->translation.z)); MatrixTranslate(bindPoseTransform->translation.x, bindPoseTransform->translation.y, bindPoseTransform->translation.z));
Transform *currentPoseTransform = &model.currentPose[boneIndex]; Transform* currentPoseTransform = &model.currentPose[boneIndex];
currentPoseMatrix = MatrixMultiply( currentPoseMatrix = MatrixMultiply(
MatrixMultiply(MatrixScale(currentPoseTransform->scale.x, currentPoseTransform->scale.y, currentPoseTransform->scale.z), MatrixMultiply(MatrixScale(currentPoseTransform->scale.x, currentPoseTransform->scale.y, currentPoseTransform->scale.z),
QuaternionToMatrix(currentPoseTransform->rotation)), QuaternionToMatrix(currentPoseTransform->rotation)),
@ -2362,6 +2375,18 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, float frame)
model.boneMatrices[boneIndex] = MatrixMultiply(MatrixInvert(bindPoseMatrix), currentPoseMatrix); model.boneMatrices[boneIndex] = MatrixMultiply(MatrixInvert(bindPoseMatrix), currentPoseMatrix);
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
} }
}
}
// Update model animation data (vertex buffers / bone matrices) for a specific pose
// NOTE 1: Request frame could be fractional, using a lerp interpolation between two frames
// NOTE 2: Updated vertex animation data is uploaded to GPU in case of CPU skinning,
// for GPU skinning, bone matrices are uploaded to shader on DrawModelEx()
void UpdateModelAnimation(Model model, ModelAnimation anim, float frame)
{
if ((anim.keyframeCount > 0) && (model.skeleton.bones != NULL) && (anim.keyframePoses != NULL))
{
UpdateModelAnimationBones(model, anim, frame);
// CPU skinning, updates CPU buffers and uploads them to GPU // CPU skinning, updates CPU buffers and uploads them to GPU
// NOTE: On GPU skinning not supported, use CPU skinning // NOTE: On GPU skinning not supported, use CPU skinning
@ -2369,12 +2394,10 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, float frame)
} }
} }
// Update model animation data (vertex buffers / bone matrices) for a specific pose, // Update model animation data (bone matrices) for a specific pose,
// defined by two different animations at specific frames blended together // defined by two different animations at specific frames blended together
// NOTE 1: Request frames could be fractional, using a lerp interpolation between two frames // NOTE 1: Request frames could be fractional, using a lerp interpolation between two frames
// NOTE 2: Updated vertex animation data is uploaded to GPU in case of CPU skinning, void UpdateModelAnimationBonesEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend)
// for GPU skinning, bone matrices are uploaded to shader on DrawModelEx()
void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend)
{ {
if (model.boneMatrices == NULL) return; if (model.boneMatrices == NULL) return;
@ -2383,20 +2406,20 @@ void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, Mod
(blend >= 0.0f) && (blend <= 1.0f)) (blend >= 0.0f) && (blend <= 1.0f))
{ {
// Inter-frame interpolation values for first animation // Inter-frame interpolation values for first animation
int currentFrameA = (int)frameA%animA.keyframeCount; int currentFrameA = (int)frameA % animA.keyframeCount;
int nextFrameA = currentFrameA + 1; int nextFrameA = currentFrameA + 1;
float blendA = frameA - currentFrameA; float blendA = frameA - currentFrameA;
blendA = Clamp(blendA, 0.0f, 1.0f); blendA = Clamp(blendA, 0.0f, 1.0f);
if (currentFrameA >= animA.keyframeCount) currentFrameA = currentFrameA%animA.keyframeCount; if (currentFrameA >= animA.keyframeCount) currentFrameA = currentFrameA % animA.keyframeCount;
if (nextFrameA >= animA.keyframeCount) nextFrameA = nextFrameA%animA.keyframeCount; if (nextFrameA >= animA.keyframeCount) nextFrameA = nextFrameA % animA.keyframeCount;
// Inter-frame interpolation values for second animation // Inter-frame interpolation values for second animation
int currentFrameB = (int)frameB%animB.keyframeCount; int currentFrameB = (int)frameB % animB.keyframeCount;
int nextFrameB = currentFrameB + 1; int nextFrameB = currentFrameB + 1;
float blendB = frameB - currentFrameB; float blendB = frameB - currentFrameB;
blendB = Clamp(blendB, 0.0f, 1.0f); blendB = Clamp(blendB, 0.0f, 1.0f);
if (currentFrameB >= animB.keyframeCount) currentFrameB = currentFrameB%animB.keyframeCount; if (currentFrameB >= animB.keyframeCount) currentFrameB = currentFrameB % animB.keyframeCount;
if (nextFrameB >= animB.keyframeCount) nextFrameB = nextFrameB%animB.keyframeCount; if (nextFrameB >= animB.keyframeCount) nextFrameB = nextFrameB % animB.keyframeCount;
Matrix bindPoseMatrix = { 0 }; Matrix bindPoseMatrix = { 0 };
Matrix currentPoseMatrix = { 0 }; Matrix currentPoseMatrix = { 0 };
@ -2433,13 +2456,13 @@ void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, Mod
// Compute runtime bone matrix from model current pose // Compute runtime bone matrix from model current pose
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
Transform *bindPoseTransform = &model.skeleton.bindPose[boneIndex]; Transform* bindPoseTransform = &model.skeleton.bindPose[boneIndex];
bindPoseMatrix = MatrixMultiply( bindPoseMatrix = MatrixMultiply(
MatrixMultiply(MatrixScale(bindPoseTransform->scale.x, bindPoseTransform->scale.y, bindPoseTransform->scale.z), MatrixMultiply(MatrixScale(bindPoseTransform->scale.x, bindPoseTransform->scale.y, bindPoseTransform->scale.z),
QuaternionToMatrix(bindPoseTransform->rotation)), QuaternionToMatrix(bindPoseTransform->rotation)),
MatrixTranslate(bindPoseTransform->translation.x, bindPoseTransform->translation.y, bindPoseTransform->translation.z)); MatrixTranslate(bindPoseTransform->translation.x, bindPoseTransform->translation.y, bindPoseTransform->translation.z));
Transform *currentPoseTransform = &model.currentPose[boneIndex]; Transform* currentPoseTransform = &model.currentPose[boneIndex];
currentPoseMatrix = MatrixMultiply( currentPoseMatrix = MatrixMultiply(
MatrixMultiply(MatrixScale(currentPoseTransform->scale.x, currentPoseTransform->scale.y, currentPoseTransform->scale.z), MatrixMultiply(MatrixScale(currentPoseTransform->scale.x, currentPoseTransform->scale.y, currentPoseTransform->scale.z),
QuaternionToMatrix(currentPoseTransform->rotation)), QuaternionToMatrix(currentPoseTransform->rotation)),
@ -2477,6 +2500,23 @@ void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, Mod
MatrixScale(boneScale.x, boneScale.y, boneScale.z)); MatrixScale(boneScale.x, boneScale.y, boneScale.z));
*/ */
} }
}
}
// Update model animation data (vertex buffers / bone matrices) for a specific pose,
// defined by two different animations at specific frames blended together
// NOTE 1: Request frames could be fractional, using a lerp interpolation between two frames
// NOTE 2: Updated vertex animation data is uploaded to GPU in case of CPU skinning,
// for GPU skinning, bone matrices are uploaded to shader on DrawModelEx()
void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend)
{
if (model.boneMatrices == NULL) return;
if ((animA.keyframeCount > 0) && (animA.keyframePoses != NULL) &&
(animB.keyframeCount > 0) && (animB.keyframePoses != NULL) &&
(blend >= 0.0f) && (blend <= 1.0f))
{
UpdateModelAnimationBonesEx(model, animA, frameA, animB, frameB, blend);
// CPU skinning, updates CPU buffers and uploads them to GPU (if available) // CPU skinning, updates CPU buffers and uploads them to GPU (if available)
// NOTE: Fallback in case GPU skinning is not supported or enabled // NOTE: Fallback in case GPU skinning is not supported or enabled
@ -2490,10 +2530,10 @@ static void UpdateModelAnimationVertexBuffers(Model model)
{ {
for (int m = 0; m < model.meshCount; m++) for (int m = 0; m < model.meshCount; m++)
{ {
Mesh mesh = model.meshes[m]; Mesh* mesh = model.meshes + m; // don't copy the mesh, we may need to allocate buffers
Vector3 animVertex = { 0 }; Vector3 animVertex = { 0 };
Vector3 animNormal = { 0 }; Vector3 animNormal = { 0 };
const int vertexValuesCount = mesh.vertexCount*3; const int vertexValuesCount = mesh->vertexCount*3;
int boneIndex = 0; int boneIndex = 0;
int boneCounter = 0; int boneCounter = 0;
@ -2501,45 +2541,52 @@ static void UpdateModelAnimationVertexBuffers(Model model)
bool bufferUpdateRequired = false; // Flag to check when anim vertex information is updated bool bufferUpdateRequired = false; // Flag to check when anim vertex information is updated
// Skip if missing bone data or missing anim buffers initialization // Skip if missing bone data or missing anim buffers initialization
if ((mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) || if ((mesh->boneWeights == NULL) || (mesh->boneIndices == NULL)) continue;
(mesh.animVertices == NULL) || (mesh.animNormals == NULL)) continue;
// Skip if the shader is using the bones directly
#if defined (SUPPORT_GPU_SKINNING)
Material material = model.materials[model.meshMaterial[m]];
if ((material.shader.locs[SHADER_LOC_VERTEX_BONEIDS] != -1) ) continue;
#endif
if (mesh->animVertices == NULL) AllocateMeshCPUAnimBuffers(mesh);
for (int vCounter = 0; vCounter < vertexValuesCount; vCounter += 3) for (int vCounter = 0; vCounter < vertexValuesCount; vCounter += 3)
{ {
mesh.animVertices[vCounter] = 0; mesh->animVertices[vCounter] = 0;
mesh.animVertices[vCounter + 1] = 0; mesh->animVertices[vCounter + 1] = 0;
mesh.animVertices[vCounter + 2] = 0; mesh->animVertices[vCounter + 2] = 0;
if (mesh.animNormals != NULL) if (mesh->animNormals != NULL)
{ {
mesh.animNormals[vCounter] = 0; mesh->animNormals[vCounter] = 0;
mesh.animNormals[vCounter + 1] = 0; mesh->animNormals[vCounter + 1] = 0;
mesh.animNormals[vCounter + 2] = 0; mesh->animNormals[vCounter + 2] = 0;
} }
// Iterates over 4 bones per vertex // Iterates over 4 bones per vertex
for (int j = 0; j < 4; j++, boneCounter++) for (int j = 0; j < 4; j++, boneCounter++)
{ {
boneWeight = mesh.boneWeights[boneCounter]; boneWeight = mesh->boneWeights[boneCounter];
boneIndex = mesh.boneIndices[boneCounter]; boneIndex = mesh->boneIndices[boneCounter];
// Early stop when no transformation will be applied // Early stop when no transformation will be applied
if (boneWeight == 0.0f) continue; if (boneWeight == 0.0f) continue;
animVertex = (Vector3){ mesh.vertices[vCounter], mesh.vertices[vCounter + 1], mesh.vertices[vCounter + 2] }; animVertex = (Vector3){ mesh->vertices[vCounter], mesh->vertices[vCounter + 1], mesh->vertices[vCounter + 2] };
animVertex = Vector3Transform(animVertex, model.boneMatrices[boneIndex]); animVertex = Vector3Transform(animVertex, model.boneMatrices[boneIndex]);
mesh.animVertices[vCounter] += animVertex.x*boneWeight; mesh->animVertices[vCounter] += animVertex.x*boneWeight;
mesh.animVertices[vCounter + 1] += animVertex.y*boneWeight; mesh->animVertices[vCounter + 1] += animVertex.y*boneWeight;
mesh.animVertices[vCounter + 2] += animVertex.z*boneWeight; mesh->animVertices[vCounter + 2] += animVertex.z*boneWeight;
bufferUpdateRequired = true; bufferUpdateRequired = true;
// Normals processing // Normals processing
// NOTE: Using meshes.baseNormals (default normal) to calculate meshes.normals (animated normals) // NOTE: Using meshes.baseNormals (default normal) to calculate meshes.normals (animated normals)
if ((mesh.normals != NULL) && (mesh.animNormals != NULL )) if ((mesh->normals != NULL) && (mesh->animNormals != NULL ))
{ {
animNormal = (Vector3){ mesh.normals[vCounter], mesh.normals[vCounter + 1], mesh.normals[vCounter + 2] }; animNormal = (Vector3){ mesh->normals[vCounter], mesh->normals[vCounter + 1], mesh->normals[vCounter + 2] };
animNormal = Vector3Transform(animNormal, MatrixTranspose(MatrixInvert(model.boneMatrices[boneIndex]))); animNormal = Vector3Transform(animNormal, MatrixTranspose(MatrixInvert(model.boneMatrices[boneIndex])));
mesh.animNormals[vCounter] += animNormal.x*boneWeight; mesh->animNormals[vCounter] += animNormal.x*boneWeight;
mesh.animNormals[vCounter + 1] += animNormal.y*boneWeight; mesh->animNormals[vCounter + 1] += animNormal.y*boneWeight;
mesh.animNormals[vCounter + 2] += animNormal.z*boneWeight; mesh->animNormals[vCounter + 2] += animNormal.z*boneWeight;
} }
} }
} }
@ -2547,8 +2594,8 @@ static void UpdateModelAnimationVertexBuffers(Model model)
if (bufferUpdateRequired) if (bufferUpdateRequired)
{ {
// Update GPU vertex buffers with updated data (position + normals) // Update GPU vertex buffers with updated data (position + normals)
rlUpdateVertexBuffer(mesh.vboId[SHADER_LOC_VERTEX_POSITION], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0); rlUpdateVertexBuffer(mesh->vboId[SHADER_LOC_VERTEX_POSITION], mesh->animVertices, mesh->vertexCount*3*sizeof(float), 0);
if (mesh.normals != NULL) rlUpdateVertexBuffer(mesh.vboId[SHADER_LOC_VERTEX_NORMAL], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); if (mesh->normals != NULL) rlUpdateVertexBuffer(mesh->vboId[SHADER_LOC_VERTEX_NORMAL], mesh->animNormals, mesh->vertexCount*3*sizeof(float), 0);
} }
} }
} }
@ -4836,13 +4883,6 @@ static Model LoadIQM(const char *fileName)
model.meshes[i].triangleCount = imesh[i].num_triangles; model.meshes[i].triangleCount = imesh[i].num_triangles;
model.meshes[i].indices = (unsigned short *)RL_CALLOC(model.meshes[i].triangleCount*3, sizeof(unsigned short)); model.meshes[i].indices = (unsigned short *)RL_CALLOC(model.meshes[i].triangleCount*3, sizeof(unsigned short));
#if !SUPPORT_GPU_SKINNING
// Animated vertex data, processed for rendering
// NOTE: Animated vertex should be re-uploaded to GPU (if not using GPU skinning)
model.meshes[i].animVertices = (float *)RL_CALLOC(model.meshes[i].vertexCount*3, sizeof(float));
model.meshes[i].animNormals = (float *)RL_CALLOC(model.meshes[i].vertexCount*3, sizeof(float));
#endif
} }
// Triangles data processing // Triangles data processing
@ -6342,13 +6382,6 @@ static Model LoadGLTF(const char *fileName)
} }
} }
#if !SUPPORT_GPU_SKINNING
// Animated vertex data (CPU skinning)
model.meshes[meshIndex].animVertices = (float *)RL_CALLOC(model.meshes[meshIndex].vertexCount*3, sizeof(float));
memcpy(model.meshes[meshIndex].animVertices, model.meshes[meshIndex].vertices, model.meshes[meshIndex].vertexCount*3*sizeof(float));
model.meshes[meshIndex].animNormals = (float *)RL_CALLOC(model.meshes[meshIndex].vertexCount*3, sizeof(float));
if (model.meshes[meshIndex].normals != NULL) memcpy(model.meshes[meshIndex].animNormals, model.meshes[meshIndex].normals, model.meshes[meshIndex].vertexCount*3*sizeof(float));
#endif
model.meshes[meshIndex].boneCount = model.skeleton.boneCount; model.meshes[meshIndex].boneCount = model.skeleton.boneCount;
meshIndex++; // Move to next mesh meshIndex++; // Move to next mesh
@ -7012,10 +7045,6 @@ static Model LoadM3D(const char *fileName)
{ {
model.meshes[k].boneIndices = (unsigned char *)RL_CALLOC(model.meshes[k].vertexCount*4, sizeof(unsigned char)); model.meshes[k].boneIndices = (unsigned char *)RL_CALLOC(model.meshes[k].vertexCount*4, sizeof(unsigned char));
model.meshes[k].boneWeights = (float *)RL_CALLOC(model.meshes[k].vertexCount*4, sizeof(float)); model.meshes[k].boneWeights = (float *)RL_CALLOC(model.meshes[k].vertexCount*4, sizeof(float));
#if !SUPPORT_GPU_SKINNING
model.meshes[k].animVertices = (float *)RL_CALLOC(model.meshes[k].vertexCount*3, sizeof(float));
model.meshes[k].animNormals = (float *)RL_CALLOC(model.meshes[k].vertexCount*3, sizeof(float));
#endif
} }
model.meshMaterial[k] = mi + 1; model.meshMaterial[k] = mi + 1;
@ -7218,12 +7247,6 @@ static Model LoadM3D(const char *fileName)
for (i = 0; i < model.meshCount; i++) for (i = 0; i < model.meshCount; i++)
{ {
model.meshes[i].boneCount = model.skeleton.boneCount; model.meshes[i].boneCount = model.skeleton.boneCount;
#if !SUPPORT_GPU_SKINNING
// Initialize vertex buffers for CPU skinning
memcpy(model.meshes[i].animVertices, model.meshes[i].vertices, model.meshes[i].vertexCount*3*sizeof(float));
memcpy(model.meshes[i].animNormals, model.meshes[i].normals, model.meshes[i].vertexCount*3*sizeof(float));
#endif
} }
// Initialize runtime animation data: current pose and bone matrices // Initialize runtime animation data: current pose and bone matrices

View file

@ -11839,6 +11839,56 @@
} }
] ]
}, },
{
"name": "UpdateModelAnimationBones",
"description": "Update model animation pose (bones only)",
"returnType": "void",
"params": [
{
"type": "Model",
"name": "model"
},
{
"type": "ModelAnimation",
"name": "anim"
},
{
"type": "float",
"name": "frame"
}
]
},
{
"name": "UpdateModelAnimationBonesEx",
"description": "Update model animation bones to pose, blending two animations",
"returnType": "void",
"params": [
{
"type": "Model",
"name": "model"
},
{
"type": "ModelAnimation",
"name": "animA"
},
{
"type": "float",
"name": "frameA"
},
{
"type": "ModelAnimation",
"name": "animB"
},
{
"type": "float",
"name": "frameB"
},
{
"type": "float",
"name": "blend"
}
]
},
{ {
"name": "UnloadModelAnimations", "name": "UnloadModelAnimations",
"description": "Unload animation array data", "description": "Unload animation array data",

View file

@ -7999,6 +7999,29 @@ return {
{type = "float", name = "blend"} {type = "float", name = "blend"}
} }
}, },
{
name = "UpdateModelAnimationBones",
description = "Update model animation pose (bones only)",
returnType = "void",
params = {
{type = "Model", name = "model"},
{type = "ModelAnimation", name = "anim"},
{type = "float", name = "frame"}
}
},
{
name = "UpdateModelAnimationBonesEx",
description = "Update model animation bones to pose, blending two animations",
returnType = "void",
params = {
{type = "Model", name = "model"},
{type = "ModelAnimation", name = "animA"},
{type = "float", name = "frameA"},
{type = "ModelAnimation", name = "animB"},
{type = "float", name = "frameB"},
{type = "float", name = "blend"}
}
},
{ {
name = "UnloadModelAnimations", name = "UnloadModelAnimations",
description = "Unload animation array data", description = "Unload animation array data",

View file

@ -6095,6 +6095,25 @@
((type "float") (name "frameB")) ((type "float") (name "frameB"))
((type "float") (name "blend")))) ((type "float") (name "blend"))))
((name "UpdateModelAnimationBones")
(description "Update model animation pose (bones only)")
(return-type "void")
(params
((type "Model") (name "model"))
((type "ModelAnimation") (name "anim"))
((type "float") (name "frame"))))
((name "UpdateModelAnimationBonesEx")
(description "Update model animation bones to pose, blending two animations")
(return-type "void")
(params
((type "Model") (name "model"))
((type "ModelAnimation") (name "animA"))
((type "float") (name "frameA"))
((type "ModelAnimation") (name "animB"))
((type "float") (name "frameB"))
((type "float") (name "blend"))))
((name "UnloadModelAnimations") ((name "UnloadModelAnimations")
(description "Unload animation array data") (description "Unload animation array data")
(return-type "void") (return-type "void")

View file

@ -995,7 +995,7 @@ Callback 006: AudioCallback() (2 input parameters)
Param[1]: bufferData (type: void *) Param[1]: bufferData (type: void *)
Param[2]: frames (type: unsigned int) Param[2]: frames (type: unsigned int)
Functions found: 613 Functions found: 615
Function 001: InitWindow() (3 input parameters) Function 001: InitWindow() (3 input parameters)
Name: InitWindow Name: InitWindow
@ -4489,19 +4489,36 @@ Function 537: UpdateModelAnimationEx() (6 input parameters)
Param[4]: animB (type: ModelAnimation) Param[4]: animB (type: ModelAnimation)
Param[5]: frameB (type: float) Param[5]: frameB (type: float)
Param[6]: blend (type: float) Param[6]: blend (type: float)
Function 538: UnloadModelAnimations() (2 input parameters) Function 538: UpdateModelAnimationBones() (3 input parameters)
Name: UpdateModelAnimationBones
Return type: void
Description: Update model animation pose (bones only)
Param[1]: model (type: Model)
Param[2]: anim (type: ModelAnimation)
Param[3]: frame (type: float)
Function 539: UpdateModelAnimationBonesEx() (6 input parameters)
Name: UpdateModelAnimationBonesEx
Return type: void
Description: Update model animation bones to pose, blending two animations
Param[1]: model (type: Model)
Param[2]: animA (type: ModelAnimation)
Param[3]: frameA (type: float)
Param[4]: animB (type: ModelAnimation)
Param[5]: frameB (type: float)
Param[6]: blend (type: float)
Function 540: UnloadModelAnimations() (2 input parameters)
Name: UnloadModelAnimations Name: UnloadModelAnimations
Return type: void Return type: void
Description: Unload animation array data Description: Unload animation array data
Param[1]: animations (type: ModelAnimation *) Param[1]: animations (type: ModelAnimation *)
Param[2]: animCount (type: int) Param[2]: animCount (type: int)
Function 539: IsModelAnimationValid() (2 input parameters) Function 541: IsModelAnimationValid() (2 input parameters)
Name: IsModelAnimationValid Name: IsModelAnimationValid
Return type: bool Return type: bool
Description: Check model animation skeleton match Description: Check model animation skeleton match
Param[1]: model (type: Model) Param[1]: model (type: Model)
Param[2]: anim (type: ModelAnimation) Param[2]: anim (type: ModelAnimation)
Function 540: CheckCollisionSpheres() (4 input parameters) Function 542: CheckCollisionSpheres() (4 input parameters)
Name: CheckCollisionSpheres Name: CheckCollisionSpheres
Return type: bool Return type: bool
Description: Check collision between two spheres Description: Check collision between two spheres
@ -4509,40 +4526,40 @@ Function 540: CheckCollisionSpheres() (4 input parameters)
Param[2]: radius1 (type: float) Param[2]: radius1 (type: float)
Param[3]: center2 (type: Vector3) Param[3]: center2 (type: Vector3)
Param[4]: radius2 (type: float) Param[4]: radius2 (type: float)
Function 541: CheckCollisionBoxes() (2 input parameters) Function 543: CheckCollisionBoxes() (2 input parameters)
Name: CheckCollisionBoxes Name: CheckCollisionBoxes
Return type: bool Return type: bool
Description: Check collision between two bounding boxes Description: Check collision between two bounding boxes
Param[1]: box1 (type: BoundingBox) Param[1]: box1 (type: BoundingBox)
Param[2]: box2 (type: BoundingBox) Param[2]: box2 (type: BoundingBox)
Function 542: CheckCollisionBoxSphere() (3 input parameters) Function 544: CheckCollisionBoxSphere() (3 input parameters)
Name: CheckCollisionBoxSphere Name: CheckCollisionBoxSphere
Return type: bool Return type: bool
Description: Check collision between box and sphere Description: Check collision between box and sphere
Param[1]: box (type: BoundingBox) Param[1]: box (type: BoundingBox)
Param[2]: center (type: Vector3) Param[2]: center (type: Vector3)
Param[3]: radius (type: float) Param[3]: radius (type: float)
Function 543: GetRayCollisionSphere() (3 input parameters) Function 545: GetRayCollisionSphere() (3 input parameters)
Name: GetRayCollisionSphere Name: GetRayCollisionSphere
Return type: RayCollision Return type: RayCollision
Description: Get collision info between ray and sphere Description: Get collision info between ray and sphere
Param[1]: ray (type: Ray) Param[1]: ray (type: Ray)
Param[2]: center (type: Vector3) Param[2]: center (type: Vector3)
Param[3]: radius (type: float) Param[3]: radius (type: float)
Function 544: GetRayCollisionBox() (2 input parameters) Function 546: GetRayCollisionBox() (2 input parameters)
Name: GetRayCollisionBox Name: GetRayCollisionBox
Return type: RayCollision Return type: RayCollision
Description: Get collision info between ray and box Description: Get collision info between ray and box
Param[1]: ray (type: Ray) Param[1]: ray (type: Ray)
Param[2]: box (type: BoundingBox) Param[2]: box (type: BoundingBox)
Function 545: GetRayCollisionMesh() (3 input parameters) Function 547: GetRayCollisionMesh() (3 input parameters)
Name: GetRayCollisionMesh Name: GetRayCollisionMesh
Return type: RayCollision Return type: RayCollision
Description: Get collision info between ray and mesh Description: Get collision info between ray and mesh
Param[1]: ray (type: Ray) Param[1]: ray (type: Ray)
Param[2]: mesh (type: Mesh) Param[2]: mesh (type: Mesh)
Param[3]: transform (type: Matrix) Param[3]: transform (type: Matrix)
Function 546: GetRayCollisionTriangle() (4 input parameters) Function 548: GetRayCollisionTriangle() (4 input parameters)
Name: GetRayCollisionTriangle Name: GetRayCollisionTriangle
Return type: RayCollision Return type: RayCollision
Description: Get collision info between ray and triangle Description: Get collision info between ray and triangle
@ -4550,7 +4567,7 @@ Function 546: GetRayCollisionTriangle() (4 input parameters)
Param[2]: p1 (type: Vector3) Param[2]: p1 (type: Vector3)
Param[3]: p2 (type: Vector3) Param[3]: p2 (type: Vector3)
Param[4]: p3 (type: Vector3) Param[4]: p3 (type: Vector3)
Function 547: GetRayCollisionQuad() (5 input parameters) Function 549: GetRayCollisionQuad() (5 input parameters)
Name: GetRayCollisionQuad Name: GetRayCollisionQuad
Return type: RayCollision Return type: RayCollision
Description: Get collision info between ray and quad Description: Get collision info between ray and quad
@ -4559,158 +4576,158 @@ Function 547: GetRayCollisionQuad() (5 input parameters)
Param[3]: p2 (type: Vector3) Param[3]: p2 (type: Vector3)
Param[4]: p3 (type: Vector3) Param[4]: p3 (type: Vector3)
Param[5]: p4 (type: Vector3) Param[5]: p4 (type: Vector3)
Function 548: InitAudioDevice() (0 input parameters) Function 550: InitAudioDevice() (0 input parameters)
Name: InitAudioDevice Name: InitAudioDevice
Return type: void Return type: void
Description: Initialize audio device and context Description: Initialize audio device and context
No input parameters No input parameters
Function 549: CloseAudioDevice() (0 input parameters) Function 551: CloseAudioDevice() (0 input parameters)
Name: CloseAudioDevice Name: CloseAudioDevice
Return type: void Return type: void
Description: Close the audio device and context Description: Close the audio device and context
No input parameters No input parameters
Function 550: IsAudioDeviceReady() (0 input parameters) Function 552: IsAudioDeviceReady() (0 input parameters)
Name: IsAudioDeviceReady Name: IsAudioDeviceReady
Return type: bool Return type: bool
Description: Check if audio device has been initialized successfully Description: Check if audio device has been initialized successfully
No input parameters No input parameters
Function 551: SetMasterVolume() (1 input parameters) Function 553: SetMasterVolume() (1 input parameters)
Name: SetMasterVolume Name: SetMasterVolume
Return type: void Return type: void
Description: Set master volume (listener) Description: Set master volume (listener)
Param[1]: volume (type: float) Param[1]: volume (type: float)
Function 552: GetMasterVolume() (0 input parameters) Function 554: GetMasterVolume() (0 input parameters)
Name: GetMasterVolume Name: GetMasterVolume
Return type: float Return type: float
Description: Get master volume (listener) Description: Get master volume (listener)
No input parameters No input parameters
Function 553: LoadWave() (1 input parameters) Function 555: LoadWave() (1 input parameters)
Name: LoadWave Name: LoadWave
Return type: Wave Return type: Wave
Description: Load wave data from file Description: Load wave data from file
Param[1]: fileName (type: const char *) Param[1]: fileName (type: const char *)
Function 554: LoadWaveFromMemory() (3 input parameters) Function 556: LoadWaveFromMemory() (3 input parameters)
Name: LoadWaveFromMemory Name: LoadWaveFromMemory
Return type: Wave Return type: Wave
Description: Load wave from memory buffer, fileType refers to extension: i.e. '.wav' Description: Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
Param[1]: fileType (type: const char *) Param[1]: fileType (type: const char *)
Param[2]: fileData (type: const unsigned char *) Param[2]: fileData (type: const unsigned char *)
Param[3]: dataSize (type: int) Param[3]: dataSize (type: int)
Function 555: IsWaveValid() (1 input parameters) Function 557: IsWaveValid() (1 input parameters)
Name: IsWaveValid Name: IsWaveValid
Return type: bool Return type: bool
Description: Check if wave data is valid (data loaded and parameters) Description: Check if wave data is valid (data loaded and parameters)
Param[1]: wave (type: Wave) Param[1]: wave (type: Wave)
Function 556: LoadSound() (1 input parameters) Function 558: LoadSound() (1 input parameters)
Name: LoadSound Name: LoadSound
Return type: Sound Return type: Sound
Description: Load sound from file Description: Load sound from file
Param[1]: fileName (type: const char *) Param[1]: fileName (type: const char *)
Function 557: LoadSoundFromWave() (1 input parameters) Function 559: LoadSoundFromWave() (1 input parameters)
Name: LoadSoundFromWave Name: LoadSoundFromWave
Return type: Sound Return type: Sound
Description: Load sound from wave data Description: Load sound from wave data
Param[1]: wave (type: Wave) Param[1]: wave (type: Wave)
Function 558: LoadSoundAlias() (1 input parameters) Function 560: LoadSoundAlias() (1 input parameters)
Name: LoadSoundAlias Name: LoadSoundAlias
Return type: Sound Return type: Sound
Description: Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data Description: Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data
Param[1]: source (type: Sound) Param[1]: source (type: Sound)
Function 559: IsSoundValid() (1 input parameters) Function 561: IsSoundValid() (1 input parameters)
Name: IsSoundValid Name: IsSoundValid
Return type: bool Return type: bool
Description: Check if sound is valid (data loaded and buffers initialized) Description: Check if sound is valid (data loaded and buffers initialized)
Param[1]: sound (type: Sound) Param[1]: sound (type: Sound)
Function 560: UpdateSound() (3 input parameters) Function 562: UpdateSound() (3 input parameters)
Name: UpdateSound Name: UpdateSound
Return type: void Return type: void
Description: Update sound buffer with new data (default data format: 32 bit float, stereo) Description: Update sound buffer with new data (default data format: 32 bit float, stereo)
Param[1]: sound (type: Sound) Param[1]: sound (type: Sound)
Param[2]: data (type: const void *) Param[2]: data (type: const void *)
Param[3]: frameCount (type: int) Param[3]: frameCount (type: int)
Function 561: UnloadWave() (1 input parameters) Function 563: UnloadWave() (1 input parameters)
Name: UnloadWave Name: UnloadWave
Return type: void Return type: void
Description: Unload wave data Description: Unload wave data
Param[1]: wave (type: Wave) Param[1]: wave (type: Wave)
Function 562: UnloadSound() (1 input parameters) Function 564: UnloadSound() (1 input parameters)
Name: UnloadSound Name: UnloadSound
Return type: void Return type: void
Description: Unload sound Description: Unload sound
Param[1]: sound (type: Sound) Param[1]: sound (type: Sound)
Function 563: UnloadSoundAlias() (1 input parameters) Function 565: UnloadSoundAlias() (1 input parameters)
Name: UnloadSoundAlias Name: UnloadSoundAlias
Return type: void Return type: void
Description: Unload sound alias (does not deallocate sample data) Description: Unload sound alias (does not deallocate sample data)
Param[1]: alias (type: Sound) Param[1]: alias (type: Sound)
Function 564: ExportWave() (2 input parameters) Function 566: ExportWave() (2 input parameters)
Name: ExportWave Name: ExportWave
Return type: bool Return type: bool
Description: Export wave data to file, returns true on success Description: Export wave data to file, returns true on success
Param[1]: wave (type: Wave) Param[1]: wave (type: Wave)
Param[2]: fileName (type: const char *) Param[2]: fileName (type: const char *)
Function 565: ExportWaveAsCode() (2 input parameters) Function 567: ExportWaveAsCode() (2 input parameters)
Name: ExportWaveAsCode Name: ExportWaveAsCode
Return type: bool Return type: bool
Description: Export wave sample data to code (.h), returns true on success Description: Export wave sample data to code (.h), returns true on success
Param[1]: wave (type: Wave) Param[1]: wave (type: Wave)
Param[2]: fileName (type: const char *) Param[2]: fileName (type: const char *)
Function 566: PlaySound() (1 input parameters) Function 568: PlaySound() (1 input parameters)
Name: PlaySound Name: PlaySound
Return type: void Return type: void
Description: Play a sound Description: Play a sound
Param[1]: sound (type: Sound) Param[1]: sound (type: Sound)
Function 567: StopSound() (1 input parameters) Function 569: StopSound() (1 input parameters)
Name: StopSound Name: StopSound
Return type: void Return type: void
Description: Stop playing a sound Description: Stop playing a sound
Param[1]: sound (type: Sound) Param[1]: sound (type: Sound)
Function 568: PauseSound() (1 input parameters) Function 570: PauseSound() (1 input parameters)
Name: PauseSound Name: PauseSound
Return type: void Return type: void
Description: Pause a sound Description: Pause a sound
Param[1]: sound (type: Sound) Param[1]: sound (type: Sound)
Function 569: ResumeSound() (1 input parameters) Function 571: ResumeSound() (1 input parameters)
Name: ResumeSound Name: ResumeSound
Return type: void Return type: void
Description: Resume a paused sound Description: Resume a paused sound
Param[1]: sound (type: Sound) Param[1]: sound (type: Sound)
Function 570: IsSoundPlaying() (1 input parameters) Function 572: IsSoundPlaying() (1 input parameters)
Name: IsSoundPlaying Name: IsSoundPlaying
Return type: bool Return type: bool
Description: Check if sound is currently playing Description: Check if sound is currently playing
Param[1]: sound (type: Sound) Param[1]: sound (type: Sound)
Function 571: SetSoundVolume() (2 input parameters) Function 573: SetSoundVolume() (2 input parameters)
Name: SetSoundVolume Name: SetSoundVolume
Return type: void Return type: void
Description: Set volume for a sound (1.0 is max level) Description: Set volume for a sound (1.0 is max level)
Param[1]: sound (type: Sound) Param[1]: sound (type: Sound)
Param[2]: volume (type: float) Param[2]: volume (type: float)
Function 572: SetSoundPitch() (2 input parameters) Function 574: SetSoundPitch() (2 input parameters)
Name: SetSoundPitch Name: SetSoundPitch
Return type: void Return type: void
Description: Set pitch for a sound (1.0 is base level) Description: Set pitch for a sound (1.0 is base level)
Param[1]: sound (type: Sound) Param[1]: sound (type: Sound)
Param[2]: pitch (type: float) Param[2]: pitch (type: float)
Function 573: SetSoundPan() (2 input parameters) Function 575: SetSoundPan() (2 input parameters)
Name: SetSoundPan Name: SetSoundPan
Return type: void Return type: void
Description: Set pan for a sound (-1.0 left, 0.0 center, 1.0 right) Description: Set pan for a sound (-1.0 left, 0.0 center, 1.0 right)
Param[1]: sound (type: Sound) Param[1]: sound (type: Sound)
Param[2]: pan (type: float) Param[2]: pan (type: float)
Function 574: WaveCopy() (1 input parameters) Function 576: WaveCopy() (1 input parameters)
Name: WaveCopy Name: WaveCopy
Return type: Wave Return type: Wave
Description: Copy a wave to a new wave Description: Copy a wave to a new wave
Param[1]: wave (type: Wave) Param[1]: wave (type: Wave)
Function 575: WaveCrop() (3 input parameters) Function 577: WaveCrop() (3 input parameters)
Name: WaveCrop Name: WaveCrop
Return type: void Return type: void
Description: Crop a wave to defined frames range Description: Crop a wave to defined frames range
Param[1]: wave (type: Wave *) Param[1]: wave (type: Wave *)
Param[2]: initFrame (type: int) Param[2]: initFrame (type: int)
Param[3]: finalFrame (type: int) Param[3]: finalFrame (type: int)
Function 576: WaveFormat() (4 input parameters) Function 578: WaveFormat() (4 input parameters)
Name: WaveFormat Name: WaveFormat
Return type: void Return type: void
Description: Convert wave data to desired format Description: Convert wave data to desired format
@ -4718,203 +4735,203 @@ Function 576: WaveFormat() (4 input parameters)
Param[2]: sampleRate (type: int) Param[2]: sampleRate (type: int)
Param[3]: sampleSize (type: int) Param[3]: sampleSize (type: int)
Param[4]: channels (type: int) Param[4]: channels (type: int)
Function 577: LoadWaveSamples() (1 input parameters) Function 579: LoadWaveSamples() (1 input parameters)
Name: LoadWaveSamples Name: LoadWaveSamples
Return type: float * Return type: float *
Description: Load samples data from wave as a 32bit float data array Description: Load samples data from wave as a 32bit float data array
Param[1]: wave (type: Wave) Param[1]: wave (type: Wave)
Function 578: UnloadWaveSamples() (1 input parameters) Function 580: UnloadWaveSamples() (1 input parameters)
Name: UnloadWaveSamples Name: UnloadWaveSamples
Return type: void Return type: void
Description: Unload samples data loaded with LoadWaveSamples() Description: Unload samples data loaded with LoadWaveSamples()
Param[1]: samples (type: float *) Param[1]: samples (type: float *)
Function 579: LoadMusicStream() (1 input parameters) Function 581: LoadMusicStream() (1 input parameters)
Name: LoadMusicStream Name: LoadMusicStream
Return type: Music Return type: Music
Description: Load music stream from file Description: Load music stream from file
Param[1]: fileName (type: const char *) Param[1]: fileName (type: const char *)
Function 580: LoadMusicStreamFromMemory() (3 input parameters) Function 582: LoadMusicStreamFromMemory() (3 input parameters)
Name: LoadMusicStreamFromMemory Name: LoadMusicStreamFromMemory
Return type: Music Return type: Music
Description: Load music stream from data Description: Load music stream from data
Param[1]: fileType (type: const char *) Param[1]: fileType (type: const char *)
Param[2]: data (type: const unsigned char *) Param[2]: data (type: const unsigned char *)
Param[3]: dataSize (type: int) Param[3]: dataSize (type: int)
Function 581: IsMusicValid() (1 input parameters) Function 583: IsMusicValid() (1 input parameters)
Name: IsMusicValid Name: IsMusicValid
Return type: bool Return type: bool
Description: Check if music stream is valid (context and buffers initialized) Description: Check if music stream is valid (context and buffers initialized)
Param[1]: music (type: Music) Param[1]: music (type: Music)
Function 582: UnloadMusicStream() (1 input parameters) Function 584: UnloadMusicStream() (1 input parameters)
Name: UnloadMusicStream Name: UnloadMusicStream
Return type: void Return type: void
Description: Unload music stream Description: Unload music stream
Param[1]: music (type: Music) Param[1]: music (type: Music)
Function 583: PlayMusicStream() (1 input parameters) Function 585: PlayMusicStream() (1 input parameters)
Name: PlayMusicStream Name: PlayMusicStream
Return type: void Return type: void
Description: Start music playing Description: Start music playing
Param[1]: music (type: Music) Param[1]: music (type: Music)
Function 584: IsMusicStreamPlaying() (1 input parameters) Function 586: IsMusicStreamPlaying() (1 input parameters)
Name: IsMusicStreamPlaying Name: IsMusicStreamPlaying
Return type: bool Return type: bool
Description: Check if music is playing Description: Check if music is playing
Param[1]: music (type: Music) Param[1]: music (type: Music)
Function 585: UpdateMusicStream() (1 input parameters) Function 587: UpdateMusicStream() (1 input parameters)
Name: UpdateMusicStream Name: UpdateMusicStream
Return type: void Return type: void
Description: Update buffers for music streaming Description: Update buffers for music streaming
Param[1]: music (type: Music) Param[1]: music (type: Music)
Function 586: StopMusicStream() (1 input parameters) Function 588: StopMusicStream() (1 input parameters)
Name: StopMusicStream Name: StopMusicStream
Return type: void Return type: void
Description: Stop music playing Description: Stop music playing
Param[1]: music (type: Music) Param[1]: music (type: Music)
Function 587: PauseMusicStream() (1 input parameters) Function 589: PauseMusicStream() (1 input parameters)
Name: PauseMusicStream Name: PauseMusicStream
Return type: void Return type: void
Description: Pause music playing Description: Pause music playing
Param[1]: music (type: Music) Param[1]: music (type: Music)
Function 588: ResumeMusicStream() (1 input parameters) Function 590: ResumeMusicStream() (1 input parameters)
Name: ResumeMusicStream Name: ResumeMusicStream
Return type: void Return type: void
Description: Resume playing paused music Description: Resume playing paused music
Param[1]: music (type: Music) Param[1]: music (type: Music)
Function 589: SeekMusicStream() (2 input parameters) Function 591: SeekMusicStream() (2 input parameters)
Name: SeekMusicStream Name: SeekMusicStream
Return type: void Return type: void
Description: Seek music to a position (in seconds) Description: Seek music to a position (in seconds)
Param[1]: music (type: Music) Param[1]: music (type: Music)
Param[2]: position (type: float) Param[2]: position (type: float)
Function 590: SetMusicVolume() (2 input parameters) Function 592: SetMusicVolume() (2 input parameters)
Name: SetMusicVolume Name: SetMusicVolume
Return type: void Return type: void
Description: Set volume for music (1.0 is max level) Description: Set volume for music (1.0 is max level)
Param[1]: music (type: Music) Param[1]: music (type: Music)
Param[2]: volume (type: float) Param[2]: volume (type: float)
Function 591: SetMusicPitch() (2 input parameters) Function 593: SetMusicPitch() (2 input parameters)
Name: SetMusicPitch Name: SetMusicPitch
Return type: void Return type: void
Description: Set pitch for music (1.0 is base level) Description: Set pitch for music (1.0 is base level)
Param[1]: music (type: Music) Param[1]: music (type: Music)
Param[2]: pitch (type: float) Param[2]: pitch (type: float)
Function 592: SetMusicPan() (2 input parameters) Function 594: SetMusicPan() (2 input parameters)
Name: SetMusicPan Name: SetMusicPan
Return type: void Return type: void
Description: Set pan for music (-1.0 left, 0.0 center, 1.0 right) Description: Set pan for music (-1.0 left, 0.0 center, 1.0 right)
Param[1]: music (type: Music) Param[1]: music (type: Music)
Param[2]: pan (type: float) Param[2]: pan (type: float)
Function 593: GetMusicTimeLength() (1 input parameters) Function 595: GetMusicTimeLength() (1 input parameters)
Name: GetMusicTimeLength Name: GetMusicTimeLength
Return type: float Return type: float
Description: Get music time length (in seconds) Description: Get music time length (in seconds)
Param[1]: music (type: Music) Param[1]: music (type: Music)
Function 594: GetMusicTimePlayed() (1 input parameters) Function 596: GetMusicTimePlayed() (1 input parameters)
Name: GetMusicTimePlayed Name: GetMusicTimePlayed
Return type: float Return type: float
Description: Get current music time played (in seconds) Description: Get current music time played (in seconds)
Param[1]: music (type: Music) Param[1]: music (type: Music)
Function 595: LoadAudioStream() (3 input parameters) Function 597: LoadAudioStream() (3 input parameters)
Name: LoadAudioStream Name: LoadAudioStream
Return type: AudioStream Return type: AudioStream
Description: Load audio stream (to stream raw audio pcm data) Description: Load audio stream (to stream raw audio pcm data)
Param[1]: sampleRate (type: unsigned int) Param[1]: sampleRate (type: unsigned int)
Param[2]: sampleSize (type: unsigned int) Param[2]: sampleSize (type: unsigned int)
Param[3]: channels (type: unsigned int) Param[3]: channels (type: unsigned int)
Function 596: IsAudioStreamValid() (1 input parameters) Function 598: IsAudioStreamValid() (1 input parameters)
Name: IsAudioStreamValid Name: IsAudioStreamValid
Return type: bool Return type: bool
Description: Check if an audio stream is valid (buffers initialized) Description: Check if an audio stream is valid (buffers initialized)
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Function 597: UnloadAudioStream() (1 input parameters) Function 599: UnloadAudioStream() (1 input parameters)
Name: UnloadAudioStream Name: UnloadAudioStream
Return type: void Return type: void
Description: Unload audio stream and free memory Description: Unload audio stream and free memory
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Function 598: UpdateAudioStream() (3 input parameters) Function 600: UpdateAudioStream() (3 input parameters)
Name: UpdateAudioStream Name: UpdateAudioStream
Return type: void Return type: void
Description: Update audio stream buffers with data Description: Update audio stream buffers with data
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Param[2]: data (type: const void *) Param[2]: data (type: const void *)
Param[3]: frameCount (type: int) Param[3]: frameCount (type: int)
Function 599: IsAudioStreamProcessed() (1 input parameters) Function 601: IsAudioStreamProcessed() (1 input parameters)
Name: IsAudioStreamProcessed Name: IsAudioStreamProcessed
Return type: bool Return type: bool
Description: Check if any audio stream buffers requires refill Description: Check if any audio stream buffers requires refill
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Function 600: PlayAudioStream() (1 input parameters) Function 602: PlayAudioStream() (1 input parameters)
Name: PlayAudioStream Name: PlayAudioStream
Return type: void Return type: void
Description: Play audio stream Description: Play audio stream
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Function 601: PauseAudioStream() (1 input parameters) Function 603: PauseAudioStream() (1 input parameters)
Name: PauseAudioStream Name: PauseAudioStream
Return type: void Return type: void
Description: Pause audio stream Description: Pause audio stream
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Function 602: ResumeAudioStream() (1 input parameters) Function 604: ResumeAudioStream() (1 input parameters)
Name: ResumeAudioStream Name: ResumeAudioStream
Return type: void Return type: void
Description: Resume audio stream Description: Resume audio stream
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Function 603: IsAudioStreamPlaying() (1 input parameters) Function 605: IsAudioStreamPlaying() (1 input parameters)
Name: IsAudioStreamPlaying Name: IsAudioStreamPlaying
Return type: bool Return type: bool
Description: Check if audio stream is playing Description: Check if audio stream is playing
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Function 604: StopAudioStream() (1 input parameters) Function 606: StopAudioStream() (1 input parameters)
Name: StopAudioStream Name: StopAudioStream
Return type: void Return type: void
Description: Stop audio stream Description: Stop audio stream
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Function 605: SetAudioStreamVolume() (2 input parameters) Function 607: SetAudioStreamVolume() (2 input parameters)
Name: SetAudioStreamVolume Name: SetAudioStreamVolume
Return type: void Return type: void
Description: Set volume for audio stream (1.0 is max level) Description: Set volume for audio stream (1.0 is max level)
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Param[2]: volume (type: float) Param[2]: volume (type: float)
Function 606: SetAudioStreamPitch() (2 input parameters) Function 608: SetAudioStreamPitch() (2 input parameters)
Name: SetAudioStreamPitch Name: SetAudioStreamPitch
Return type: void Return type: void
Description: Set pitch for audio stream (1.0 is base level) Description: Set pitch for audio stream (1.0 is base level)
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Param[2]: pitch (type: float) Param[2]: pitch (type: float)
Function 607: SetAudioStreamPan() (2 input parameters) Function 609: SetAudioStreamPan() (2 input parameters)
Name: SetAudioStreamPan Name: SetAudioStreamPan
Return type: void Return type: void
Description: Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right) Description: Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right)
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Param[2]: pan (type: float) Param[2]: pan (type: float)
Function 608: SetAudioStreamBufferSizeDefault() (1 input parameters) Function 610: SetAudioStreamBufferSizeDefault() (1 input parameters)
Name: SetAudioStreamBufferSizeDefault Name: SetAudioStreamBufferSizeDefault
Return type: void Return type: void
Description: Default size for new audio streams Description: Default size for new audio streams
Param[1]: size (type: int) Param[1]: size (type: int)
Function 609: SetAudioStreamCallback() (2 input parameters) Function 611: SetAudioStreamCallback() (2 input parameters)
Name: SetAudioStreamCallback Name: SetAudioStreamCallback
Return type: void Return type: void
Description: Audio thread callback to request new data Description: Audio thread callback to request new data
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Param[2]: callback (type: AudioCallback) Param[2]: callback (type: AudioCallback)
Function 610: AttachAudioStreamProcessor() (2 input parameters) Function 612: AttachAudioStreamProcessor() (2 input parameters)
Name: AttachAudioStreamProcessor Name: AttachAudioStreamProcessor
Return type: void Return type: void
Description: Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo) Description: Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo)
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Param[2]: processor (type: AudioCallback) Param[2]: processor (type: AudioCallback)
Function 611: DetachAudioStreamProcessor() (2 input parameters) Function 613: DetachAudioStreamProcessor() (2 input parameters)
Name: DetachAudioStreamProcessor Name: DetachAudioStreamProcessor
Return type: void Return type: void
Description: Detach audio stream processor from stream Description: Detach audio stream processor from stream
Param[1]: stream (type: AudioStream) Param[1]: stream (type: AudioStream)
Param[2]: processor (type: AudioCallback) Param[2]: processor (type: AudioCallback)
Function 612: AttachAudioMixedProcessor() (1 input parameters) Function 614: AttachAudioMixedProcessor() (1 input parameters)
Name: AttachAudioMixedProcessor Name: AttachAudioMixedProcessor
Return type: void Return type: void
Description: Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo) Description: Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo)
Param[1]: processor (type: AudioCallback) Param[1]: processor (type: AudioCallback)
Function 613: DetachAudioMixedProcessor() (1 input parameters) Function 615: DetachAudioMixedProcessor() (1 input parameters)
Name: DetachAudioMixedProcessor Name: DetachAudioMixedProcessor
Return type: void Return type: void
Description: Detach audio stream processor from the entire audio pipeline Description: Detach audio stream processor from the entire audio pipeline

View file

@ -681,7 +681,7 @@
<Param type="unsigned int" name="frames" desc="" /> <Param type="unsigned int" name="frames" desc="" />
</Callback> </Callback>
</Callbacks> </Callbacks>
<Functions count="613"> <Functions count="615">
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context"> <Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
<Param type="int" name="width" desc="" /> <Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" /> <Param type="int" name="height" desc="" />
@ -3023,6 +3023,19 @@
<Param type="float" name="frameB" desc="" /> <Param type="float" name="frameB" desc="" />
<Param type="float" name="blend" desc="" /> <Param type="float" name="blend" desc="" />
</Function> </Function>
<Function name="UpdateModelAnimationBones" retType="void" paramCount="3" desc="Update model animation pose (bones only)">
<Param type="Model" name="model" desc="" />
<Param type="ModelAnimation" name="anim" desc="" />
<Param type="float" name="frame" desc="" />
</Function>
<Function name="UpdateModelAnimationBonesEx" retType="void" paramCount="6" desc="Update model animation bones to pose, blending two animations">
<Param type="Model" name="model" desc="" />
<Param type="ModelAnimation" name="animA" desc="" />
<Param type="float" name="frameA" desc="" />
<Param type="ModelAnimation" name="animB" desc="" />
<Param type="float" name="frameB" desc="" />
<Param type="float" name="blend" desc="" />
</Function>
<Function name="UnloadModelAnimations" retType="void" paramCount="2" desc="Unload animation array data"> <Function name="UnloadModelAnimations" retType="void" paramCount="2" desc="Unload animation array data">
<Param type="ModelAnimation *" name="animations" desc="" /> <Param type="ModelAnimation *" name="animations" desc="" />
<Param type="int" name="animCount" desc="" /> <Param type="int" name="animCount" desc="" />