News for hackers. Stuff that matters.
Re:Show HN: Lumix Engine – Open source C++ 3D game engine by schoen on Wednesday March 01, 2017 @12:12PM (#13765697)
Could you explain a little more about how the operator overloading is used in this context? Is it just that arithmetic operators are made to work in their linear algebra sense on objects representing matrices, so M*N will return a new object representing the matrix product M×N?
Re:Show HN: Lumix Engine – Open source C++ 3D game engine by hacoo on Wednesday March 01, 2017 @03:59PM (#13768267)
That's exactly how it would be used. Game programming involves a pretty enormous amount of geometry and vector arithmetic, so it's a domain where being able to write s*(u+v) is an advantage over scaleVec(s, addVec(u, v)). Same logic applies to matrices, as you described.

Personally, I think there are more important advantages of C++ over C, and operator overloading can get ugly FAST if you're not careful.

Re:Show HN: Lumix Engine – Open source C++ 3D game engine by schoen on Wednesday March 01, 2017 @05:47PM (#13769339)
That makes sense. Thanks for the explanation!