It turns out that calling abs instead of std::abs refers to the abs in stdlib.h, which is a integer version.
So that the if clause will never pass through resulting in no rotation.
Also, I found that in calculating the rotation matrix, the if clause might be short-circuited.
It turns out that calling
abs
instead ofstd::abs
refers to theabs
instdlib.h
, which is a integer version. So that the if clause will never pass through resulting in no rotation.Also, I found that in calculating the rotation matrix, the if clause might be short-circuited.