Browse Source

Merge branch 'master' into compatibility

Vladimír Vondruš 13 years ago
parent
commit
a2d66fac49
  1. 5
      src/Math/Functions.h
  2. 1
      src/Physics/Test/CapsuleTest.cpp
  3. 4
      src/SceneGraph/Object.hpp

5
src/Math/Functions.h

@ -289,7 +289,12 @@ Computes and returns @f$ ab + c @f$.
template<class T> inline T fma(const T& a, const T& b, const T& c);
#else
template<class T> inline typename std::enable_if<std::is_arithmetic<T>::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<std::size_t size, class T> inline Vector<size, T> fma(const Vector<size, T>& a, const Vector<size, T>& b, const Vector<size, T>& c) {
return a*b + c;

1
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}));

4
src/SceneGraph/Object.hpp

@ -347,7 +347,9 @@ template<class Transformation> void Object<Transformation>::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", );
}

Loading…
Cancel
Save