Fix regression introduced in svn rev49122

Would rather have mathematical functions consistent from using
the same vector for input and output values point of view then
introducing questionable optimizations.
This commit is contained in:
Sergey Sharybin
2012-07-25 16:37:24 +00:00
parent 7fba5779ed
commit 8197ae0054

View File

@@ -662,15 +662,16 @@ void print_qt(const char *str, const float q[4])
/* Axis angle to Quaternions */
void axis_angle_to_quat(float q[4], const float axis[3], const float angle)
{
float nor[3];
if (LIKELY(normalize_v3_v3(q + 1, axis) != 0.0f)) {
if (LIKELY(normalize_v3_v3(nor, axis) != 0.0f)) {
const float phi = angle / 2.0f;
float si;
si = sinf(phi);
q[0] = cosf(phi);
q[1] *= si;
q[2] *= si;
q[3] *= si;
q[1] = nor[0] * si;
q[2] = nor[1] * si;
q[3] = nor[2] * si;
}
else {
unit_qt(q);