From 4060c45617ed3c05cc83c1fe0b0e696ccb15cdd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 20 Apr 2013 00:42:12 +0200 Subject: [PATCH 1/3] Physics: wat. Brain fart in 39348ddf0633989aee8888e7dcfeff6b077e08ad (or probably f'ed up merge conflict after crashed KDevelop while being interrupted for lack of attention). Next time commit, stash and _then_ test. --- src/Physics/Test/CapsuleTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Physics/Test/CapsuleTest.cpp b/src/Physics/Test/CapsuleTest.cpp index 9e69302fe..9c829f7e8 100644 --- a/src/Physics/Test/CapsuleTest.cpp +++ b/src/Physics/Test/CapsuleTest.cpp @@ -52,7 +52,6 @@ void CapsuleTest::applyTransformation() { CORRADE_COMPARE(capsule.transformedA(), Vector3(-2.0f, 1.0f, 3.0f)); CORRADE_COMPARE(capsule.transformedB(), Vector3(2.0f, -1.0f, -3.0f)); CORRADE_COMPARE(capsule.transformedRadius(), 7.0f); -} /* Apply average scaling to radius */ capsule.applyTransformationMatrix(Matrix4::scaling({Constants::sqrt3(), -Constants::sqrt2(), 2.0f})); From ee1eecad1a7da013aac32206156a59cb921617a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 20 Apr 2013 00:46:46 +0200 Subject: [PATCH 2/3] SceneGraph: wrong assertion. It is easier to just skip the object than explicitly removing duplicates (or worse, cleaning it more than once). --- src/SceneGraph/Object.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SceneGraph/Object.hpp b/src/SceneGraph/Object.hpp index 8940f51de..746258e7a 100644 --- a/src/SceneGraph/Object.hpp +++ b/src/SceneGraph/Object.hpp @@ -346,7 +346,9 @@ template void Object::setClean(std::vector /* Go through all objects and clean them */ for(std::size_t i = 0; i != objects.size(); ++i) { - CORRADE_INTERNAL_ASSERT(objects[i]->isDirty()); + /* The object might be duplicated in the list, don't clean it more than once */ + if(!objects[i]->isDirty()) continue; + objects[i]->setClean(transformations[i]); CORRADE_ASSERT(!objects[i]->isDirty(), "SceneGraph::Object::setClean(): original implementation was not called", ); } From 458e1467658d4cbb411590e1969e34391a82a519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 20 Apr 2013 00:58:32 +0200 Subject: [PATCH 3/3] Math: std::fma() is not available in NaCl's newlib. --- src/Math/Functions.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Math/Functions.h b/src/Math/Functions.h index c1b330ca7..cf49d82cd 100644 --- a/src/Math/Functions.h +++ b/src/Math/Functions.h @@ -289,7 +289,12 @@ Computes and returns @f$ ab + c @f$. template inline T fma(const T& a, const T& b, const T& c); #else template inline typename std::enable_if::value, T>::type fma(T a, T b, T c) { + /** @todo Remove when NaCl's newlib has this fixed */ + #ifndef CORRADE_TARGET_NACL_NEWLIB return std::fma(a, b, c); + #else + return a*b + c; + #endif } template inline Vector fma(const Vector& a, const Vector& b, const Vector& c) { return a*b + c;