mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Fixed some issue with scalar multiplications (explicit) and continued with UNIT tests
This commit is contained in:
@@ -46,7 +46,7 @@ protected:
|
||||
* \brief Constructor by value
|
||||
* \param value
|
||||
*/
|
||||
CVector3DBase(double value) : m_i(value), m_j(value), m_k(value) {}
|
||||
explicit CVector3DBase(double value) : m_i(value), m_j(value), m_k(value) {}
|
||||
|
||||
/*!
|
||||
* \brief Copy constructor
|
||||
@@ -225,6 +225,58 @@ public:
|
||||
return v;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Multiply with scalar
|
||||
* \param factor
|
||||
* \return
|
||||
*/
|
||||
CVector3DBase &operator *=(double factor)
|
||||
{
|
||||
this->m_i *= factor;
|
||||
this->m_j *= factor;
|
||||
this->m_k *= factor;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Multiply with scalar
|
||||
* \param factor
|
||||
* \return
|
||||
*/
|
||||
ImplClass operator *(double factor) const
|
||||
{
|
||||
ImplClass v;
|
||||
v += (*this);
|
||||
v *= factor;
|
||||
return v;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Divide by scalar
|
||||
* \param divisor
|
||||
* \return
|
||||
*/
|
||||
CVector3DBase &operator /=(double divisor)
|
||||
{
|
||||
this->m_i /= divisor;
|
||||
this->m_j /= divisor;
|
||||
this->m_k /= divisor;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Divide by scalar
|
||||
* \param divisor
|
||||
* \return
|
||||
*/
|
||||
ImplClass operator /(double divisor) const
|
||||
{
|
||||
ImplClass v;
|
||||
v += (*this);
|
||||
v /= divisor;
|
||||
return v;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Operator /=, just x/x, y/y, z/z
|
||||
* \param otherVector
|
||||
|
||||
Reference in New Issue
Block a user