Files
Webcam/include/engine/motion/motion_automation_source.h
2026-06-22 11:49:35 +02:00

64 lines
1.2 KiB
C++

/* -----------------------------------------------------------------------------
GSFramework
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */
#ifndef __MOTION_AUTOMATION_SOURCE__
#define __MOTION_AUTOMATION_SOURCE__
#include "automation/automation_source.h"
namespace GS {
namespace Core { class Motion; }
namespace Automation {
struct SourceGroup;
using Core::Motion;
/*!
@short Motion based automation source.
@author Emmanuel Julien (ejulien@gsworks.fr)
*/
class MotionSource : public Source
{
friend class Player;
protected:
SourceGroup *group;
bool active;
Motion *motion;
Curve::LoopMode loop_mode;
Time loop_start, loop_end;
public:
/// Set loop mode.
virtual void SetLoopMode(Curve::LoopMode loop = Curve::Reset) { loop_mode = loop; }
/// Set loop point.
virtual void SetLoop(const Time &start = Time::Inf, const Time &end = Time::Inf)
{
loop_start = start;
loop_end = end;
}
void Evaluate(Player &);
bool EvaluateRotation(Quaternion &);
/// Is motion done.
bool IsDone() const;
MotionSource(Motion *, SourceGroup * = 0);
};
} // Automation
} // GS
#endif // __MOTION_AUTOMATION_SOURCE__