Fix issue when animated model has no animator;

This commit is contained in:
bjorn 2019-05-18 00:30:43 -07:00
parent 976d59e364
commit e3e52a7808
1 changed files with 4 additions and 2 deletions

View File

@ -27,8 +27,10 @@ static void renderNode(Model* model, uint32_t nodeIndex, int instances) {
mat4 globalTransform = model->globalNodeTransforms + 16 * nodeIndex;
if (node->primitiveCount > 0) {
bool animated = node->skin >= 0 && model->animator;
float pose[16 * MAX_BONES];
if (node->skin >= 0 && model->animator) {
if (animated) {
ModelSkin* skin = &model->data->skins[node->skin];
for (uint32_t j = 0; j < skin->jointCount; j++) {
@ -63,7 +65,7 @@ static void renderNode(Model* model, uint32_t nodeIndex, int instances) {
.rangeStart = rangeStart,
.rangeCount = rangeCount,
.instances = instances,
.pose = node->skin >= 0 ? pose : NULL
.pose = animated ? pose : NULL
},
.drawMode = primitive->mode,
.transform = globalTransform,