diff options
| author | Ray <[email protected]> | 2021-05-29 13:56:08 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-05-29 13:56:08 +0200 |
| commit | c828e481fbee9846721552cb37250a93332ee115 (patch) | |
| tree | bad290b257a60dcf02b2e54c024c5952edac60c5 /src/raymath.h | |
| parent | e3ba11bead355f23caf757410f237d9292a4e19e (diff) | |
| download | raylib-c828e481fbee9846721552cb37250a93332ee115.tar.gz raylib-c828e481fbee9846721552cb37250a93332ee115.zip | |
Review code format
Diffstat (limited to 'src/raymath.h')
| -rw-r--r-- | src/raymath.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/raymath.h b/src/raymath.h index 7ab79860..9d840443 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -1390,27 +1390,27 @@ RMDEF Matrix QuaternionToMatrix(Quaternion q) { Matrix result = MatrixIdentity(); - float a2 = q.x * q.x; - float b2 = q.y * q.y; - float c2 = q.z * q.z; - float ac = q.x * q.z; - float ab = q.x * q.y; - float bc = q.y * q.z; - float ad = q.w * q.x; - float bd = q.w * q.y; - float cd = q.w * q.z; - - result.m0 = 1 - 2 * (b2 + c2); - result.m1 = 2 * (ab + cd); - result.m2 = 2 * (ac - bd); - - result.m4 = 2 * (ab - cd); - result.m5 = 1 - 2 * (a2 + c2); - result.m6 = 2 * (bc + ad); - - result.m8 = 2 * (ac + bd); - result.m9 = 2 * (bc - ad); - result.m10 = 1 - 2 * (a2 + b2); + float a2 = q.x*q.x; + float b2 = q.y*q.y; + float c2 = q.z*q.z; + float ac = q.x*q.z; + float ab = q.x*q.y; + float bc = q.y*q.z; + float ad = q.w*q.x; + float bd = q.w*q.y; + float cd = q.w*q.z; + + result.m0 = 1 - 2*(b2 + c2); + result.m1 = 2*(ab + cd); + result.m2 = 2*(ac - bd); + + result.m4 = 2*(ab - cd); + result.m5 = 1 - 2*(a2 + c2); + result.m6 = 2*(bc + ad); + + result.m8 = 2*(ac + bd); + result.m9 = 2*(bc - ad); + result.m10 = 1 - 2*(a2 + b2); return result; } |
