git-svn-id: svn://db.shs.com.ru/pip@656 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2018-11-12 15:26:34 +00:00
parent 1f0810ab1e
commit e35313dc1a
5 changed files with 166 additions and 99 deletions

View File

@@ -21,7 +21,7 @@ PIMathVectorT3d PIQuaternion::eyler() const {
angle_z = atan2(-rmat[0][1] / c, rmat[0][0] / c);
}
if (angle_z < 0) angle_z = 2*M_PI + angle_z;
return PIMathVectorT3d(angle_x,angle_y,angle_z);
return createVectorT3d(angle_x,angle_y,angle_z);
}
@@ -136,11 +136,10 @@ PIQuaternion PIQuaternion::fromAngles(double ax, double ay, double az) {
res.q[2] = y;
res.q[3] = z;
return res;
return PIQuaternion(PIMathVectorT3d(x,y,z),a);
}
PIQuaternion PIQuaternion::fromAngles2(double ax, double ay, double az) {
double om = PIMathVectorT3d(ax,ay,az).length();
double om = createVectorT3d(ax,ay,az).length();
// az = M_PI - az;
if (om == 0.) return PIQuaternion(PIMathVectorT3d(), 1.);
PIQuaternion res;