Ask Your Question

Revision history [back]

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

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?