31 #ifndef INCLUDE_ARTICULATION_CHANNEL_H_ 32 #define INCLUDE_ARTICULATION_CHANNEL_H_ 34 #include <assimp/scene.h> 35 #include <glm/detail/type_vec3.hpp> 36 #include <glm/detail/type_mat4x4.hpp> 39 #include <gtest/gtest_prod.h> 61 Channel(
Scene *
const scene,
const aiNodeAnim *
const channel,
const size_t id);
127 typedef std::map<size_t, glm::vec3>
Scales;
154 static std::pair<typename M::const_iterator, typename M::const_iterator>
findInterval(
const M& map,
155 const typename M::key_type& key) {
156 typename M::const_iterator a = map.begin();
157 typename M::const_iterator b = map.begin();
158 for (
typename M::const_iterator it = map.begin(); it != map.end(); ++it) {
159 if (it->first <= key)
161 if (it->first <= key || a->first != key)
166 return std::make_pair(a, b);
Node * getNode() const
Returns the scene graph node that this camera is attached to.
Definition: Channel.h:82
size_t numFrames
Number of frames of the animation.
Definition: Channel.h:144
size_t timeToFrame(const double &time) const
Converts time in seconds to frame number.
const size_t & getNumFrames() const
Duration of this animation channel in frames.
Definition: Channel.h:106
static std::pair< typename M::const_iterator, typename M::const_iterator > findInterval(const M &map, const typename M::key_type &key)
Definition: Channel.h:154
Scene graph corresponding to Assimp's aiScene.
Definition: Scene.h:59
Scene graph node, corresponding to Assimp's aiNode.
Definition: Node.h:52
const glm::mat4 & getLocalTransform() const
Returns the current local transform.
Definition: Channel.h:117
Locations locations
Location keyframes.
Definition: Channel.h:129
Rotations rotations
Rotation keyframes.
Definition: Channel.h:130
const size_t & getStartFrame() const
Frame number where this animation channel starts.
Definition: Channel.h:90
Channel(Scene *const scene, const aiNodeAnim *const channel, const size_t id)
Constructor.
std::map< size_t, glm::vec3 > Scales
Scale key frames, maps frame number to scale vector.
Definition: Channel.h:127
const size_t & getEndFrame() const
Frame number where this animation channel ends.
Definition: Channel.h:98
Node *const node
The scene graph node assigned to this animation channel, see getNode().
Definition: Channel.h:123
virtual ~Channel()
Destructor.
size_t startFrame
Start frame of the animation.
Definition: Channel.h:142
Definition: AbstractCamera.h:41
const size_t id
Unique ID, see getId().
Definition: Channel.h:122
void setFrame(const size_t frame)
Set the current frame of the animation.
std::map< size_t, glm::quat > Rotations
Rotation key frames, maps frame number to rotation quaternion.
Definition: Channel.h:126
Animation channel.
Definition: Channel.h:53
glm::mat4 localTransform
Local transform matrix of the animation channel.
Definition: Channel.h:133
size_t endFrame
End frame of the animation.
Definition: Channel.h:143
Scales scales
Scale keyframes.
Definition: Channel.h:131
std::map< size_t, glm::vec3 > Locations
Location key frames, maps frame number to location vector.
Definition: Channel.h:125