VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
animClip.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3#pragma once
4
5#include <memory>
6#include <string>
7#include <unordered_map>
8
9#include "animTrack.h"
10
11namespace visutwin::canvas
12{
14 {
15 public:
16 AnimClip(const std::shared_ptr<AnimTrack>& track, float time, float speed, bool playing, bool loop);
17
18 void reset();
19 void pause();
20 void resume();
21 void stop();
22 void update(float dt);
23
24 void eval(std::unordered_map<std::string, AnimTransform>& transforms) const;
25
26 float time() const { return _time; }
27 void setTime(float value) { _time = value; }
28
29 float speed() const { return _speed; }
30 void setSpeed(float value) { _speed = value; }
31
32 bool loop() const { return _loop; }
33 void setLoop(bool value) { _loop = value; }
34
35 bool playing() const { return _playing; }
36
37 float blendWeight() const { return _blendWeight; }
38 void setBlendWeight(float value) { _blendWeight = value; }
39
40 const std::string& name() const { return _name; }
41 void setName(const std::string& value) { _name = value; }
42
43 const std::shared_ptr<AnimTrack>& track() const { return _track; }
44
45 private:
46 std::shared_ptr<AnimTrack> _track;
47
48 float _time = 0.0f;
49 float _speed = 1.0f;
50 bool _playing = true;
51 bool _loop = true;
52 float _blendWeight = 1.0f;
53
54 std::string _name;
55 };
56}
AnimClip(const std::shared_ptr< AnimTrack > &track, float time, float speed, bool playing, bool loop)
Definition animClip.cpp:9
void setTime(float value)
Definition animClip.h:27
void eval(std::unordered_map< std::string, AnimTransform > &transforms) const
Definition animClip.cpp:66
void setLoop(bool value)
Definition animClip.h:33
const std::shared_ptr< AnimTrack > & track() const
Definition animClip.h:43
void setBlendWeight(float value)
Definition animClip.h:38
const std::string & name() const
Definition animClip.h:40
void setSpeed(float value)
Definition animClip.h:30
float blendWeight() const
Definition animClip.h:37
void setName(const std::string &value)
Definition animClip.h:41