diff options
| author | 2017-06-09 17:33:25 -0500 | |
|---|---|---|
| committer | 2017-07-11 19:39:15 +0300 | |
| commit | f2d4d5c2191275bd91f2f42b880f3edf3bccfd63 (patch) | |
| tree | 50e8bfcd9f9873ee6d8ba5174e9f45e942c30173 /src/common | |
| parent | SwRasterizer: Fixed the lighting lut lookup function. (diff) | |
| download | yuzu-f2d4d5c2191275bd91f2f42b880f3edf3bccfd63.tar.gz yuzu-f2d4d5c2191275bd91f2f42b880f3edf3bccfd63.tar.xz yuzu-f2d4d5c2191275bd91f2f42b880f3edf3bccfd63.zip | |
SwRasterizer: Corrected the light LUT lookups.
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/quaternion.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/quaternion.h b/src/common/quaternion.h index 84ac82ed3..77f626bcb 100644 --- a/src/common/quaternion.h +++ b/src/common/quaternion.h | |||
| @@ -30,6 +30,11 @@ public: | |||
| 30 | return {xyz * other.w + other.xyz * w + Cross(xyz, other.xyz), | 30 | return {xyz * other.w + other.xyz * w + Cross(xyz, other.xyz), |
| 31 | w * other.w - Dot(xyz, other.xyz)}; | 31 | w * other.w - Dot(xyz, other.xyz)}; |
| 32 | } | 32 | } |
| 33 | |||
| 34 | Quaternion<T> Normalized() const { | ||
| 35 | T length = std::sqrt(xyz.Length2() + w * w); | ||
| 36 | return {xyz / length, w / length}; | ||
| 37 | } | ||
| 33 | }; | 38 | }; |
| 34 | 39 | ||
| 35 | template <typename T> | 40 | template <typename T> |