Skip to main content
4 votes
Accepted

How do fixed-point physics (engines) work?

TL;DR they work exactly the same; the difference comes from trade-offs like performance, value range and (sometimes) syntax. It's is possible to simulate floating- or fixed-point math, you just have ...
Shadows In Rain's user avatar
4 votes

How can I rotate a 16-bit signed integer vector?

Use 32-bit integers for the intermediate calculations. They'll usually be divided down into the 16-bit range at the end. If they're not - for example, rotating \$(30000,30000)\$ by an eighth-turn ...
Toph's user avatar
  • 588
4 votes

How can I rotate a 16-bit signed integer vector?

There are two issues to address here, each of which has a couple of solutions. Size of vectors Your first problem is how you do any processing at all without overflows. A vector (32767, 0) is clearly ...
Graham's user avatar
  • 262
2 votes

How can I rotate a 16-bit signed integer vector?

If you don't have a way to get the high half of a 16bit multiplication then you can instead scale the vector back before multiplying. (s and ...
ratchet freak's user avatar
1 vote

How can I rotate a 16-bit signed integer vector?

So... you do not want to use 32 bits per integer; you do not want to use float (or double); you do not want to lose precision. That cannot be done for the full range of numbers, but the precision ...
virolino's user avatar
  • 111
1 vote

How can I rotate a 16-bit signed integer vector?

I think the trick here is to use the fact that the hardware is usually more capable than the compiler exposes. In particular, when you multiply a 16 bit value by a 16 bit value, you will get a 32 bit ...
David G.'s user avatar
  • 111
1 vote

How do fixed-point physics (engines) work?

I've been using FixedPoint (FxP) for last several years across multiple 8/16/32/64 bit platforms (mostly in Assembler). The single most problematic issue with FxP is occasional overflow during ...
3D Coder's user avatar
  • 244

Only top scored, non community-wiki answers of a minimum length are eligible