mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 20:26:03 +08:00
fix QuaternionBase::cast.
It did not work with clang, and I'm unsure how it worked for gcc/msvc since QuaternionBase was introduced
This commit is contained in:
parent
9ca673daed
commit
84cf1b5b1d
@ -182,8 +182,7 @@ public:
|
|||||||
template<typename NewScalarType>
|
template<typename NewScalarType>
|
||||||
inline typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type cast() const
|
inline typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type cast() const
|
||||||
{
|
{
|
||||||
return typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type(
|
return typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type(derived());
|
||||||
coeffs().template cast<NewScalarType>());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EIGEN_QUATERNIONBASE_PLUGIN
|
#ifdef EIGEN_QUATERNIONBASE_PLUGIN
|
||||||
@ -274,6 +273,11 @@ public:
|
|||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
explicit inline Quaternion(const MatrixBase<Derived>& other) { *this = other; }
|
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 Coefficients& coeffs() { return m_coeffs;}
|
||||||
inline const Coefficients& coeffs() const { return m_coeffs;}
|
inline const Coefficients& coeffs() const { return m_coeffs;}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user