#include #include #include namespace anime_loader = ::basalt::shared::anime_loader; using anime_loader::AnimeLoaderConfig; using anime_loader::IAnimeLoader; using anime_loader::KeyFrame; using ::basalt::shared::math::FloatPoint; #define F(x) (static_cast(x)) class ChickenNuggetAnimeLoader : public IAnimeLoader { public: ChickenNuggetAnimeLoader() {} virtual ~ChickenNuggetAnimeLoader() {} public: virtual void load(AnimeLoaderConfig&& config) override { IAnimeLoader::load(std::move(config)); this->timeline.add_key_frame(60 * 0, KeyFrame{.position = {F(0), F(-10), F(10)}, .rotation = {F(0.382683), F(0), F(0), F(0.92388)}}); this->timeline.add_key_frame(60 * 1, KeyFrame{.position = {F(-10), F(0), F(10)}, .rotation = {F(0.270598), F(-0.270598), F(-0.653282), F(0.653282)}}); this->timeline.add_key_frame(60 * 2, KeyFrame{.position = {F(0), F(10), F(10)}, .rotation = {F(0), F(-0.382683), F(-0.92388), F(0)}}); this->timeline.add_key_frame(60 * 3, KeyFrame{.position = {F(10), F(0), F(10)}, .rotation = {F(-0.270598), F(-0.270598), F(-0.653282), F(-0.653282)}}); this->timeline.add_key_frame(60 * 4, KeyFrame{.position = {F(0), F(-10), F(10)}, .rotation = {F(0.382683), F(0), F(0), F(0.92388)}}); // Same as the first } }; BS_EXPORT void* BSCreateInstance() { return static_cast(new ChickenNuggetAnimeLoader()); } BS_EXPORT void BSDestroyInstance(void* instance) { delete dynamic_cast(static_cast(instance)); }