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.

Sources here.

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.

Timing in Windows

Raymond Chen has posted yesterday about timing precision and accuracy under Win32. There is a good article about timing at nVIDIA developers’ web site which helps taking the decision about which timing method can be used for fast and accurate timing under Win32. Suggested reads ;)

← Previous Page