And actually, core::vector2d has a method for this: getDistanceFromSq

http://irrlicht.sourceforge.net/docu/classirr_1_1core_1_1vector2d.html#a77262661ca3dcd6befea9bbc20bae4aa