A minor thing, it is usually better to multiply by 0.5f than to divide by 2.0f. It is faster (though most compilers probably optimize the division into the multiplication), but more importantly multiplication is commutative. I have had bugs originating from that division isn’t.