MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / readFloat

Method readFloat

Engine/source/core/stream/bitStream.cpp:372–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372F32 BitStream::readFloat(S32 bitCount)
373{
374 auto maxInt = (1U << bitCount) - 1;
375 auto i = static_cast<U32>(readInt(bitCount));
376 if (i == 0)
377 return 0;
378 if (i == maxInt / 2 + 1)
379 return 0.5;
380 if (i == maxInt)
381 return 1;
382 return i / static_cast<F32>(maxInt);
383}
384
385void BitStream::writeSignedFloat(F32 f, S32 bitCount)
386{

Callers 13

unpackUpdateMethod · 0.80
unpackDataMethod · 0.80
unpackDataMethod · 0.80
unpackUpdateMethod · 0.80
unpackUpdateMethod · 0.80
unpackDataMethod · 0.80
unpackDataMethod · 0.80
unpackUpdateMethod · 0.80
readPacketMethod · 0.80
unpackDataMethod · 0.80
unpackDataMethod · 0.80
unpackMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected