mirror of
https://gitlab.com/skmp/dca3-game.git
synced 2025-04-28 13:07:59 +03:00
Fixed really stupid mistake.
- Whoops, accidentally took x to the 4th power in MATH_Fast_Invert().
This commit is contained in:
parent
f0052c79b9
commit
430ab335de
1 changed files with 2 additions and 2 deletions
4
vendor/librw/src/dc/rwdc.cpp
vendored
4
vendor/librw/src/dc/rwdc.cpp
vendored
|
@ -166,13 +166,13 @@ static_assert(alignof(pvr_vertex16_t) == 32, "pvr_vertex16_t alignof mismatch");
|
|||
|
||||
#define MATH_Very_Fast_Invert(x) ({ 1.0f / sqrtf((x) * (x)); })
|
||||
|
||||
static inline __attribute__((always_inline)) float MATH_Fast_Invert(float x) {
|
||||
__always_inline float MATH_Fast_Invert(float x) {
|
||||
bool neg = 0;
|
||||
|
||||
if(x < 0.0f)
|
||||
neg = true;
|
||||
|
||||
x = MATH_Very_Fast_Invert(x*x); // 1.0f / sqrt(x^2)
|
||||
x = MATH_Very_Fast_Invert(x); // 1.0f / sqrt(x^2)
|
||||
|
||||
return (neg)? -x : x;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue