#pragma once #include "EmberDefines.h" namespace EmberNs { /// /// Thin derivation of pair for the element type /// of EmberMotion::m_MotionParams to allow for copying vectors /// of different types of T. /// Template argument expected to be float or double. /// template class EMBER_API MotionParam : public pair { public: /// /// Default constructor, which calls the base, which sets first and second to their defaults. /// MotionParam() = default; /// /// Member-wise constructor. /// /// The eEmberMotionParam value to assign to first /// The T value to assign to second MotionParam(eEmberMotionParam e, T t) : pair(e, t) { } /// /// Default copy constructor. /// /// The MotionParam object to copy MotionParam(const MotionParam& other) : pair () { operator=(other); } /// /// Copy constructor to copy a MotionParam object of type U. /// /// The MotionParam object to copy template MotionParam(const MotionParam& other) { operator=(other); } /// /// Default assignment operator. /// /// The MotionParam object to copy MotionParam& operator = (const MotionParam& other) { if (this != &other) MotionParam::operator=(other); return *this; } /// /// Assignment operator to assign a MotionParam object of type U. /// /// The MotionParam object to copy. /// Reference to updated self template MotionParam& operator = (const MotionParam& other) { this->first = other.first; this->second = static_cast(other.second); return *this; } }; /// /// EmberMotion elements allow for motion of the flame parameters such as zoom, yaw, pitch and friends /// The values in these elements can be used to modify flame parameters during rotation in much the same /// way as motion elements on xforms do. /// Template argument expected to be float or double. /// template class EMBER_API EmberMotion { public: /// /// Default constructor to initialize motion freq and offset to 0 and the motion func to SIN. /// EmberMotion() = default; ~EmberMotion() = default; /// /// Default copy constructor. /// /// The EmberMotion object to copy EmberMotion(const EmberMotion& other) { operator=(other); } /// /// Copy constructor to copy a EmberMotion object of type U. /// /// The EmberMotion object to copy template EmberMotion(const EmberMotion& other) { operator=(other); } /// /// Default assignment operator. /// /// The EmberMotion object to copy EmberMotion& operator = (const EmberMotion& other) { if (this != &other) EmberMotion::operator=(other); return *this; } /// /// Assignment operator to assign a EmberMotion object of type U. /// /// The EmberMotion object to copy. /// Reference to updated self template EmberMotion& operator = (const EmberMotion& other) { CopyCont(m_MotionParams, other.m_MotionParams); m_MotionFunc = other.m_MotionFunc; m_MotionFreq = static_cast(other.m_MotionFreq); m_MotionOffset = static_cast(other.m_MotionOffset); return *this; } T m_MotionFreq = 0; T m_MotionOffset = 0; eMotion m_MotionFunc = eMotion::MOTION_SIN; vector> m_MotionParams; }; }