|
|
|
|
|
by hmmmm
6083 days ago
|
|
>done just as nice with a properly named function call. So instead of view = projection * model; you would prefer. view.SetVector(Multiply3x3matrixWith3x1Vector(projection.GetMatrix(),model.GetVector()); Should we allow floats an doubles to be multiplied with a'*' or should that use properly named classes |
|
How does someone looking at the code know which parts of projection and model get multiplied here ?
At least make it:
Because '*' applied to a model or a projection could literally mean anything, there might be many elements in those structures that are candidates for multiplication.By making it explicit what gets multiplied the code is less clear than it could be.
If they're simple arrays without further fields attached to them then you could do:
And that's pretty close to the overloaded example.