BIG deep clean

This commit is contained in:
2020-06-10 13:14:16 +03:00
parent f579718e0b
commit c59579d5d5
222 changed files with 2392 additions and 11600 deletions

View File

@@ -1,3 +1,22 @@
/*
PIP - Platform Independent Primitives
Class for quaternions
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "piquaternion.h"
@@ -65,11 +84,6 @@ PIQuaternion PIQuaternion::rotated(const PIMathVectorT3d & u, double a) const {
void PIQuaternion::rotate(const PIMathVectorT3d & u, double a) {
PIQuaternion v(u * sin(a / 2.), cos(a / 2.));
/*PIMathMatrixT44d r = v.makeMatrix() * makeMatrix() * v.inverted().makeMatrix();
q[0] = r[0][0];
q[1] = r[1][0];
q[2] = r[2][0];
q[3] = r[3][0];*/
*this = (v * (*this) * v.conjugate());
}
@@ -140,7 +154,6 @@ PIQuaternion PIQuaternion::fromAngles(double ax, double ay, double az) {
PIQuaternion PIQuaternion::fromAngles2(double ax, double ay, double az) {
double om = createVectorT3d(ax,ay,az).length();
// az = M_PI - az;
if (om == 0.) return PIQuaternion(PIMathVectorT3d(), 1.);
PIQuaternion res;
res.q[0] = cos(om/2);