mirror of https://github.com/mosra/magnum.git
Browse Source
Before it was one constructor using bool parameter, which is massive
antipattern:
Matrix4 m(false); // Huh? No Matrix4 then or what?
Iẗ́'s now separated into two distinct constructors, of them one can be
already declared as constexpr (hooray). The usage is as follows:
Matrix4 a; // Default (identity matrix)
Matrix4 b(Matrix4::Identity); // Explicitly identity matrix
Matrix4 c(Matrix4::Zero); // Zero-filled matrix
Also deleted constructor from one parameter, so following mistakes
now cannot compile:
Matrix4 d(true); // Both would set element at [0][0] to 1,
Matrix4 e(Matrix3::Zero); // and other to 0
vectorfields
4 changed files with 57 additions and 22 deletions
Loading…
Reference in new issue