El Martes 06 Mayo 2008ES 11:11:25 Daniel Moos escribió:
> Now my question. Why use the osg::Array a std::vector and not a  
> std::list?
> I'm shure there is a good reason... But I haven't got a clue.

I think it depends on the way one is using the data. If you weren't removing 
faces but just altering vertices' positions (i.e. morphing) I'm sure the 
vector path would be faster than the list path. Another reasons that could be 
applied is that the GL functions passing mesh data expect contiguous arrays, 
so there would be an overhead when copying the list into a temporary vector 
in order to send it to OpenGL (DrawArrays, VBOs...), the inherent memory 
overhead of the list, the computational overhead when iterating through the 
meshes when doing intersection tests, etc.

I think that your current approach (copy the vector to a list and then operate 
on it) is a smart one, but it can't be simply used everywhere. Use the right 
tool for the right job, they say :) .
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to