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/Geometry')
-rw-r--r--extern/Eigen3/Eigen/src/Geometry/Hyperplane.h2
-rw-r--r--extern/Eigen3/Eigen/src/Geometry/Quaternion.h26
-rw-r--r--extern/Eigen3/Eigen/src/Geometry/Rotation2D.h2
-rw-r--r--extern/Eigen3/Eigen/src/Geometry/Transform.h31
-rw-r--r--extern/Eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h4
5 files changed, 51 insertions, 14 deletions
diff --git a/extern/Eigen3/Eigen/src/Geometry/Hyperplane.h b/extern/Eigen3/Eigen/src/Geometry/Hyperplane.h
index eb0a5877168..d85d3e553f8 100644
--- a/extern/Eigen3/Eigen/src/Geometry/Hyperplane.h
+++ b/extern/Eigen3/Eigen/src/Geometry/Hyperplane.h
@@ -225,7 +225,7 @@ public:
normal() = mat * normal();
else
{
- eigen_assert("invalid traits value in Hyperplane::transform()");
+ eigen_assert(0 && "invalid traits value in Hyperplane::transform()");
}
return *this;
}
diff --git a/extern/Eigen3/Eigen/src/Geometry/Quaternion.h b/extern/Eigen3/Eigen/src/Geometry/Quaternion.h
index 2662d60fed1..9180db67d84 100644
--- a/extern/Eigen3/Eigen/src/Geometry/Quaternion.h
+++ b/extern/Eigen3/Eigen/src/Geometry/Quaternion.h
@@ -182,10 +182,9 @@ public:
template<typename NewScalarType>
inline typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type cast() const
{
- return typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type(
- coeffs().template cast<NewScalarType>());
+ return typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type(derived());
}
-
+
#ifdef EIGEN_QUATERNIONBASE_PLUGIN
# include EIGEN_QUATERNIONBASE_PLUGIN
#endif
@@ -225,22 +224,25 @@ struct traits<Quaternion<_Scalar,_Options> >
typedef _Scalar Scalar;
typedef Matrix<_Scalar,4,1,_Options> Coefficients;
enum{
- IsAligned = bool(EIGEN_ALIGN) && ((int(_Options)&Aligned)==Aligned),
+ IsAligned = internal::traits<Coefficients>::Flags & AlignedBit,
Flags = IsAligned ? (AlignedBit | LvalueBit) : LvalueBit
};
};
}
template<typename _Scalar, int _Options>
-class Quaternion : public QuaternionBase<Quaternion<_Scalar,_Options> >{
+class Quaternion : public QuaternionBase<Quaternion<_Scalar,_Options> >
+{
typedef QuaternionBase<Quaternion<_Scalar,_Options> > Base;
+ enum { IsAligned = internal::traits<Quaternion>::IsAligned };
+
public:
typedef _Scalar Scalar;
EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Quaternion)
using Base::operator*=;
- typedef typename internal::traits<Quaternion<Scalar,_Options> >::Coefficients Coefficients;
+ typedef typename internal::traits<Quaternion>::Coefficients Coefficients;
typedef typename Base::AngleAxisType AngleAxisType;
/** Default constructor leaving the quaternion uninitialized. */
@@ -271,9 +273,16 @@ public:
template<typename Derived>
explicit inline Quaternion(const MatrixBase<Derived>& other) { *this = other; }
+ /** Explicit copy constructor with scalar conversion */
+ template<typename OtherScalar, int OtherOptions>
+ explicit inline Quaternion(const Quaternion<OtherScalar, OtherOptions>& other)
+ { m_coeffs = other.coeffs().template cast<Scalar>(); }
+
inline Coefficients& coeffs() { return m_coeffs;}
inline const Coefficients& coeffs() const { return m_coeffs;}
+ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(IsAligned)
+
protected:
Coefficients m_coeffs;
@@ -673,7 +682,7 @@ QuaternionBase<Derived>::slerp(Scalar t, const QuaternionBase<OtherDerived>& oth
Scalar scale0;
Scalar scale1;
- if (absD>=one)
+ if(absD>=one)
{
scale0 = Scalar(1) - t;
scale1 = t;
@@ -686,9 +695,8 @@ QuaternionBase<Derived>::slerp(Scalar t, const QuaternionBase<OtherDerived>& oth
scale0 = internal::sin( ( Scalar(1) - t ) * theta) / sinTheta;
scale1 = internal::sin( ( t * theta) ) / sinTheta;
- if (d<0)
- scale1 = -scale1;
}
+ if(d<0) scale1 = -scale1;
return Quaternion<Scalar>(scale0 * coeffs() + scale1 * other.coeffs());
}
diff --git a/extern/Eigen3/Eigen/src/Geometry/Rotation2D.h b/extern/Eigen3/Eigen/src/Geometry/Rotation2D.h
index e1214bd3ebb..cf36da1c50c 100644
--- a/extern/Eigen3/Eigen/src/Geometry/Rotation2D.h
+++ b/extern/Eigen3/Eigen/src/Geometry/Rotation2D.h
@@ -89,7 +89,7 @@ public:
/** Concatenates two rotations */
inline Rotation2D& operator*=(const Rotation2D& other)
- { return m_angle += other.m_angle; return *this; }
+ { m_angle += other.m_angle; return *this; }
/** Applies the rotation to a 2D vector */
Vector2 operator* (const Vector2& vec) const
diff --git a/extern/Eigen3/Eigen/src/Geometry/Transform.h b/extern/Eigen3/Eigen/src/Geometry/Transform.h
index 19d012572d4..a694673ebed 100644
--- a/extern/Eigen3/Eigen/src/Geometry/Transform.h
+++ b/extern/Eigen3/Eigen/src/Geometry/Transform.h
@@ -61,7 +61,7 @@ template< typename Lhs,
typename Rhs,
bool AnyProjective =
transform_traits<Lhs>::IsProjective ||
- transform_traits<Lhs>::IsProjective>
+ transform_traits<Rhs>::IsProjective>
struct transform_transform_product_impl;
template< typename Other,
@@ -1391,6 +1391,35 @@ struct transform_transform_product_impl<Transform<Scalar,Dim,LhsMode,LhsOptions>
}
};
+template<typename Scalar, int Dim, int LhsOptions, int RhsOptions>
+struct transform_transform_product_impl<Transform<Scalar,Dim,AffineCompact,LhsOptions>,Transform<Scalar,Dim,Projective,RhsOptions>,true >
+{
+ typedef Transform<Scalar,Dim,AffineCompact,LhsOptions> Lhs;
+ typedef Transform<Scalar,Dim,Projective,RhsOptions> Rhs;
+ typedef Transform<Scalar,Dim,Projective> ResultType;
+ static ResultType run(const Lhs& lhs, const Rhs& rhs)
+ {
+ ResultType res;
+ res.matrix().template topRows<Dim>() = lhs.matrix() * rhs.matrix();
+ res.matrix().row(Dim) = rhs.matrix().row(Dim);
+ return res;
+ }
+};
+
+template<typename Scalar, int Dim, int LhsOptions, int RhsOptions>
+struct transform_transform_product_impl<Transform<Scalar,Dim,Projective,LhsOptions>,Transform<Scalar,Dim,AffineCompact,RhsOptions>,true >
+{
+ typedef Transform<Scalar,Dim,Projective,LhsOptions> Lhs;
+ typedef Transform<Scalar,Dim,AffineCompact,RhsOptions> Rhs;
+ typedef Transform<Scalar,Dim,Projective> ResultType;
+ static ResultType run(const Lhs& lhs, const Rhs& rhs)
+ {
+ ResultType res(lhs.matrix().template leftCols<Dim>() * rhs.matrix());
+ res.matrix().col(Dim) += lhs.matrix().col(Dim);
+ return res;
+ }
+};
+
} // end namespace internal
#endif // EIGEN_TRANSFORM_H
diff --git a/extern/Eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h b/extern/Eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h
index cbe695c7259..2af32678d1c 100644
--- a/extern/Eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h
+++ b/extern/Eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h
@@ -96,7 +96,7 @@ struct quat_product<Architecture::SSE, Derived, OtherDerived, double, Aligned>
*/
t1 = padd(pmul(a_ww, b_xy), pmul(a_yy, b_zw));
t2 = psub(pmul(a_zz, b_xy), pmul(a_xx, b_zw));
-#ifdef __SSE3__
+#ifdef EIGEN_VECTORIZE_SSE3
EIGEN_UNUSED_VARIABLE(mask)
pstore(&res.x(), _mm_addsub_pd(t1, preverse(t2)));
#else
@@ -110,7 +110,7 @@ struct quat_product<Architecture::SSE, Derived, OtherDerived, double, Aligned>
*/
t1 = psub(pmul(a_ww, b_zw), pmul(a_yy, b_xy));
t2 = padd(pmul(a_zz, b_zw), pmul(a_xx, b_xy));
-#ifdef __SSE3__
+#ifdef EIGEN_VECTORIZE_SSE3
EIGEN_UNUSED_VARIABLE(mask)
pstore(&res.z(), preverse(_mm_addsub_pd(preverse(t1), t2)));
#else