summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/lib/ephysics_quaternion.cpp
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2012-12-11 21:11:07 +0000
committerLeandro Dorileo <dorileo@profusion.mobi>2012-12-11 21:11:07 +0000
commit2e8fcf0a2351784559d32c01ccbea484f4a0cf55 (patch)
tree46d35f6a2baaae48e3fb025183fe5260d0fab56d /legacy/ephysics/src/lib/ephysics_quaternion.cpp
parent44a9b9a350589b53682381f2a5b0dfceb3acd7fc (diff)
EPhysics: fix issues with rotation
We must convert degrees to radians wherever operating with angles. SVN revision: 80718
Diffstat (limited to '')
-rw-r--r--legacy/ephysics/src/lib/ephysics_quaternion.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/legacy/ephysics/src/lib/ephysics_quaternion.cpp b/legacy/ephysics/src/lib/ephysics_quaternion.cpp
index c5abcd0753..899204d563 100644
--- a/legacy/ephysics/src/lib/ephysics_quaternion.cpp
+++ b/legacy/ephysics/src/lib/ephysics_quaternion.cpp
@@ -80,7 +80,7 @@ ephysics_quaternion_axis_angle_get(const EPhysics_Quaternion *quat, double *nx,
80 if (nx) *nx = bt_quat.getAxis().getX(); 80 if (nx) *nx = bt_quat.getAxis().getX();
81 if (ny) *ny = bt_quat.getAxis().getY(); 81 if (ny) *ny = bt_quat.getAxis().getY();
82 if (nz) *nz = bt_quat.getAxis().getZ(); 82 if (nz) *nz = bt_quat.getAxis().getZ();
83 if (a) *a = bt_quat.getAngle(); 83 if (a) *a = bt_quat.getAngle() * RAD_TO_DEG;
84} 84}
85 85
86EAPI void 86EAPI void
@@ -111,7 +111,7 @@ ephysics_quaternion_axis_angle_set(EPhysics_Quaternion *quat, double nx, double
111 } 111 }
112 112
113 axis = btVector3(nx, ny, nz); 113 axis = btVector3(nx, ny, nz);
114 bt_quat = btQuaternion(axis, a); 114 bt_quat = btQuaternion(axis, a / RAD_TO_DEG);
115 _ephysics_quaternion_update(quat, &bt_quat); 115 _ephysics_quaternion_update(quat, &bt_quat);
116} 116}
117 117
@@ -127,7 +127,7 @@ ephysics_quaternion_euler_set(EPhysics_Quaternion *quat, double yaw, double pitc
127 } 127 }
128 128
129 bt_quat = btQuaternion(); 129 bt_quat = btQuaternion();
130 bt_quat.setEuler(yaw, pitch, roll); 130 bt_quat.setEuler(yaw / RAD_TO_DEG, pitch / RAD_TO_DEG, roll / RAD_TO_DEG);
131 _ephysics_quaternion_update(quat, &bt_quat); 131 _ephysics_quaternion_update(quat, &bt_quat);
132} 132}
133 133
@@ -294,7 +294,7 @@ ephysics_quaternion_angle_get(const EPhysics_Quaternion *quat1, const EPhysics_Q
294 bt_quat1 = btQuaternion(quat1->x, quat1->y, quat1->z, quat1->w); 294 bt_quat1 = btQuaternion(quat1->x, quat1->y, quat1->z, quat1->w);
295 bt_quat2 = btQuaternion(quat2->x, quat2->y, quat2->z, quat2->w); 295 bt_quat2 = btQuaternion(quat2->x, quat2->y, quat2->z, quat2->w);
296 296
297 return bt_quat1.angle(bt_quat2); 297 return bt_quat1.angle(bt_quat2) * RAD_TO_DEG;
298} 298}
299 299
300EAPI double 300EAPI double