Advertisement

Faster Matrix M.Pos.x or M[4]?

Started by February 23, 2001 07:23 AM
-1 comments, last by gimp 23 years, 11 months ago
If I use structs\unions to simplify the way I code my matrix library will the code actually be slower as a result. Here is a sample of Bas Kunens Code:
  	union
	{	struct
		{	CVector RotX;
			float	m03;
			CVector RotY;
			float	m13;
			CVector RotZ;
			float	m23;
			union
			{	struct	{	CVector Pos;	};
				struct	{	float x,y,z;	};
			};
			float	m33;
		};
		float m4x4[4][4];
		float m16[16];
	};
  
I''m starting with his class then modifying it my taste''s. I just need to know if not specifying the index directly and simplifying code will kill me in the long run Many thanks Chris
Chris Brodie

This topic is closed to new replies.

Advertisement