mirror of https://github.com/bjornbytes/lovr.git
Use computed global transforms instead of local;
This commit is contained in:
parent
2f0aab03be
commit
17ffebd6ae
|
@ -10,7 +10,7 @@ static void renderNode(Model* model, int nodeIndex) {
|
|||
bool useMaterials = currentMaterial->isDefault;
|
||||
|
||||
lovrGraphicsPush();
|
||||
lovrGraphicsMatrixTransform(MATRIX_MODEL, model->localNodeTransforms + 16 * nodeIndex);
|
||||
lovrGraphicsMatrixTransform(MATRIX_MODEL, model->globalNodeTransforms + 16 * nodeIndex);
|
||||
|
||||
float globalInverse[16];
|
||||
mat4_set(globalInverse, model->globalNodeTransforms + nodeIndex * 16);
|
||||
|
@ -48,11 +48,12 @@ static void renderNode(Model* model, int nodeIndex) {
|
|||
lovrMeshDraw(model->mesh, NULL);
|
||||
}
|
||||
|
||||
lovrGraphicsPop();
|
||||
|
||||
for (int i = 0; i < node->children.length; i++) {
|
||||
renderNode(model, node->children.data[i]);
|
||||
}
|
||||
|
||||
lovrGraphicsPop();
|
||||
if (useMaterials) {
|
||||
lovrGraphicsSetMaterial(currentMaterial);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue