From 836cdeb1038d65dddd0da7c06bd2c21db66aa155 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Thu, 30 Jul 2015 18:40:48 -0700 Subject: [PATCH] Baby steps toward new animation system * AnimNode pure virtual base class for all animation nodes. * AnimClip playback of a single FBX animation. --- libraries/animation/src/AnimClip.h | 26 ++++++++++++++++++++++++++ libraries/animation/src/AnimNode.h | 19 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 libraries/animation/src/AnimClip.h create mode 100644 libraries/animation/src/AnimNode.h diff --git a/libraries/animation/src/AnimClip.h b/libraries/animation/src/AnimClip.h new file mode 100644 index 0000000000..15c6dffae9 --- /dev/null +++ b/libraries/animation/src/AnimClip.h @@ -0,0 +1,26 @@ +// +// AnimClip.h +// +// Copyright 2015 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_AnimClip_h +#define hifi_AnimClip_h + +class AnimClip : public AnimNode { + + void setURL(const std::string& url); + void setStartFrame(AnimFrame startFrame); + void setEndFrame(AnimFrame startFrame); + void setLoopFlag(bool loopFlag); + void setTimeScale(float timeScale); + +public: + virtual const float getEnd() const; + virtual const AnimPose& evaluate(float t); +}; + +#endif // hifi_AnimClip_h diff --git a/libraries/animation/src/AnimNode.h b/libraries/animation/src/AnimNode.h new file mode 100644 index 0000000000..648138d06b --- /dev/null +++ b/libraries/animation/src/AnimNode.h @@ -0,0 +1,19 @@ +// +// AnimInterface.h +// +// Copyright 2015 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_AnimNode_h +#define hifi_AnimNode_h + +class AnimNode { +public: + virtual float getEnd() const = 0; + virtual const AnimPose& evaluate(float t) = 0; +}; + +#endif // hifi_AnimNode_h