On Tue, 28 Sept 2021 at 18:50, Eric Pouech eric.pouech@gmail.com wrote:
static inline D3DXVECTOR2 *unit_vec2(D3DXVECTOR2 *dir, const D3DXVECTOR2 *pt1, const D3DXVECTOR2 *pt2) {
- return D3DXVec2Normalize(D3DXVec2Subtract(dir, pt2, pt1), dir);
- return D3DXVec2Normalize(dir, D3DXVec2Subtract(dir, pt2, pt1));
}
That's arguably more readable, but note that this doesn't otherwise make much of a difference; D3DXVec2Subtract() returns the output vector, so this effectively does "D3DXVec2Normalize(dir, dir);" either way.