MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / xLerpFunction

Method xLerpFunction

source/base/StarWorldGeometry.cpp:25–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25function<float(float, float, float)> WorldGeometry::xLerpFunction(Maybe<float> discontinuityThreshold) const {
26 if (m_size[0] == 0) {
27 return [](float, float min, float) -> float { return min; };
28 } else {
29 unsigned xsize = m_size[0];
30 return [discontinuityThreshold, xsize](float offset, float min, float max) -> float {
31 float distance = wrapDiffF<float>(max, min, xsize);
32 if (discontinuityThreshold && abs(distance) > *discontinuityThreshold)
33 return min + distance;
34 return min + offset * distance;
35 };
36 }
37}
38
39function<Vec2F(float, Vec2F, Vec2F)> WorldGeometry::lerpFunction(Maybe<float> discontinuityThreshold) const {
40 if (m_size[0] == 0) {

Callers 2

initMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected