/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/

#pragma once

#include "glmCoreAPI.h"
#include "glmRTTI.h"

#include "glmGenericSpecificConverterBone.h"
#include "glmBonePhysicConfigurationV0.h"
#include "glmEffectorMirrorSource.h"

namespace glm
{
    struct HierarchicalBoneV0;
    struct HierarchicalSkeletonDescriptionV0;

    struct GenericSpecificConverterMappingV1
    {
        GLM_RTTI("27204a38-1aa4-49de-9ee9-132d8e61acf7", GenericSpecificConverterMappingV1, addAttributes);

    public:
        GLM_CLASS_STAT_ID( glm::MemoryStatIds::Simulation)

        GenericSpecificConverterMappingV1();
        ~GenericSpecificConverterMappingV1();

        //************************************************************
        //! @name Serialized data
        //************************************************************
        //@{
        HierarchicalSkeletonDescriptionV0* _skeletonDescription;

        const HierarchicalBoneV0* _pelvisBone;
        glm::Array<GenericSpecificConverterBoneV0> _spineBones;
        glm::Array<GenericSpecificConverterBoneV0> _limbBones;
        glm::Array<GenericSpecificConverterBoneV0> _effectorBones;

        glm::Array<glm::GlmString> _spineBoneNames;
        glm::Array<glm::GlmString> _limbBoneNames;
        glm::Array<glm::GlmString> _effectorBoneNames;

        glm::Array<const HierarchicalBoneV0*> _ikExcludedBones; // bones excluded from IK solving

        Vector3 _upAxis;
        Vector3 _frontAxis;

        glm::Array<BonePhysicConfigurationV0> _boneConfigurations;
        glm::PODArray<int> _channelMirrorSources;
        glm::Array<EffectorMirrorSourceV0> _effectorMirrorSources;
        glm::PODArray<float> _groundHeightArray;
        //@}

    private:
        GLM_DISALLOW_COPY_AND_ASSIGN(GenericSpecificConverterMappingV1);

        /**
		* \brief register the inspectable attributes to the class RTTI
		*/
        static void addAttributes();

        void finish();
        void clearMappingPart();
    };
} // namespace glm
