<dontspam@_dylan_.gov> wrote in message
news:dr***********@bigboote.WPI.EDU...
Hi all,
I have a function:
mat4 operator * (const float scalar);
(matrix times integer)
Is there a way that I could multiply an int by a matrix, as opposed to
only a matrix by an int?
You could make it a non-member.
But I'm curious as to what it would do...? I know that the result of
multiplying a matrix by a scaler is another matrix, but what would the
result of multiplying the other way around be?
If the result you want is a matrix (which is the only thing that makes sense
to me), then why do you need a specific order? Can't you just re-order the
call?
Oh well, in any case, the answer is to make it a non-member, and pass both
the integer scaler (lhs) and the matrix (rhs) as parameters.
-Howard