Jan, Robert, I get the impression that both of you are not really that interested in changing the Vec code at all.
First, Robert's answer seems to me somewhat generic, and does not apply, IMO. (I wonder if he looked at the code I posted?). There are no reasons why my posted code should bloat more than the existing one, as all functions are short inlined ones anyway. The compiled code may even be both smaller and faster because it avoids creation of temporaries and at the same time is more consistent, correct, and complete across the supported number types. In addition, the source code (and thus chances of bugs) is cut to 1/8, so I don't quite undestand why this would not be a good intermediate step in the development, at least. Jan, your suggestion to rather switch to the Eigen library, seems to me a non-agile and drastic way to develop code. In fact, I am not sure what you are suggesting here. Do you want to throw out the current Vec API and use the Eigen instead? That would break existing code all over the place, and seems unrealistic to me (up to the point that it won't happen in any forseeable future). Or do you mean to make an adapter layer for the current API, which utilizes the Eigen classes? I don't see a good reason for that either, because OSG only uses a very limited part of the functionalty of Eigen, mainly a few static length vector and matrices classes. In addition, you would need another set of wrapper classes to avoid clashes with e.g. Eigen's * operators and OSG's Vec * operators, etc. Copying back and forth between OSG Vec and Eigen vec would kill the speed gain you were aiming for. The optimization in Eigen is mainly in the dynamic large vectors and matrices, and in vectorization utilizing SSE instructions. However, as the FAQ states, it does not work well with 3D vectors, only with 4D because of 16-byte alignment requirements. My take on this is that if you need the Eigen library, use it, and develop your own adapter functions or classes you need to make it work with OSG Vec/Matrix API. Cheers, Tyge ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63684#63684 _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
