/***************************************************************************
*                                                                          *
*  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"
#include "glmBlendShapeGroupV0.h"

namespace glm
{
    struct HierarchicalBoneV0;
    struct HierarchicalSkeletonDescriptionV0;

    struct GenericSpecificConverterMappingV2
    {
        GLM_RTTI("fb2455a6-e43a-4389-a3da-4514d21ced6c", GenericSpecificConverterMappingV2, addAttributes);

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

        GenericSpecificConverterMappingV2();
        ~GenericSpecificConverterMappingV2();

        //************************************************************
        //! @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;

        glm::Array<BlendShapeGroupV0> _blendShapeGroups;
        //@}

    private:
        GLM_DISALLOW_COPY_AND_ASSIGN(GenericSpecificConverterMappingV2);

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

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