MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Blast / bondHealthColor

Function bondHealthColor

samples/SampleBase/blast/BlastFamily.cpp:388–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388inline DirectX::XMFLOAT4 bondHealthColor(float healthFraction)
389{
390 const DirectX::XMFLOAT4 BOND_HEALTHY_COLOR(0.0f, 1.0f, 0.0f, 1.0f);
391 const DirectX::XMFLOAT4 BOND_MID_COLOR(1.0f, 1.0f, 0.0f, 1.0f);
392 const DirectX::XMFLOAT4 BOND_BROKEN_COLOR(1.0f, 0.0f, 0.0f, 1.0f);
393
394 return healthFraction < 0.5 ? XMFLOAT4Lerp(BOND_BROKEN_COLOR, BOND_MID_COLOR, 2.0f * healthFraction) : XMFLOAT4Lerp(BOND_MID_COLOR, BOND_HEALTHY_COLOR, 2.0f * healthFraction - 1.0f);
395}
396
397void BlastFamily::fillDebugRender(DebugRenderBuffer& debugRenderBuffer, DebugRenderMode mode, float renderScale)
398{

Callers 1

fillDebugRenderMethod · 0.70

Calls 1

XMFLOAT4LerpFunction · 0.85

Tested by

no test coverage detected