pimathvector.h div and std::initializer_list

This commit is contained in:
2020-10-21 18:54:41 +03:00
parent 6f3fdf4d49
commit 47be2d3d62
4 changed files with 48 additions and 22 deletions

View File

@@ -40,7 +40,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 createVectorT3d(angle_x,angle_y,angle_z);
return PIMathVectorT3d({angle_x,angle_y,angle_z});
}
@@ -153,7 +153,7 @@ 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();
double om = PIMathVectorT3d({ax,ay,az}).length();
if (om == 0.) return PIQuaternion(PIMathVectorT3d(), 1.);
PIQuaternion res;
res.q[0] = cos(om/2);