missing matrix4f static const values

Apr 30, 2013 at 9:46 PM
Edited May 1, 2013 at 1:08 AM
It would be nice to see something like this in the Matrix classes.

static const int Matrix4f::fM11 = 0;
static const int Matrix4f::fM12 = 1;
static const int Matrix4f::fM13 = 2;
static const int Matrix4f::fM14 = 3;

static const int Matrix4f::fM21 = 4;
static const int Matrix4f::fM22 = 5;
static const int Matrix4f::fM23 = 6;
static const int Matrix4f::fM24 = 7;

static const int Matrix4f::fM31 = 8;
static const int Matrix4f::fM32 = 9;
static const int Matrix4f::fM33 = 10;
static const int Matrix4f::fM34 = 11;

static const int Matrix4f::fM41 = 12;
static const int Matrix4f::fM42 = 13;
static const int Matrix4f::fM43 = 14;
static const int Matrix4f::fM44 = 15;

So it is possible to do something like this:

Matrix4f matrix;
float value = matrix[Matrix4f::fM11];
Coordinator
May 1, 2013 at 2:01 AM
There is an existing static member function of Matrix4f called ::I(row,col) which returns the index of the associated row and column. Would that be a good thing to make available to the external users of the class (at the moment it is protected)?

I think this should be ok - it would make sense to add something like this. I'll try to add this to the matrix classes in the near future.