mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix and clean up skeletal animation (#15722)
* Fix attachments lagging behind their parents (#14818) * Fix animation blending (#14817) * Bring back cool guy as another .x smoke test * Add .x mesh loader unittest * Do bounding box & matrix calculation at proper point in time * Remove obsolete `SAnimatedMesh`
This commit is contained in:
parent
0bb87eb1ff
commit
fde6384a09
40 changed files with 856 additions and 1388 deletions
|
@ -7,7 +7,6 @@
|
|||
#include "IVideoDriver.h"
|
||||
#include "SMesh.h"
|
||||
#include "SMeshBuffer.h"
|
||||
#include "SAnimatedMesh.h"
|
||||
#include "IReadFile.h"
|
||||
#include "fast_atof.h"
|
||||
#include "coreutil.h"
|
||||
|
@ -272,23 +271,19 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file)
|
|||
}
|
||||
}
|
||||
|
||||
// Create the Animated mesh if there's anything in the mesh
|
||||
SAnimatedMesh *animMesh = 0;
|
||||
if (0 != mesh->getMeshBufferCount()) {
|
||||
mesh->recalculateBoundingBox();
|
||||
animMesh = new SAnimatedMesh();
|
||||
animMesh->Type = EAMT_OBJ;
|
||||
animMesh->addMesh(mesh);
|
||||
animMesh->recalculateBoundingBox();
|
||||
}
|
||||
|
||||
// Clean up the allocate obj file contents
|
||||
delete[] buf;
|
||||
// more cleaning up
|
||||
cleanUp();
|
||||
mesh->drop();
|
||||
|
||||
return animMesh;
|
||||
// Nothing in the mesh
|
||||
if (mesh->getMeshBufferCount() == 0) {
|
||||
mesh->drop();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
mesh->recalculateBoundingBox();
|
||||
return mesh;
|
||||
}
|
||||
|
||||
//! Read RGB color
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue