I'm current working on a project that in one place requires working out whether the mouse is within circular regions of different sizes. Because I am working with the gui I have to use position2d or perform redundant copying and using vector2di's built in trig functions.
Code: Select all
bool isPointInside(const position2di & mouse, const position2di & center, s32 radius)
{
position2di dist = mouse - center;
return hypot(dist.X, dist.Y) < radius;
}
// instead of
bool isPointInside(const vector2di & mouse, const vector2di & center, s32 radius)
{
return (mouse - center).getLength() < radius;
}
I realize this isn't much, but it means (as far as I can see) that the methods within vector2di are useless because they're in *the wrong class*.
In another part of the same project I am converting between an isometric display on the screen to a grid coordinate. This uses (2 or 3) dot products, but once again because the gui elements all use position2di instead of vector2di, these products have to be done *by hand* rather than using vector2d's built in dotProduct method.
I guess this could seem like a lot of whining, but I think its frustrating that this functionality is here (in the vector2d template) but is *in the wrong place*, because the whole gui system and drawing methods all use position2d.
Anyways, in almost every other respect, I love Irrlicht.
I also notice that this thread generated a lot of positive responses to the idea earlier. I thought I'd give at one last shot at getting the idea noticed. If people hate it then it will be forgotten.
Thanks guys,