Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/Eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h')
-rw-r--r--extern/Eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h43
1 files changed, 16 insertions, 27 deletions
diff --git a/extern/Eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h b/extern/Eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h
index a75fa42aeac..ec87da054d6 100644
--- a/extern/Eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h
+++ b/extern/Eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h
@@ -3,27 +3,14 @@
//
// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
//
-// Eigen is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 3 of the License, or (at your option) any later version.
-//
-// Alternatively, you can redistribute it and/or
-// modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
-// the License, or (at your option) any later version.
-//
-// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
-// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License and a copy of the GNU General Public License along with
-// Eigen. If not, see <http://www.gnu.org/licenses/>.
+// This Source Code Form is subject to the terms of the Mozilla
+// Public License v. 2.0. If a copy of the MPL was not distributed
+// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway
+namespace Eigen {
+
template<typename Other,
int OtherRows=Other::RowsAtCompileTime,
int OtherCols=Other::ColsAtCompileTime>
@@ -143,7 +130,7 @@ public:
/** \returns a quaternion representing an identity rotation
* \sa MatrixBase::Identity()
*/
- inline static Quaternion Identity() { return Quaternion(1, 0, 0, 0); }
+ static inline Quaternion Identity() { return Quaternion(1, 0, 0, 0); }
/** \sa Quaternion::Identity(), MatrixBase::setIdentity()
*/
@@ -314,9 +301,9 @@ Quaternion<Scalar>::toRotationMatrix(void) const
// it has to be inlined, and so the return by value is not an issue
Matrix3 res;
- const Scalar tx = 2*this->x();
- const Scalar ty = 2*this->y();
- const Scalar tz = 2*this->z();
+ const Scalar tx = Scalar(2)*this->x();
+ const Scalar ty = Scalar(2)*this->y();
+ const Scalar tz = Scalar(2)*this->z();
const Scalar twx = tx*this->w();
const Scalar twy = ty*this->w();
const Scalar twz = tz*this->w();
@@ -327,15 +314,15 @@ Quaternion<Scalar>::toRotationMatrix(void) const
const Scalar tyz = tz*this->y();
const Scalar tzz = tz*this->z();
- res.coeffRef(0,0) = 1-(tyy+tzz);
+ res.coeffRef(0,0) = Scalar(1)-(tyy+tzz);
res.coeffRef(0,1) = txy-twz;
res.coeffRef(0,2) = txz+twy;
res.coeffRef(1,0) = txy+twz;
- res.coeffRef(1,1) = 1-(txx+tzz);
+ res.coeffRef(1,1) = Scalar(1)-(txx+tzz);
res.coeffRef(1,2) = tyz-twx;
res.coeffRef(2,0) = txz-twy;
res.coeffRef(2,1) = tyz+twx;
- res.coeffRef(2,2) = 1-(txx+tyy);
+ res.coeffRef(2,2) = Scalar(1)-(txx+tyy);
return res;
}
@@ -460,7 +447,7 @@ template<typename Other>
struct ei_quaternion_assign_impl<Other,3,3>
{
typedef typename Other::Scalar Scalar;
- inline static void run(Quaternion<Scalar>& q, const Other& mat)
+ static inline void run(Quaternion<Scalar>& q, const Other& mat)
{
// This algorithm comes from "Quaternion Calculus and Fast Animation",
// Ken Shoemake, 1987 SIGGRAPH course notes
@@ -499,8 +486,10 @@ template<typename Other>
struct ei_quaternion_assign_impl<Other,4,1>
{
typedef typename Other::Scalar Scalar;
- inline static void run(Quaternion<Scalar>& q, const Other& vec)
+ static inline void run(Quaternion<Scalar>& q, const Other& vec)
{
q.coeffs() = vec;
}
};
+
+} // end namespace Eigen