.. index:: pair: class; EE::Math::Quad2 .. _doxid-class_e_e_1_1_math_1_1_quad2: template class EE::Math::Quad2 ============================== .. toctree:: :hidden: Overview ~~~~~~~~ Utility template class for manipulating quads. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include template class Quad2 { public: // fields :ref:`Vector2` :target:`V`[4]; // construction :ref:`Quad2`(); :ref:`Quad2`(const :ref:`tRECT`& R); :ref:`Quad2`(const :ref:`Vector2`& v1, const :ref:`Vector2`& v2, const :ref:`Vector2`& v3, const :ref:`Vector2`& v4); // methods const :ref:`Vector2`& :ref:`operator[]`(const :ref:`Uint32`& Pos) const; :ref:`Vector2` :ref:`getCenter`(); :ref:`Vector2`& :ref:`getAt`(:ref:`Uint32` Index); :ref:`tRECT` :ref:`toAABB`(const T& OffsetX = 0, const T& OffsetY = 0); void :ref:`rotate`(const T& Angle, const :ref:`Vector2`& Center); void :ref:`rotate`(const T& Angle); void :ref:`scale`(const T& scale); void :ref:`scale`(const T& scale, const :ref:`Vector2`& center); void :ref:`scale`(const :ref:`Vector2`& scale); void :ref:`scale`(const :ref:`Vector2`& scale, const :ref:`Vector2`& center); void :ref:`move`(:ref:`Vector2` dist); static Quad2 :ref:`fromAABB`(const :ref:`tRECT`& R); }; .. _details-class_e_e_1_1_math_1_1_quad2: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Utility template class for manipulating quads. Construction ------------ .. index:: pair: function; Quad2 .. _doxid-class_e_e_1_1_math_1_1_quad2_1a74eb80111018158dd5fc3391d1caa817: .. ref-code-block:: cpp :class: doxyrest-title-code-block Quad2() Default constructor creates an empty quad ( four Vector2(0,0) .. index:: pair: function; Quad2 .. _doxid-class_e_e_1_1_math_1_1_quad2_1a6fc4efcbd6e876014afcaa41625eda79: .. ref-code-block:: cpp :class: doxyrest-title-code-block Quad2(const :ref:`tRECT`& R) Creates a quad from a Rectangle .. index:: pair: function; Quad2 .. _doxid-class_e_e_1_1_math_1_1_quad2_1add0e03baf6c8c614ca681506b15cbc92: .. ref-code-block:: cpp :class: doxyrest-title-code-block Quad2(const :ref:`Vector2`& v1, const :ref:`Vector2`& v2, const :ref:`Vector2`& v3, const :ref:`Vector2`& v4) Creates a quad from four :ref:`Vector2 ` Methods ------- .. index:: pair: function; operator[] .. _doxid-class_e_e_1_1_math_1_1_quad2_1a63d2f0427dc313d1a1035ad34c334de8: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Vector2`& operator[](const :ref:`Uint32`& Pos) const .. rubric:: Returns: The vector from the position ( position from 0 to 3 ) .. index:: pair: function; getCenter .. _doxid-class_e_e_1_1_math_1_1_quad2_1a3ec93c1ab7e82895203f9f9422b644ee: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Vector2` getCenter() Vector2 V[0]; //! Left - Top :ref:`Vector2 ` Vector2 V[1]; //! Left - Bottom :ref:`Vector2 ` Vector2 V[2]; //! Right - Bottom :ref:`Vector2 ` Vector2 V[3]; //! Right - Top :ref:`Vector2 ` .. rubric:: Returns: The center point of the quad .. index:: pair: function; getAt .. _doxid-class_e_e_1_1_math_1_1_quad2_1a45c4ed62a145fb232d7be0b522e944a9: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Vector2`& getAt(:ref:`Uint32` Index) .. rubric:: Returns: The :ref:`Vector2 ` from the position index ( from 0 to 3 ) .. index:: pair: function; toAABB .. _doxid-class_e_e_1_1_math_1_1_quad2_1a46e0e8a7d8447fb836fe71f19bd26404: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`tRECT` toAABB(const T& OffsetX = 0, const T& OffsetY = 0) .. rubric:: Returns: The Axis-Aligned bounding box of the Quad .. index:: pair: function; rotate .. _doxid-class_e_e_1_1_math_1_1_quad2_1a89349060c4c808ca64ec259360d7afd1: .. ref-code-block:: cpp :class: doxyrest-title-code-block void rotate(const T& Angle, const :ref:`Vector2`& Center) Rotates the quad from a rotation center .. index:: pair: function; rotate .. _doxid-class_e_e_1_1_math_1_1_quad2_1a2aec1f83418cf58c068fef2f25c81258: .. ref-code-block:: cpp :class: doxyrest-title-code-block void rotate(const T& Angle) Rotates the quad from its rotation center .. index:: pair: function; scale .. _doxid-class_e_e_1_1_math_1_1_quad2_1ac1ebaf667b2a17ec72b731788ba8d1ac: .. ref-code-block:: cpp :class: doxyrest-title-code-block void scale(const T& scale) Scale the quad from its rotation center .. index:: pair: function; scale .. _doxid-class_e_e_1_1_math_1_1_quad2_1ae15436ab53ee281ee07f29dadee4e5c2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void scale(const T& scale, const :ref:`Vector2`& center) Scale the quad from an specified center .. index:: pair: function; scale .. _doxid-class_e_e_1_1_math_1_1_quad2_1a5e52acd2970a37c9291a8b5fa55d69bc: .. ref-code-block:: cpp :class: doxyrest-title-code-block void scale(const :ref:`Vector2`& scale) Scale the quad from its rotation center .. index:: pair: function; scale .. _doxid-class_e_e_1_1_math_1_1_quad2_1a58b492aebfebcd66830649b1201e2dee: .. ref-code-block:: cpp :class: doxyrest-title-code-block void scale(const :ref:`Vector2`& scale, const :ref:`Vector2`& center) Scale the quad from an specified center .. index:: pair: function; move .. _doxid-class_e_e_1_1_math_1_1_quad2_1af5e3701b238b31951f125f5c7738bfe4: .. ref-code-block:: cpp :class: doxyrest-title-code-block void move(:ref:`Vector2` dist) Move the polygon Vector2s, add to every point the distance specified .. index:: pair: function; fromAABB .. _doxid-class_e_e_1_1_math_1_1_quad2_1a12a20fd69d30155cba63f6fbc96cbb52: .. ref-code-block:: cpp :class: doxyrest-title-code-block static Quad2 fromAABB(const :ref:`tRECT`& R) Creates a quad from a rectangle