metaforce/Runtime/Character/CTimeScaleFunctions.hpp

60 lines
2.0 KiB
C++
Raw Normal View History

2016-04-11 03:59:54 +00:00
#ifndef __PSHAG_CTIMESCALEFUNCTIONS_HPP__
#define __PSHAG_CTIMESCALEFUNCTIONS_HPP__
#include "RetroTypes.hpp"
namespace urde
{
enum class EVaryingAnimationTimeScaleType
{
Constant,
Linear
};
class IVaryingAnimationTimeScale
{
public:
virtual ~IVaryingAnimationTimeScale() = default;
virtual EVaryingAnimationTimeScaleType GetType() const=0;
virtual void VTimeScaleIntegral(const float&, const float&) const=0;
virtual void VFindUpperLimit(const float&, const float&) const=0;
virtual std::shared_ptr<IVaryingAnimationTimeScale> VClone() const=0;
virtual std::shared_ptr<IVaryingAnimationTimeScale> VGetFunctionMirrored(const float&) const=0;
std::shared_ptr<IVaryingAnimationTimeScale> Clone() const;
};
class CConstantAnimationTimeScale : public IVaryingAnimationTimeScale
{
public:
EVaryingAnimationTimeScaleType GetType() const {return EVaryingAnimationTimeScaleType::Constant;}
void VTimeScaleIntegral(const float&, const float&) const;
void VFindUpperLimit(const float&, const float&) const;
std::shared_ptr<IVaryingAnimationTimeScale> VClone() const;
std::shared_ptr<IVaryingAnimationTimeScale> VGetFunctionMirrored(const float&) const;
};
class CLinearAnimationTimeScale : public IVaryingAnimationTimeScale
{
float x4_;
float x8_;
float xc_;
float x10_;
public:
struct CFunctionDescription
{
};
EVaryingAnimationTimeScaleType GetType() const {return EVaryingAnimationTimeScaleType::Linear;}
void VTimeScaleIntegral(const float&, const float&) const;
void TimeScaleIntegralWithSortedLimits(const CFunctionDescription& desc, const float&, const float&);
void VFindUpperLimit(const float&, const float&) const;
void FindUpperLimitFromRoot(const CFunctionDescription& desc, const float&, const float&);
std::shared_ptr<IVaryingAnimationTimeScale> VClone() const;
std::shared_ptr<IVaryingAnimationTimeScale> VGetFunctionMirrored(const float&) const;
};
}
#endif // __PSHAG_CTIMESCALEFUNCTIONS_HPP__