# class hiro::modules::SkeletonResource

## Overview

Resource that allows visualization of a cogs::Skeleton structure. More…

    #include <SkeletonResource.h>

    class SkeletonResource: public hiro::Resource {
    public:
        // fields

        const geom::Aabb3 AABB;

        // construction

        SkeletonResource(const std::string& name, const cogs::Skeleton& skeleton);
        SkeletonResource(const std::string& name, const cogs::Skeleton& skeleton, const cogs::SkeletonAction& action);

        // methods

        const cogs::SkeletonPose& GetRestPose() const;
        void SetPose(const cogs::SkeletonPose& pose);
        const cogs::SkeletonPose& GetPose() const;
        const cogs::Skeleton& GetSkeleton() const;
        const cogs::SkeletonAction* GetAction() const;

    protected:
        // fields

        cogs::SkeletonPose restpose_;
        cogs::SkeletonPose pose_;
        cogs::Skeleton skeleton_;
        std::unique_ptr<cogs::SkeletonAction> skeleton_action_;

        // construction

        SkeletonResource(const hiro::ResourceId& dataid, const cogs::Skeleton& skeleton);

        // methods

        virtual hiro::PGadget CreateGadget();
    };

### Inherited Members

    public:
        // fields

        const hiro::ResourceId ID;

        // methods

        virtual hiro::PGadget CreateGadget() = 0;
        void ResetGadgets();
        virtual void Update(float delta_time);

    protected:
        // methods

        void DrawOnNextUpdate() const;

## Detailed Documentation

Resource that allows visualization of a cogs::Skeleton structure.

### Construction

    SkeletonResource(const std::string& name, const cogs::Skeleton& skeleton)

Creates new resource from the specified skeleton.

    SkeletonResource(const std::string& name, const cogs::Skeleton& skeleton, const cogs::SkeletonAction& action)

Creates new resource from the specified skeleton and assigns it an action.

### Methods

    const cogs::SkeletonPose& GetRestPose() const

Returns rest pose of a skeleton.

    void SetPose(const cogs::SkeletonPose& pose)

Changes the pose applied to the skeleton.

    const cogs::SkeletonPose& GetPose() const

Returns pose that is currently applied to the skeleton.

    const cogs::Skeleton& GetSkeleton() const

Returns currently assigned skeleton.

    const cogs::SkeletonAction* GetAction() const

Returns assigned skeleton action.

    virtual hiro::PGadget CreateGadget()

Override this method to create custom Gadget type objects.