@Ohforf sake: thanks, I made a 2nd CoordToCoord distance function, now for quared distance:
float CoordToCoordDistSqr(const D3DXVECTOR3 &pv1, const D3DXVECTOR3 &pv2)
{
return D3DXVec3LengthSq(&D3DXVECTOR3(pv1-pv2));
}
To be sure I use any possible optimizations, I also changed the non-squared version:
float CoordToCoordDist(const D3DXVECTOR3 &pv1, const D3DXVECTOR3 &pv2)
{
return D3DXVec3Length(&D3DXVECTOR3(pv1 - pv2));
}
Now that's done, I'll go through my code where I call the CoordToCoord distance function and see what I compare the result too. For example radius of a sphere I can do "radius*radius" like you said. The same probably goes for checking distance between mesh/ renderable center's and point lights, versus point light radius (radius would be radius*radius then).
Thanks for the help.