/** * @file * * @author Max Lammers * @author Mamadou Babaei * * @section LICENSE * * Copyright (c) 2020 - 2025 SenseGlove * * @section DESCRIPTION * * */ #pragma once #include #include #include #include "Platform.hpp" namespace SGCore { namespace Haptics { class SGCORE_API TimedThumpCommand; class ThumperCommand; }// namespace Haptics }// namespace SGCore class SGCORE_API SGCore::Haptics::TimedThumpCommand { private: struct Impl; std::unique_ptr Pimpl; #if SENSEGLOVE_UNREAL_ENGINE_PLUGIN public: #else /* SENSEGLOVE_UNREAL_ENGINE_PLUGIN */ protected: #endif /* SENSEGLOVE_UNREAL_ENGINE_PLUGIN */ /// Internal, empty, for extended classes. TimedThumpCommand(); public: /// Create a new Timed Thumper Command. /// Value between 0 .. 1 representing the magnitude of the system. /// /// TimedThumpCommand(int32_t magnitude, float durationSeconds, float startTimeSeconds = 0.0f); /// Create a new Timed Thumper Command. /// /// /// TimedThumpCommand(const ThumperCommand& baseCommand, float durationSeconds, float startTimeSeconds = 0.0f); /** * The copy constructor. */ TimedThumpCommand(const TimedThumpCommand& rhs); /** * The move constructor. */ TimedThumpCommand(TimedThumpCommand&& rhs) noexcept; /// The basic destructor. virtual ~TimedThumpCommand(); public: /** * The copy assignment operator. */ TimedThumpCommand& operator=(const TimedThumpCommand& rhs); /** * The move assignment operator. */ TimedThumpCommand& operator=(TimedThumpCommand&& rhs) noexcept; public: /// Magnitude in %. SG_NODISCARD int32_t GetMagnitude() const; /// Duration in seconds. SG_NODISCARD float GetDuration() const; /// The elapsed time so far. SG_NODISCARD float GetElapsedTime() const; /// Returns true if the timed command has elapsed. SG_NODISCARD bool HasTimeElapsed() const; public: /// Copy the parameters of this ThumperCommand into another instance. /// virtual TimedThumpCommand Copy(bool bCopyElapsed = true) const; /// Update the timing on this Thumper Command. /// virtual void Update(float deltaSeconds); SG_NODISCARD virtual bool Equals(const ThumperCommand& command) const; public: SG_NODISCARD std::string ToString() const; };