mirror of https://github.com/mosra/magnum.git
Browse Source
Positions were originally done using Point2D/3D to simplify their transformation using matrices and to some extent simplify their usage in shaders. But now the disadvantages exceeded the advantages: * They take 50% more for 2D positions and 33% more for 3D positions, as last coordinate is always equal to 1, on the other hand when last coordinate is errorneously not equal to 1 they have crazy behavior. * Normalizing them or transforming them with anything else than with matrices is PITA, as we need to strip the last component, do the transformation, and then add the component back. * All transformation handling classes (Complex, DualComplex, Quaternion, DualQuaternion, Matrix3, Matrix4) now have convenience functions for transforming points specified directly as Vector2/Vector3 (and also for transforming vectors). * When someone wants to use homogeneous coordinates with crazy last component values, they can do so with plain Vector3 for 2D and Vector4 for 3D and it will be less confusing than using Point2D/3D which no important detail hidden.pull/7/head
15 changed files with 39 additions and 43 deletions
Loading…
Reference in new issue