I plan on making a D3DXVECTOR3 wrapper for my project and I was wondering if it was optimal to make math functions be static? Or wrap up the functionality in a class.
I would invoke the function by :
static float DotProduct(const D3DXVECTOR3 a, const D3DXVECTOR3 b)
CVector3 vecA, vecB;
float fDotResult = Math::DotProduct(vecA, vecB)
I can call this by ...
float DotProduct(const D3DXVECTOR3 vec2);
From what I hear, static variables/functions are as slow as global variables/functions so I am curious as to which of the two cases above is better in terms of speed.
CVector3 cVectorA, cVectorB;
float fDotResult = cVectorA.DotProduct(cVectorB);