.. index:: pair: class; EE::Math::Interpolation1d .. _doxid-class_e_e_1_1_math_1_1_interpolation1d: class EE::Math::Interpolation1d =============================== .. toctree:: :hidden: Overview ~~~~~~~~ A interpolation movement manager, used for movement interpolations. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Interpolation1d { public: // typedefs typedef std::function :target:`OnPathEndCallback`; typedef std::function :target:`OnStepCallback`; // construction :target:`Interpolation1d`(); :target:`Interpolation1d`(std::vector<:ref:`Point1d`> points); :target:`~Interpolation1d`(); // methods Interpolation1d& :ref:`add`(const :ref:`Float`& pos, const :ref:`Time`& Time = Time::Zero); Interpolation1d& :ref:`edit`(const unsigned int& PointNum, const :ref:`Float`& pos, const :ref:`Time`& time = Time::Zero); Interpolation1d& :ref:`erase`(const unsigned int& PointNum); Interpolation1d& :ref:`wait`(const :ref:`Float`& pos, const :ref:`Time`& time); Interpolation1d& :ref:`waitAndAdd`(const :ref:`Float`& pos, const :ref:`Time`& waitTime, const :ref:`Time`& addTime); Interpolation1d& :ref:`start`(); Interpolation1d& :ref:`start`(:ref:`OnPathEndCallback` PathEndCallback, :ref:`OnStepCallback` StepCallback = :ref:`OnStepCallback`()); Interpolation1d& :ref:`stop`(); Interpolation1d& :ref:`setPathEndCallback`(:ref:`OnPathEndCallback` PathEndCallback); Interpolation1d& :ref:`setStepCallback`(:ref:`OnStepCallback` StepCallback); void :ref:`update`(const :ref:`Time`& Elapsed); Interpolation1d& :ref:`reset`(); const :ref:`Float`& :ref:`getPosition`(); const bool& :ref:`getLoop`() const; Interpolation1d& :ref:`setLoop`(const bool& loop); Interpolation1d& :ref:`clear`(); const bool& :ref:`ended`() const; Interpolation1d& :ref:`setSpeed`(const :ref:`Float` speed); const :ref:`Float`& :ref:`getSpeed`() const; const bool& :ref:`isEnabled`() const; Interpolation1d& :target:`setEnabled`(const bool& enabled); Interpolation1d& :ref:`setDuration`(const :ref:`Time`& TotTime); const :ref:`Time`& :ref:`getDuration`() const; const std::vector<:ref:`Point1d`>& :ref:`getPoints`() const; std::vector<:ref:`Point1d`> :ref:`getReversePoints`(); :ref:`Point1d`* :ref:`getCurrentActual`() const; :ref:`Point1d`* :ref:`getCurrentNext`() const; const unsigned int& :ref:`getCurrentPositionIndex`() const; const :ref:`Float`& :ref:`getFinalPosition`(); Interpolation1d& :ref:`setType`(:ref:`Ease::Interpolation` InterpolationType); const int& :ref:`getType`() const; :ref:`UintPtr` :target:`getData`() const; void :target:`setData`(const :ref:`UintPtr`& data); :ref:`Float` :ref:`getCurrentProgress`(); :ref:`Float` :ref:`getPartialCurrentProgress`(); }; .. _details-class_e_e_1_1_math_1_1_interpolation1d: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ A interpolation movement manager, used for movement interpolations. Methods ------- .. index:: pair: function; add .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a928f9cc3824d1c4bf47dfcdc0ccd05e3: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& add(const :ref:`Float`& pos, const :ref:`Time`& Time = Time::Zero) Add a new point .. index:: pair: function; edit .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1aa2d70a5ccf58f0f015aa7827c2cdc41c: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& edit(const unsigned int& PointNum, const :ref:`Float`& pos, const :ref:`Time`& time = Time::Zero) Edit a point .. index:: pair: function; erase .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1af3565041bf17ae371a01f50830626a3c: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& erase(const unsigned int& PointNum) Erase a point .. index:: pair: function; wait .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a18c7684adb2dbf4bdb37da8d49b3e1ed: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& wait(const :ref:`Float`& pos, const :ref:`Time`& time) Same as add( pos, time ).add( pos ); .. index:: pair: function; waitAndAdd .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a8a82afc2cfea615cad50f0d201933e88: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& waitAndAdd(const :ref:`Float`& pos, const :ref:`Time`& waitTime, const :ref:`Time`& addTime) Same as add( pos, waitTime ).add( pos, addTime ); .. index:: pair: function; start .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a62219bb1e6c6bcc2e2086e9ca2a7165c: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& start() Start the animation .. index:: pair: function; start .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a8bab4d16144bae32a0b7a8d088740dca: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& start(:ref:`OnPathEndCallback` PathEndCallback, :ref:`OnStepCallback` StepCallback = :ref:`OnStepCallback`()) Start the animation .. index:: pair: function; stop .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1abf02aa131b6584e8723c5d2709af2a27: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& stop() Stop the animation .. index:: pair: function; setPathEndCallback .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a6eb087d79ec9ead11dbe694feb1970ce: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& setPathEndCallback(:ref:`OnPathEndCallback` PathEndCallback) Sets a path end callback .. index:: pair: function; setStepCallback .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1ab7347a0371fcf9c49119f12f058a6411: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& setStepCallback(:ref:`OnStepCallback` StepCallback) Sets a step callback .. index:: pair: function; update .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a9242744fe83ee69c036eb774304ff2b9: .. ref-code-block:: cpp :class: doxyrest-title-code-block void update(const :ref:`Time`& Elapsed) Update the movement interpolation .. index:: pair: function; reset .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a70e2c72ddc549b38e9e35e89f910147c: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& reset() Reset the class .. index:: pair: function; getPosition .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1aab8d3238a92001a75372ca240dff9e0c: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Float`& getPosition() .. rubric:: Returns: The Current Position .. index:: pair: function; getLoop .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a907a0c579588437c1f295b0733e1d5c1: .. ref-code-block:: cpp :class: doxyrest-title-code-block const bool& getLoop() const .. rubric:: Returns: If movement interpolation is a loop .. index:: pair: function; setLoop .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1aa04c29d1a91c0be05755d20dca760bb4: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& setLoop(const bool& loop) Set if loop the movement interpolation .. index:: pair: function; clear .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a32eb4709a15754c50b0d517f3065b7d8: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& clear() Clear all the points .. index:: pair: function; ended .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1aad5dbe2675a15d19378ad6217416d4f3: .. ref-code-block:: cpp :class: doxyrest-title-code-block const bool& ended() const .. rubric:: Returns: If the animation ended .. index:: pair: function; setSpeed .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a1702354b099c1d4c793e5d7f1a7706fe: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& setSpeed(const :ref:`Float` speed) Set the current interpolation speed .. index:: pair: function; getSpeed .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a8ce746c7703ae2880b211e061c682215: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Float`& getSpeed() const Get the current interpolation speed .. index:: pair: function; isEnabled .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a7026ff2b520331a68ea48f287151d255: .. ref-code-block:: cpp :class: doxyrest-title-code-block const bool& isEnabled() const .. rubric:: Returns: If enabled .. index:: pair: function; setDuration .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a5da7ec6411587b93c134695248a8f8a7: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& setDuration(const :ref:`Time`& TotTime) Instead if setting the time between each waypoint, this set a total time for all the movement interpolation. .. index:: pair: function; getDuration .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a57562cf4ef87be21e7d156d000632079: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Time`& getDuration() const .. rubric:: Returns: The total duration of the interpolation. .. index:: pair: function; getPoints .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a33d5cf47633754a6b54b15a963134cca: .. ref-code-block:: cpp :class: doxyrest-title-code-block const std::vector<:ref:`Point1d`>& getPoints() const .. rubric:: Returns: the vector of points .. index:: pair: function; getReversePoints .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a91482f45a441aef88ac1df994cfce16c: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector<:ref:`Point1d`> getReversePoints() .. rubric:: Returns: the vector of points reversed .. index:: pair: function; getCurrentActual .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1af7c7f1fd8e0bf199bb1894f6ab6dcceb: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Point1d`* getCurrentActual() const .. rubric:: Returns: The Current Node .. index:: pair: function; getCurrentNext .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a0e034f0ea0a9bb15605bd76cf7da1d9c: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Point1d`* getCurrentNext() const .. rubric:: Returns: The Next Node .. index:: pair: function; getCurrentPositionIndex .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a74a8598739a8bed6f7dc7f8ffbe11fea: .. ref-code-block:: cpp :class: doxyrest-title-code-block const unsigned int& getCurrentPositionIndex() const .. rubric:: Returns: The Current Position in the vector .. index:: pair: function; getFinalPosition .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a10b2c726f4f868282e5dda4db919b0d9: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Float`& getFinalPosition() .. rubric:: Returns: The path end position .. index:: pair: function; setType .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a65c4527b0fe8555beee0286ad5890d84: .. ref-code-block:: cpp :class: doxyrest-title-code-block Interpolation1d& setType(:ref:`Ease::Interpolation` InterpolationType) Set the type of interpolation to be used .. index:: pair: function; getType .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1ad39268a664cdfeefb9d103b3ad187dd2: .. ref-code-block:: cpp :class: doxyrest-title-code-block const int& getType() const .. rubric:: Returns: The type of the interpolation .. index:: pair: function; getCurrentProgress .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a2f31757a5d77949b14df0dab343c851f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Float` getCurrentProgress() .. rubric:: Returns: The current progress percentage (between 0 and 1) of the complete interpolation. .. index:: pair: function; getPartialCurrentProgress .. _doxid-class_e_e_1_1_math_1_1_interpolation1d_1a253cdde50311362b0e04658022c583e3: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Float` getPartialCurrentProgress() .. rubric:: Returns: The current progress porcentage of the current interpolation. This is the partial progress, not the global of the whole interpolation.