Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
Z2Calc.h
Go to the documentation of this file.
1#ifndef Z2CALC_H
2#define Z2CALC_H
3
4#include "dolphin/types.h"
5#include "m_Do/m_Do_lib.h"
6
7namespace Z2Calc {
8#ifdef DECOMPCTX
9// Hack to mitigate fake mismatches when building from decompctx output -
10// see comment in sqrtf in math.h
11static Vec cNullVec = {0.0f, 0.0f, 0.0f};
12#else
13static const Vec cNullVec = {0.0f, 0.0f, 0.0f};
14#endif
15
21
22struct FNoise1f {
23 FNoise1f(f32 value = 0.1f, f32 threshold = 0.0f, f32 step = 0.01f) {
24 value_ = value;
25 targetValue_ = value;
26 step_ = step;
27 threshold_ = threshold;
28 }
29
30 void setParam(f32 value, f32 threshold, f32 step);
31 f32 tau(f32 input);
33
38};
39
40f32 linearTransform(f32 inValue, f32 inMin, f32 inMax, f32 outMin, f32 outMax, bool noClamp);
41f32 getParamByExp(f32 value, f32 inMin, f32 inMax, f32 exponent, f32 outMin, f32 outMax, CurveSign curveSign);
42f32 getRandom(f32 magnitude, f32 exponent, f32 bias);
44
45extern const f32 cEqualCSlope;
46extern const f32 cEqualPSlope;
47} // namespace Z2Calc
48
49#endif /* Z2CALC_H */
u32 bias
Definition GXTev.c:12
float f32
Definition types.h:25
Definition Z2Calc.h:7
f32 getRandom(f32 magnitude, f32 exponent, f32 bias)
Definition Z2Calc.cpp:44
f32 linearTransform(f32 inValue, f32 inMin, f32 inMax, f32 outMin, f32 outMax, bool noClamp)
Definition Z2Calc.cpp:5
static Vec cNullVec
Definition Z2Calc.h:11
CurveSign
Definition Z2Calc.h:16
@ CURVE_NEGATIVE
Definition Z2Calc.h:17
@ CURVE_POSITIVE
Definition Z2Calc.h:18
@ CURVE_LINEAR
Definition Z2Calc.h:19
f32 getParamByExp(f32 value, f32 inMin, f32 inMax, f32 exponent, f32 outMin, f32 outMax, CurveSign curveSign)
Definition Z2Calc.cpp:26
const f32 cEqualPSlope
Definition Z2Calc.cpp:24
const f32 cEqualCSlope
Definition Z2Calc.cpp:22
f32 getRandom_0_1()
Definition Z2Calc.cpp:53
Definition mtx.h:13
Definition Z2Calc.h:22
FNoise1f(f32 value=0.1f, f32 threshold=0.0f, f32 step=0.01f)
Definition Z2Calc.h:23
f32 tau(f32 input)
Definition Z2Calc.cpp:65
f32 step_
Definition Z2Calc.h:36
f32 value_
Definition Z2Calc.h:34
f32 calcNoise1f()
Definition Z2Calc.cpp:84
f32 threshold_
Definition Z2Calc.h:37
f32 targetValue_
Definition Z2Calc.h:35
void setParam(f32 value, f32 threshold, f32 step)
Definition Z2Calc.cpp:58