Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-08-05 21:27:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-05 21:27:52 +0400
commit887d517e3b745945d3c8f7e2dc6e1d791067d1e8 (patch)
treed4c962031f7efb788d7b63705f155f92f4867219 /source/blender/blenlib/intern/math_rotation.c
parentdfdfa06c27c6dc44cb3f05e0355279d9e16eab93 (diff)
use define for 0.375 = GLA_PIXEL_OFS, used all over the interface.
also use M_SQRT1_2 in math_rotation.c
Diffstat (limited to 'source/blender/blenlib/intern/math_rotation.c')
-rw-r--r--source/blender/blenlib/intern/math_rotation.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index a2da9f5f791..69f837c7652 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -1660,12 +1660,12 @@ void quat_apply_track(float quat[4], short axis, short upflag)
{
/* rotations are hard coded to match vec_to_quat */
const float quat_track[][4] = {
- {0.70710676908493, 0.0, -0.70710676908493, 0.0}, /* pos-y90 */
+ {M_SQRT1_2, 0.0, -M_SQRT1_2, 0.0}, /* pos-y90 */
{0.5, 0.5, 0.5, 0.5}, /* Quaternion((1,0,0), radians(90)) * Quaternion((0,1,0), radians(90)) */
- {0.70710676908493, 0.0, 0.0, 0.70710676908493}, /* pos-z90 */
- {0.70710676908493, 0.0, 0.70710676908493, 0.0}, /* neg-y90 */
+ {M_SQRT1_2, 0.0, 0.0, M_SQRT1_2}, /* pos-z90 */
+ {M_SQRT1_2, 0.0, M_SQRT1_2, 0.0}, /* neg-y90 */
{0.5, -0.5, -0.5, 0.5}, /* Quaternion((1,0,0), radians(-90)) * Quaternion((0,1,0), radians(-90)) */
- {-3.0908619663705394e-08, 0.70710676908493, 0.70710676908493, 3.0908619663705394e-08} /* no rotation */
+ {-3.0908619663705394e-08, M_SQRT1_2, M_SQRT1_2, 3.0908619663705394e-08} /* no rotation */
};
assert(axis >= 0 && axis <= 5);
@@ -1680,8 +1680,8 @@ void quat_apply_track(float quat[4], short axis, short upflag)
* up axis is used X->Y, Y->X, Z->X, if this first up axis isn used then rotate 90d
* the strange bit shift below just find the low axis {X:Y, Y:X, Z:X} */
if (upflag != (2 - axis) >> 1) {
- float q[4] = {0.70710676908493, 0.0, 0.0, 0.0}; /* assign 90d rotation axis */
- q[axis + 1] = ((axis == 1)) ? 0.70710676908493 : -0.70710676908493; /* flip non Y axis */
+ float q[4] = {M_SQRT1_2, 0.0, 0.0, 0.0}; /* assign 90d rotation axis */
+ q[axis + 1] = ((axis == 1)) ? M_SQRT1_2 : -M_SQRT1_2; /* flip non Y axis */
mul_qt_qtqt(quat, quat, q);
}
}