20 #ifndef ANTKEEPER_ANIMATION_POSE_HPP
21 #define ANTKEEPER_ANIMATION_POSE_HPP
42 constexpr
pose() noexcept = default;
std::uint16_t bone_index_type
Bone index type.
Base class for skeleton poses.
const skeleton * get_skeleton() const noexcept
Returns the skeleton with which the pose is associated.
void set_relative_translation(bone_index_type index, const bone_transform_type::vector_type &translation)
Sets the relative translation of a bone pose.
void set_relative_transform(bone_index_type index, const bone_transform_type &transform)
Sets the relative transform describing a bone pose.
void set_relative_scale(bone_index_type index, const bone_transform_type::vector_type &scale)
Sets the relative scale of a bone pose.
void update()
Updates the pose after one or more relative transforms have been changed.
const skeleton * m_skeleton
Skeleton with which the pose is associated.
const bone_transform_type & get_relative_transform(bone_index_type index) const
Returns the relative transform describing a bone pose.
const bone_transform_type & get_absolute_transform(bone_index_type index) const
Returns the absolute transform describing a bone pose.
void set_relative_rotation(bone_index_type index, const bone_transform_type::quaternion_type &rotation)
Sets the relative rotation of a bone pose.
constexpr pose() noexcept=default
Constructs an empty pose.
std::vector< bone_transform_type > m_relative_transforms
Relative ransforms for each bone in a skeleton.
std::vector< bone_transform_type > m_absolute_transforms
Absolute transforms for each bone in a skeleton.
Skeletal animation skeleton.
quaternion< T > rotation(const vec3< T > &from, const vec3< T > &to, T tolerance=T{1e-6})
Constructs a quaternion representing the minimum rotation from one direction to another direction.
constexpr mat4< T > scale(const vec3< T > &v)
Constructs a scale matrix.
Quaternion composed of a real scalar part and imaginary vector part.