Bringing minor improvements from Cubiquity's PolyVox into the main branch.
This commit is contained in:
parent
ed614802fe
commit
50c9934376
@ -40,12 +40,12 @@ namespace PolyVox
|
|||||||
|
|
||||||
inline int32_t roundTowardsNegInf(float r)
|
inline int32_t roundTowardsNegInf(float r)
|
||||||
{
|
{
|
||||||
return (r > 0.0) ? static_cast<int32_t>(r) : static_cast<int32_t>(r - 1.0f);
|
return (r >= 0.0) ? static_cast<int32_t>(r) : static_cast<int32_t>(r - 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int32_t roundToNearestInteger(float r)
|
inline int32_t roundToNearestInteger(float r)
|
||||||
{
|
{
|
||||||
return (r > 0.0) ? static_cast<int32_t>(r + 0.5f) : static_cast<int32_t>(r - 0.5f);
|
return (r >= 0.0) ? static_cast<int32_t>(r + 0.5f) : static_cast<int32_t>(r - 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
|
@ -36,7 +36,7 @@ namespace PolyVox
|
|||||||
assert((x >= 0.0f) && (x <= 1.0f));
|
assert((x >= 0.0f) && (x <= 1.0f));
|
||||||
|
|
||||||
//Interpolate along X
|
//Interpolate along X
|
||||||
Type v0_1 = v0 + x * (v1 - v0);
|
Type v0_1 = (v1 - v0) * x + v0;
|
||||||
|
|
||||||
return v0_1;
|
return v0_1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user