Fix for building math nodes provided by DustyDingo
This commit is contained in:
parent
24d7606cb8
commit
65aac7c506
@ -101,7 +101,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
|
||||
float y_mod_1 = fmod(in2[0], 1);
|
||||
/* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */
|
||||
if (y_mod_1 > 0.999 || y_mod_1 < 0.001) {
|
||||
out[0]= pow(in[0], round(in2[0]));
|
||||
out[0]= pow(in[0], floor(in2[0] + 0.5));
|
||||
} else {
|
||||
out[0] = 0.0;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
|
||||
} else {
|
||||
float y_mod_1 = fmod(in1, 1);
|
||||
if (y_mod_1 > 0.999 || y_mod_1 < 0.001) {
|
||||
*out = pow(in0, round(in1));
|
||||
*out = pow(in0, floor(in1 + 0.5));
|
||||
} else {
|
||||
*out = 0.0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user