| 567 | } |
| 568 | |
| 569 | int 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 | |
| 575 | float decodeyaw(int r) |
| 576 | { |