mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Testing using the regenerating turret https://github.com/Azaezel/Torque3D/tree/outpost_testbed_clean shows that tracking is precisely inverted using 8b1ff267f0 (diff-983ceaf4b3cbddd4701734aaa048a79e) . reversion PR till someone has time to properly review whether that's fouled conversion on my part, or if turrets were accounting for bad math to start with.
This commit is contained in:
parent
d08e594316
commit
f678a19be8
1 changed files with 11 additions and 11 deletions
|
|
@ -35,27 +35,27 @@ QuatF& QuatF::set( const EulerF & e )
|
|||
F32 cx, sx;
|
||||
F32 cy, sy;
|
||||
F32 cz, sz;
|
||||
mSinCos( e.x * 0.5f, sx, cx );
|
||||
mSinCos( e.y * 0.5f, sy, cy );
|
||||
mSinCos( e.z * 0.5f, sz, cz );
|
||||
mSinCos( -e.x * 0.5f, sx, cx );
|
||||
mSinCos( -e.y * 0.5f, sy, cy );
|
||||
mSinCos( -e.z * 0.5f, sz, cz );
|
||||
|
||||
// Qyaw(z) = [ (0, 0, sin z/2), cos z/2 ]
|
||||
// Qyaw(z) = [ (0, 0, sin z/2), cos z/2 ]
|
||||
// Qpitch(x) = [ (sin x/2, 0, 0), cos x/2 ]
|
||||
// Qroll(y) = [ (0, sin y/2, 0), cos y/2 ]
|
||||
// this = Qresult = Qyaw*Qpitch*Qroll ZXY
|
||||
// Qroll(y) = [ (0, sin y/2, 0), cos y/2 ]
|
||||
// this = Qresult = Qyaw*Qpitch*Qroll ZXY
|
||||
//
|
||||
// The code that folows is a simplification of:
|
||||
// roll*=pitch;
|
||||
// roll*=yaw;
|
||||
// *this = roll;
|
||||
// roll*=pitch;
|
||||
// roll*=yaw;
|
||||
// *this = roll;
|
||||
F32 cycz, sysz, sycz, cysz;
|
||||
cycz = cy*cz;
|
||||
sysz = sy*sz;
|
||||
sycz = sy*cz;
|
||||
cysz = cy*sz;
|
||||
w = cycz*cx - sysz*sx;
|
||||
w = cycz*cx + sysz*sx;
|
||||
x = cycz*sx + sysz*cx;
|
||||
y = sycz*cx + cysz*sx;
|
||||
y = sycz*cx - cysz*sx;
|
||||
z = cysz*cx - sycz*sx;
|
||||
|
||||
return *this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue