Revision control

Copy as Markdown

/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef VRB_ANIMATED_TRANSFORM_DOT_H
#define VRB_ANIMATED_TRANSFORM_DOT_H
#include "vrb/Forward.h"
#include "vrb/MacroUtils.h"
#include "vrb/Transform.h"
#include "vrb/Updatable.h"
namespace vrb {
enum class AnimationState { Play, Stop };
class AnimatedTransform : public Transform, protected Updatable {
public:
static AnimatedTransformPtr Create(CreationContextPtr& aContext);
void SetAnimationState(const AnimationState aState);
AnimatedTransform& ResetAnimations();
AnimatedTransform& ClearAnimations();
AnimatedTransform& AddStaticTransform(const Matrix& aTransform);
AnimatedTransform& AddRotationAnimation(const Vector& aAxis, const float aAngularVelocity);
AnimatedTransform& AddTranslationAnimation(const Vector& aDirection, const float aSpeed);
// Transform Interface
void SetTransform(const Matrix& aTransform) override;
protected:
struct State;
AnimatedTransform(State& aState, CreationContextPtr& aContext);
~AnimatedTransform() = default;
// Updatable Interface
void UpdateResource(RenderContext& aContext) override;
private:
State& m;
VRB_NO_DEFAULTS(AnimatedTransform);
};
} // namespace vrb
#endif // VRB_ANIMATED_TRANSFORM_DOT_H