From ddff1bcdc0cd6d4a6aac0ce5d16dc0f66f3e35c9 Mon Sep 17 00:00:00 2001 From: erwin coumans Date: Fri, 7 Oct 2016 09:00:49 -0700 Subject: [PATCH] remove some useless global constants, move them right into the constructor --- src/LinearMath/btPolarDecomposition.cpp | 3 +-- src/LinearMath/btPolarDecomposition.h | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/LinearMath/btPolarDecomposition.cpp b/src/LinearMath/btPolarDecomposition.cpp index a4dca7fdd..b3664faa4 100644 --- a/src/LinearMath/btPolarDecomposition.cpp +++ b/src/LinearMath/btPolarDecomposition.cpp @@ -30,8 +30,7 @@ namespace } } -const btScalar btPolarDecomposition::DEFAULT_TOLERANCE = btScalar(0.0001); -const unsigned int btPolarDecomposition::DEFAULT_MAX_ITERATIONS = 16; + btPolarDecomposition::btPolarDecomposition(btScalar tolerance, unsigned int maxIterations) : m_tolerance(tolerance) diff --git a/src/LinearMath/btPolarDecomposition.h b/src/LinearMath/btPolarDecomposition.h index 561566764..1feea0f78 100644 --- a/src/LinearMath/btPolarDecomposition.h +++ b/src/LinearMath/btPolarDecomposition.h @@ -14,8 +14,7 @@ class btPolarDecomposition { public: - static const btScalar DEFAULT_TOLERANCE; - static const unsigned int DEFAULT_MAX_ITERATIONS; + /** * Creates an instance with optional parameters. @@ -25,8 +24,8 @@ class btPolarDecomposition * @param maxIterations - the maximum number of iterations used to achieve * convergence */ - btPolarDecomposition(btScalar tolerance = DEFAULT_TOLERANCE, - unsigned int maxIterations = DEFAULT_MAX_ITERATIONS); + btPolarDecomposition(btScalar tolerance = btScalar(0.0001), + unsigned int maxIterations = 16); /** * Decomposes a matrix into orthogonal and symmetric, positive-definite