# struct cogs::SkeletonAction

## Overview

    #include <SkeletonAction.h>

    struct SkeletonAction {
        // structs

        struct BoneChannels;
        struct RootChannels;

        // fields

        std::string name;
        std::string target;
        float fps { 1.0f };
        RootChannels root_channels;
        std::map<std::string, BoneChannels> bone_channels;

        // methods

        float GetDuration() const;
        bool IsEmpty() const;
        void AdjustPoseToTime(float time, const Skeleton& target_skeleton, SkeletonPose* out_pose) const;
        std::vector<SkeletonPose> BakePoseAnimation(const Skeleton& target_skeleton) const;
    };

## Detailed Documentation

### Methods

    float GetDuration() const

Returns time of last existing key frame.

    bool IsEmpty() const

Checks whether all channels are empty.

    void AdjustPoseToTime(float time, const Skeleton& target_skeleton, SkeletonPose* out_pose) const

Adjusts pose using data from non empty channels.

    std::vector<SkeletonPose> BakePoseAnimation(const Skeleton& target_skeleton) const

Builds all frames of pose animation for specified skeleton.