/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A. - All Rights Reserved.                        *
*                                                                          *
***************************************************************************/
#pragma once

#include <glmCrowdIOAPI.h>
#include <glmSimulationData.h>
#include <glmFrameData.h>
#include <glmArray.h>

namespace glm
{
    //predeclarations
    class AssetOverride;
    class ShaderOverrides;

    namespace crowdio
    {
        //predeclarations
        struct GlmLayoutNode_v1;
        class glmHistoryRuntimeStructure;
        class CachedSimulation;

        void glmSimulationCacheGroundAdaptation_SimDataTransformation(const GlmLayoutNode_v1* currentNode, int currentNodeIndex, size_t currentNodeExecutionOrderIndex, CachedSimulation& cachedSimulation, glmHistoryRuntimeStructure* historyRuntime, const GlmSimulationData* srcSimData, GlmSimulationData* dstSimData);

        // Ground adaptation
        void extern GLM_CROWDIO_API groundAdaptFrameData(size_t historyIndex, CachedSimulation& cachedSimulation, GlmFrameData_v0* dstFrameData, int currentFrameIndex, const glm::Time* srcFrameIndices);
        void extern GLM_CROWDIO_API groundAdaptEntity_snap(float (*bonePositionsPtrSource)[3], float (*bonePositionsPtrDst)[3], float (*boneOrientationPtrDest)[4], uint16_t boneCount, float srcToDstScale, const glmHistoryRuntimeStructure* historyRuntime, bool adaptOri, float raycastStartOffset, float raycastUpSideLength, float raycastDownSideLength, float additionalUpTranslation);

    } // namespace crowdio
} // namespace glm
