Changeset 158

Show
Ignore:
Timestamp:
01/27/09 03:22:33 (3 years ago)
Author:
baxissimo
Message:

Applied patch from Helmut Duregger to the matrix->quaterion conversion function.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Helix/helix/linalgebra.d

    r129 r158  
    11931193                *(&x + i) = 0.5 * root; 
    11941194                root = 0.5 / root; 
    1195                 w = (mat[j, k] - mat[k, j]) * root; 
    1196                 *(&x + j) = (mat[i, j] + mat[j, i]) * root; 
    1197                 *(&x + k) = (mat[i, k] + mat[k, i]) * root; 
     1195                /+ 
     1196                 // User "Helmut Duregger reports this sometimes  
     1197                 // causes mirroring of rotations, and that Ogre 
     1198                 // actually uses the uncommented version below. 
     1199 
     1200                 w = (mat[j, k] - mat[k, j]) * root; 
     1201                 *(&x + j) = (mat[i, j] + mat[j, i]) * root; 
     1202                 *(&x + k) = (mat[i, k] + mat[k, i]) * root; 
     1203                +/ 
     1204                w = (mat[k, j] - mat[j, k]) * root; 
     1205                *(&x + j) = (mat[j, i] + mat[i, j]) * root; 
     1206                *(&x + k) = (mat[k, i] + mat[i, k]) * root; 
     1207 
    11981208            } 
    11991209        }