mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-03 07:00:39 +08:00
all is double now, and clarifying comment
This commit is contained in:
parent
ea8a8eef2b
commit
e82c6ec912
@ -277,8 +277,6 @@ TransformationMatrix TransformationMatrix::mat_rotation(double angle_rad, const
|
|||||||
|
|
||||||
TransformationMatrix TransformationMatrix::mat_rotation(Vectorf3 origin, Vectorf3 target)
|
TransformationMatrix TransformationMatrix::mat_rotation(Vectorf3 origin, Vectorf3 target)
|
||||||
{
|
{
|
||||||
// TODO: there is a lot of float <-> double conversion going on here
|
|
||||||
|
|
||||||
TransformationMatrix mat;
|
TransformationMatrix mat;
|
||||||
double length_sq = origin.x*origin.x + origin.y*origin.y + origin.z*origin.z;
|
double length_sq = origin.x*origin.x + origin.y*origin.y + origin.z*origin.z;
|
||||||
double rec_length;
|
double rec_length;
|
||||||
@ -333,7 +331,7 @@ TransformationMatrix TransformationMatrix::mat_rotation(Vectorf3 origin, Vectorf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{// not colinear, cross represents rotation axis so that angle is positive
|
{// not colinear, cross represents rotation axis so that angle is (0, 180)
|
||||||
// dot's vectors have previously been normalized, so nothing to do except arccos
|
// dot's vectors have previously been normalized, so nothing to do except arccos
|
||||||
double angle = acos(dot);
|
double angle = acos(dot);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user