MCPcopy Create free account
hub / github.com/assaultcube/AC / encodeyaw

Function encodeyaw

source/src/protocol.cpp:569–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

567}
568
569int encodeyaw(float y) // yaw value quantisation: simple rounded integer
570{
571 int r = (int)floorf(y * (1 << YAWBITS) / 360.0f + 0.5f);
572 return r & ((1 << YAWBITS) - 1); // modulo 360 degrees
573}
574
575float decodeyaw(int r)
576{

Callers 1

c2sinfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected