QVector3D MathUtil::Slerp(QVector3D p1, QVector3D p2, float i) { p1.normalize(); p2.normalize(); QVector3D c = QVector3D::crossProduct(p1, p2); if (c.length() < 0.001f) c = QVector3D(0, 1, 0); c.normalize(); float angle = acosf(QVector3D::dotProduct(p1, p2)); return GetRotatedAxis(i * angle, p1, c); }
void cVec4::RotateAxis(double angle, const cVec3 & axis) { (*this)=GetRotatedAxis(angle, axis); }
void PxVector::RotateAxis(double angle, const PxVector & axis) { (*this)=GetRotatedAxis(angle, axis); }
void VECTOR4D::RotateAxis(double angle, const VECTOR3D & axis) { (*this)=GetRotatedAxis(angle, axis); }
void Vector3::RotateAxis(double angle, const Vector3 & axis) { (*this)=GetRotatedAxis(angle, axis); }
cVec3 cVec3::GetRotatedByQuaternion(const cQuaternion& rhs) const { return cVec3(GetRotatedAxis(rhs.GetAngleRadians(), rhs.GetAxis())); }