Dear Emanuele,
this helps for my application, sorting only about 200 position values and probably for many others. I appreciate your help.
The performance is not satisfying for more complex applications. I have just benchmarked sorting 1000 position vectors and got the following results:
-----------------------------------------------------------------------
Function Count Time (msec) % Func+Child
-----------------------------------------------------------------------
_OUTPUTLN 2 98.69 44.3 98.69
_SCENEBEGIN 449 20.43 9.2 20.43
DRAWGRID 449 19.50 8.8 45.87
_GLVERTEX 19756 17.68 7.9 17.68
QSORT 1321 16.56 7.4 2.21
_CALLBACK 10372 14.64 6.6 22.74
COMPAREVECTOR3 10372 8.10 3.6 8.10
Doing a litte math, you find that you can sort an array of 1000 positions 60 times per second. That would eat up the whole simulation time for an interactive application. So my argument stands: We need this to be integrated as a native function (in C++) to be efficient enough for large arrays at high framerates.
Again many thanks for your help,
Torsten