In pure physics texbooks, I'm seeing this formula to calculate fluid drag force:
It is clearly stated that it should be opposite to the velocity. Now to me that means, in pseudocode:
fd = get_drag(v) // using the above formula
if v < 0: fd = -fd
That is, if the velocity is negative the drag should be positive, so we invert the returned value.
However, in game code, game physics books and tutorials, I see people doing:
drag = -v
drag.normalise()
fd = get_drag(v)
fd *= drag
That is, we multiply the drag force by the (inverted) velocity unit vector.
This to me is logic in regard to the sign, but also it scales down the drag force by a factor between 0 and 1.
Which one is correct, and why?
PS: to be noted, normalisation involves square root, multiplications and divisions, so it's more expensive than a conditional check and subtraction.