|
|
|
|
|
by jacquesm
6083 days ago
|
|
Actually, you sort of prove my point there. How does someone looking at the code know which parts of projection and model get multiplied here ? At least make it: view.setVector(projection.getMatrix() * model.getVector());
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: view = matvecmul(projection,model);
And that's pretty close to the overloaded example. |
|
Multiplying matrices is no more weird than multiplying a float by an int or a positive and negative number.