Browse Source

Math : Replaced vector with array in Bezier class and fixed indentation

pull/165/head
Ashwin Ravichandran 10 years ago
parent
commit
6c420936ff
  1. 7
      src/Magnum/Math/Bezier.h
  2. 2
      src/Magnum/Math/CMakeLists.txt
  3. 1
      src/Magnum/Math/Test/BezierTest.cpp

7
src/Magnum/Math/Bezier.h

@ -30,7 +30,7 @@
* @brief Class @ref Magnum::Math::Bezier
*/
#include <vector>
#include <array>
#include "Vector.h"
namespace Magnum { namespace Math {
@ -87,9 +87,9 @@ namespace Magnum { namespace Math {
* @param t The interpolation factor
*
*/
std::vector<std::vector<Vector<dimensions, T>>> calculateIntermediatePoints(Float t) const {
std::array<std::array<Vector<dimensions,T>, order + 1>, order + 1> calculateIntermediatePoints(Float t) const {
const auto n = order + 1;
std::vector<std::vector<Vector<dimensions,T>>> i_points(n,std::vector<Vector<dimensions,T>>(n));
std::array<std::array<Vector<dimensions,T>, n>, n> i_points;
for (UnsignedInt i = 0; i < n; ++i) {
i_points[i][0] = _points[i];
}
@ -115,3 +115,4 @@ namespace Magnum { namespace Math {
}
#endif //Magnum_Math_Bezier_h

2
src/Magnum/Math/CMakeLists.txt

@ -25,7 +25,7 @@
set(MagnumMath_HEADERS
Angle.h
Bezier.h
Bezier.h
BoolVector.h
Color.h
Complex.h

1
src/Magnum/Math/Test/BezierTest.cpp

@ -24,6 +24,7 @@
*/
#include <Corrade/TestSuite/Tester.h>
#include <array>
#include "Magnum/Math/Bezier.h"
namespace Magnum { namespace Math { namespace Test {

Loading…
Cancel
Save