Code Snippet II : Handy tridimensional vector class for C++
As you may have seen, I’ve changed the title of a previous post and I have started a series named “Code Snippets”. These are small pieces of code containing utility functions or classes.
So without further delays here is the code for a Vector3f class, implementing a tridimensional vector using low precision floating point numbers, for tridimensional graphics or audio. Released under BSD license.
Note : the class has no constructors so that object allocation does not have any significant performance impact. An handy static method called Make is provided to construct a Vector3f given its components on the fly.