Reviewed formating, removed assert() #4635
This commit is contained in:
parent
a7686c47b3
commit
ae3c0df206
1 changed files with 5 additions and 6 deletions
|
@ -2277,7 +2277,6 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame)
|
||||||
{
|
{
|
||||||
if (model.meshes[i].boneMatrices)
|
if (model.meshes[i].boneMatrices)
|
||||||
{
|
{
|
||||||
assert(model.meshes[i].boneCount == anim.boneCount);
|
|
||||||
if (firstMeshWithBones == -1)
|
if (firstMeshWithBones == -1)
|
||||||
{
|
{
|
||||||
firstMeshWithBones = i;
|
firstMeshWithBones = i;
|
||||||
|
@ -2286,7 +2285,6 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Update all bones and boneMatrices of first mesh with bones.
|
// Update all bones and boneMatrices of first mesh with bones.
|
||||||
for (int boneId = 0; boneId < anim.boneCount; boneId++)
|
for (int boneId = 0; boneId < anim.boneCount; boneId++)
|
||||||
{
|
{
|
||||||
|
@ -2351,7 +2349,8 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame)
|
||||||
bool updated = false; // Flag to check when anim vertex information is updated
|
bool updated = false; // Flag to check when anim vertex information is updated
|
||||||
const int vValues = mesh.vertexCount*3;
|
const int vValues = mesh.vertexCount*3;
|
||||||
|
|
||||||
if ((mesh.boneWeights==NULL) || (mesh.boneIds==NULL)) continue; // skip if missing bone data, causes segfault without on some models
|
// Skip if missing bone data, causes segfault without on some models
|
||||||
|
if ((mesh.boneWeights == NULL) || (mesh.boneIds == NULL)) continue;
|
||||||
|
|
||||||
for (int vCounter = 0; vCounter < vValues; vCounter += 3)
|
for (int vCounter = 0; vCounter < vValues; vCounter += 3)
|
||||||
{
|
{
|
||||||
|
@ -2364,7 +2363,8 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame)
|
||||||
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];
|
||||||
|
@ -2395,8 +2395,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame)
|
||||||
if (updated)
|
if (updated)
|
||||||
{
|
{
|
||||||
rlUpdateVertexBuffer(mesh.vboId[0], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0); // Update vertex position
|
rlUpdateVertexBuffer(mesh.vboId[0], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0); // Update vertex position
|
||||||
if (mesh.normals != NULL)
|
if (mesh.normals != NULL) rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals
|
||||||
rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue