Hi all,
I'm a bit surprised osg overloads operators that return a class, as in
Vec3d::operator-(<another Vec3d>) :
inline const Vec3d operator - (const Vec3d& rhs) const
{
return Vec3d(_v[0]-rhs._v[0], _v[1]-rhs._v[1], _v[2]-rhs._v[2]);
}
I see a call to a Vec3d constructor in this piece of code, on the return
line, which also means a memory allocation. I thought memory allocation at
run-time was evil. Is that some kind of trade off between efficiency and
ease of use (to be able to call the operator- instead of a
Vec3d:difference(Vec3d, Vec3d) which would not be as smart)?
Regards,
Antoine.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/