mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
fix
moar fix optimize cool guy texture
This commit is contained in:
parent
307ab111d0
commit
63b9979ff7
6 changed files with 16 additions and 20 deletions
|
@ -10,6 +10,7 @@
|
|||
#include "SSkinMeshBuffer.h"
|
||||
#include "aabbox3d.h"
|
||||
#include "irrMath.h"
|
||||
#include "irrTypes.h"
|
||||
#include "matrix4.h"
|
||||
#include "quaternion.h"
|
||||
#include "vector3d.h"
|
||||
|
@ -70,8 +71,11 @@ public:
|
|||
void setAnimationSpeed(f32 fps) override;
|
||||
|
||||
//! **Must not be called**.
|
||||
//! TODO refactor Irrlicht so that we need not implement this.
|
||||
IMesh *getMesh(f32) override { assert(false); };
|
||||
IMesh *getMesh(f32) override {
|
||||
// TODO refactor Irrlicht so that we need not implement this.
|
||||
_IRR_DEBUG_BREAK_IF(true);
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
//! Turns the given array of local matrices into an array of global matrices
|
||||
//! by multiplying with respective parent matrices.
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "ISceneManager.h"
|
||||
#include "S3DVertex.h"
|
||||
#include "Transform.h"
|
||||
#include "irrTypes.h"
|
||||
#include "matrix4.h"
|
||||
#include "os.h"
|
||||
#include "SkinnedMesh.h"
|
||||
|
@ -549,7 +550,7 @@ void CAnimatedMeshSceneNode::addJoints()
|
|||
ISceneNode *parent = this;
|
||||
if (joint->ParentJointID)
|
||||
parent = PerJoint.SceneNodes.at(*joint->ParentJointID); // exists because of topo. order
|
||||
assert(parent);
|
||||
_IRR_DEBUG_BREAK_IF(!parent);
|
||||
const auto *matrix = std::get_if<core::matrix4>(&joint->transform);
|
||||
PerJoint.SceneNodes.push_back(new CBoneSceneNode(
|
||||
parent, SceneManager, 0, i, joint->Name,
|
||||
|
|
|
@ -555,13 +555,7 @@ bool CXMeshFileLoader::parseDataObjectFrame(SkinnedMesh::SJoint *Parent)
|
|||
core::matrix4 matrix;
|
||||
if (!parseDataObjectTransformationMatrix(matrix))
|
||||
return false;
|
||||
auto transform = core::Transform::decompose(matrix);
|
||||
// Try to decompose. If the recomposed matrix equals the old one with a liberal tolerance, use that.
|
||||
if (transform.buildMatrix().equals(matrix, 1e-5)) {
|
||||
joint->transform = transform;
|
||||
} else {
|
||||
joint->transform = matrix;
|
||||
}
|
||||
joint->transform = matrix;
|
||||
} else if (objectName == "Mesh") {
|
||||
/*
|
||||
frame.Meshes.push_back(SXMesh());
|
||||
|
|
|
@ -412,7 +412,7 @@ void SkinnedMesh::topoSortJoints()
|
|||
{
|
||||
size_t n = AllJoints.size();
|
||||
|
||||
std::vector<u16> new_to_old_id; // new id -> old id
|
||||
std::vector<u16> new_to_old_id;
|
||||
|
||||
std::vector<std::vector<u16>> children(n);
|
||||
for (u16 i = 0; i < n; ++i) {
|
||||
|
@ -429,7 +429,6 @@ void SkinnedMesh::topoSortJoints()
|
|||
children[new_to_old_id[i]].end());
|
||||
}
|
||||
|
||||
// old id -> new id
|
||||
std::vector<u16> old_to_new_id(n);
|
||||
for (u16 i = 0; i < n; ++i)
|
||||
old_to_new_id[new_to_old_id[i]] = i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue