Why are Matx, Vec, Point and Size different types?

asked 2016-05-31 03:24:24 -0600

emu gravatar image

In every program I code, sooner or later I bump up into one of these conversions:

  • Matx_<Type, N, 1> <-> Vec_<Type, N>
  • Point_<Type> <-> Vec_<Type, 2>
  • Point3_<Type> <-> Vec_<Type, 3>

...or operations like

  • Size_<Type> + Point_<Type>
  • Size_<Type> * Type
  • Point_<Type> * Type

Why are these four types not just aliases to Matx? What is the design aim behind this?

edit retag flag offensive close merge delete