Loading anim/include/anim/animation_track.hpp +0 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,6 @@ public: private: double get_relative_time(double low, double high, double t) const; ValuePtr convertToValuePtr(const ValueType& value); }; } // namespace anim No newline at end of file anim/include/anim/ianimation_player.hpp +0 −19 Original line number Diff line number Diff line Loading @@ -5,25 +5,6 @@ namespace anim { namespace { com::Reflection::ValuePtr convertToValuePtr(const ValueType& value) { COM_REFLECTION_USINGS(); return std::visit([](auto&& val) -> com::Reflection::ValuePtr { using T = std::decay_t<decltype(val)>; if constexpr (std::is_same_v<T, bool>) { return ValuePtr(new ValueBOOL(val)); } else if constexpr (std::is_same_v<T, scalar>) { return ValuePtr(new ValueFLOAT(val)); } else if constexpr (std::is_same_v<T, vec3>) { return ValuePtr(new ValueVEC3(val)); } else if constexpr (std::is_same_v<T, quat>) { return ValuePtr(new ValueQUAT(val)); } throw std::runtime_error("Unsupported value type"); }, value); } } struct IAnimationPlayer : public com::Folder { using com::Folder::Folder; virtual void update(scalar t) = 0; Loading anim/include/anim/types.hpp +3 −0 Original line number Diff line number Diff line Loading @@ -2,12 +2,15 @@ #include <variant> #include <math/math.hpp> #include <com/reflection.hpp> namespace anim { // Type-safe variant to store different value types using ValueType = std::variant<bool, scalar, vec3, quat>; com::Reflection::ValuePtr convertToValuePtr(const ValueType& value); enum class InterpolationType : uint8_t { CONSTANT, LINEAR, Loading anim/src/animation_track.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -71,23 +71,6 @@ double AnimationTrack::get_relative_time(double low, double high, double t) cons return (t - low) / (high - low); } com::Reflection::ValuePtr AnimationTrack::convertToValuePtr(const ValueType& value) { COM_REFLECTION_USINGS(); return std::visit([](auto&& val) -> com::Reflection::ValuePtr { using T = std::decay_t<decltype(val)>; if constexpr (std::is_same_v<T, bool>) { return ValuePtr(new ValueBOOL(val)); } else if constexpr (std::is_same_v<T, scalar>) { return ValuePtr(new ValueFLOAT(val)); } else if constexpr (std::is_same_v<T, vec3>) { return ValuePtr(new ValueVEC3(val)); } else if constexpr (std::is_same_v<T, quat>) { return ValuePtr(new ValueQUAT(val)); } throw std::runtime_error("Unsupported value type"); }, value); } anim::ValueType AnimationTrack::update(double t) { ASSUMPTION(!m_keyframes.empty()); Loading anim/src/types.cpp 0 → 100644 +22 −0 Original line number Diff line number Diff line #include <anim/types.hpp> namespace anim { com::Reflection::ValuePtr convertToValuePtr(const ValueType& value) { COM_REFLECTION_USINGS(); return std::visit([](auto&& val) -> com::Reflection::ValuePtr { using T = std::decay_t<decltype(val)>; if constexpr (std::is_same_v<T, bool>) { return ValuePtr(new ValueBOOL(val)); } else if constexpr (std::is_same_v<T, scalar>) { return ValuePtr(new ValueFLOAT(val)); } else if constexpr (std::is_same_v<T, vec3>) { return ValuePtr(new ValueVEC3(val)); } else if constexpr (std::is_same_v<T, quat>) { return ValuePtr(new ValueQUAT(val)); } throw std::runtime_error("Unsupported value type"); }, value); } } // namespace anim Loading
anim/include/anim/animation_track.hpp +0 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,6 @@ public: private: double get_relative_time(double low, double high, double t) const; ValuePtr convertToValuePtr(const ValueType& value); }; } // namespace anim No newline at end of file
anim/include/anim/ianimation_player.hpp +0 −19 Original line number Diff line number Diff line Loading @@ -5,25 +5,6 @@ namespace anim { namespace { com::Reflection::ValuePtr convertToValuePtr(const ValueType& value) { COM_REFLECTION_USINGS(); return std::visit([](auto&& val) -> com::Reflection::ValuePtr { using T = std::decay_t<decltype(val)>; if constexpr (std::is_same_v<T, bool>) { return ValuePtr(new ValueBOOL(val)); } else if constexpr (std::is_same_v<T, scalar>) { return ValuePtr(new ValueFLOAT(val)); } else if constexpr (std::is_same_v<T, vec3>) { return ValuePtr(new ValueVEC3(val)); } else if constexpr (std::is_same_v<T, quat>) { return ValuePtr(new ValueQUAT(val)); } throw std::runtime_error("Unsupported value type"); }, value); } } struct IAnimationPlayer : public com::Folder { using com::Folder::Folder; virtual void update(scalar t) = 0; Loading
anim/include/anim/types.hpp +3 −0 Original line number Diff line number Diff line Loading @@ -2,12 +2,15 @@ #include <variant> #include <math/math.hpp> #include <com/reflection.hpp> namespace anim { // Type-safe variant to store different value types using ValueType = std::variant<bool, scalar, vec3, quat>; com::Reflection::ValuePtr convertToValuePtr(const ValueType& value); enum class InterpolationType : uint8_t { CONSTANT, LINEAR, Loading
anim/src/animation_track.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -71,23 +71,6 @@ double AnimationTrack::get_relative_time(double low, double high, double t) cons return (t - low) / (high - low); } com::Reflection::ValuePtr AnimationTrack::convertToValuePtr(const ValueType& value) { COM_REFLECTION_USINGS(); return std::visit([](auto&& val) -> com::Reflection::ValuePtr { using T = std::decay_t<decltype(val)>; if constexpr (std::is_same_v<T, bool>) { return ValuePtr(new ValueBOOL(val)); } else if constexpr (std::is_same_v<T, scalar>) { return ValuePtr(new ValueFLOAT(val)); } else if constexpr (std::is_same_v<T, vec3>) { return ValuePtr(new ValueVEC3(val)); } else if constexpr (std::is_same_v<T, quat>) { return ValuePtr(new ValueQUAT(val)); } throw std::runtime_error("Unsupported value type"); }, value); } anim::ValueType AnimationTrack::update(double t) { ASSUMPTION(!m_keyframes.empty()); Loading
anim/src/types.cpp 0 → 100644 +22 −0 Original line number Diff line number Diff line #include <anim/types.hpp> namespace anim { com::Reflection::ValuePtr convertToValuePtr(const ValueType& value) { COM_REFLECTION_USINGS(); return std::visit([](auto&& val) -> com::Reflection::ValuePtr { using T = std::decay_t<decltype(val)>; if constexpr (std::is_same_v<T, bool>) { return ValuePtr(new ValueBOOL(val)); } else if constexpr (std::is_same_v<T, scalar>) { return ValuePtr(new ValueFLOAT(val)); } else if constexpr (std::is_same_v<T, vec3>) { return ValuePtr(new ValueVEC3(val)); } else if constexpr (std::is_same_v<T, quat>) { return ValuePtr(new ValueQUAT(val)); } throw std::runtime_error("Unsupported value type"); }, value); } } // namespace anim