mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Initial structure for refactoring, some conversions still missing. Especially required further test cases.
This commit is contained in:
@@ -14,6 +14,10 @@ namespace BlackMisc
|
||||
namespace Math
|
||||
{
|
||||
|
||||
class CMatrix3x3; // forward declaration
|
||||
class CMatrix3x1; // forward declaration
|
||||
|
||||
|
||||
/*!
|
||||
* \brief 3D vector base (x, y, z)
|
||||
*/
|
||||
@@ -75,6 +79,13 @@ public:
|
||||
*/
|
||||
qreal getElement(size_t row) const;
|
||||
|
||||
/*!
|
||||
* \brief Set element
|
||||
* \param row
|
||||
* \param value
|
||||
*/
|
||||
void setElement(size_t row, qreal value);
|
||||
|
||||
/*!
|
||||
* \brief Operator []
|
||||
* \param row
|
||||
@@ -82,6 +93,14 @@ public:
|
||||
*/
|
||||
qreal operator[](size_t row) const { return this->getElement(row); }
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Get element by ()
|
||||
* \param column
|
||||
* \return
|
||||
*/
|
||||
qreal operator()(size_t row) const { return this->getElement(row); }
|
||||
|
||||
/*!
|
||||
* \brief Equal operator ==
|
||||
* \param otherVector
|
||||
@@ -106,7 +125,7 @@ public:
|
||||
|
||||
/*!
|
||||
* \brief Assigment operator =
|
||||
* \param multiply
|
||||
* \param otherVector
|
||||
* \return
|
||||
*/
|
||||
CVector3DBase &operator =(const CVector3DBase &otherVector)
|
||||
@@ -165,7 +184,7 @@ public:
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Operator *=, just x*x, y*y, z*z neither vector nor dot product
|
||||
* \brief Operator *=, just x*x, y*y, z*z neither vector nor dot product (like a matrix produc)
|
||||
* \param otherVector
|
||||
* \return
|
||||
*/
|
||||
@@ -176,7 +195,7 @@ public:
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Operator, just x*x, y*y, z*z neither vector nor dot product
|
||||
* \brief Operator, just x*x, y*y, z*z neither vector nor dot product, (like a matrix produc)
|
||||
* \param otherVector
|
||||
* \return
|
||||
*/
|
||||
@@ -223,7 +242,7 @@ public:
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Dot product
|
||||
* \brief Cross product
|
||||
* \param otherVector
|
||||
* \return
|
||||
*/
|
||||
@@ -235,7 +254,14 @@ public:
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Dot product
|
||||
* \brief Matrix * this vector
|
||||
* \param matrix
|
||||
* \return
|
||||
*/
|
||||
void matrixMultiplication(const CMatrix3x3 &matrix);
|
||||
|
||||
/*!
|
||||
* \brief Reciporcal value
|
||||
* \param otherVector
|
||||
* \return
|
||||
*/
|
||||
@@ -266,6 +292,12 @@ public:
|
||||
return this->m_vector.lengthSquared();
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Converted to matrix
|
||||
* \return
|
||||
*/
|
||||
CMatrix3x1 toMatrix3x1() const;
|
||||
|
||||
/*!
|
||||
* \brief Magnitude
|
||||
* \return
|
||||
|
||||
Reference in New Issue
Block a user