MCPcopy Create free account
hub / github.com/chrxh/alien / writeDensity

Function writeDensity

source/EngineInterface/GenomeDescriptionService.cpp:43–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 data.emplace_back(static_cast<uint8_t>(static_cast<int8_t>(value / 180 * 120)));
42 }
43 void writeDensity(std::vector<uint8_t>& data, float value)
44 {
45 data.emplace_back(static_cast<uint8_t>(static_cast<int8_t>((value * 2 - 1) * 128)));
46 }
47 void writeEnergy(std::vector<uint8_t>& data, float value)
48 {
49 writeFloat(data, (value - 150.0f) / 100);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected