Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

Checking maths classes

Started by wasd Jul 11, 2006 at 4:12 PM 2 replies 700+ views
Original Post
wasd
wasd
I'm most of the way through implementing some basic maths classes (vectors, matrices, quaternions) and want to make sure they're working OK. Is there anywhere I can get example outputs to check them against? Like: If you construct a quaternion from this certain axis and angle, the values should be...
Daniel Protopopov
Daniel Protopopov
If you are talking about Unit Testing, then you can find them on Google.
If you are talking about getting the values of matrices and vectors to the output (e.g string), you can create a few helper functions that return a string containing those values per each class. An example would be:
std::string& VectorOutput(CVector3& Vector){ std::stringstream strStream; strStream << "X: " << Vector.x << ", Y: " << Vector.y << ", Z: " << Vector.z;  return std::string(strStream);}

"Don't try. Do it now."
wasd
wasd
Yeah, unit testing. I need to know that my maths is correct in the implementation before I start using them and find out they don't work, then have a nightmare trying to figure out what's going wrong.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.