Tip #1: Compare squared distances, not lengths August 10, 2025
A vector magnitude is a few adds and multiplies, but crucially a square root; and that last bit is expensive, particularly when you’re doing it inside a loop over thousands of entities, possibly multiple times per frame. In reality, we use a vector’s…