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

Method get

source/game/terrain/StarMixSelector.cpp:20–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20float MixSelector::get(int x, int y) const {
21 auto f = clamp(m_mixSource->get(x, y), -1.0f, 1.0f);
22 if (f == -1)
23 return m_aSource->get(x, y);
24 if (f == 1)
25 return m_bSource->get(x, y);
26 return lerp(f * 0.5f + 0.5f, m_aSource->get(x, y), m_bSource->get(x, y));
27}
28
29}

Callers 1

MixSelectorMethod · 0.45

Calls 2

clampFunction · 0.85
lerpFunction · 0.85

Tested by

no test coverage detected