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

#pragma once

#include "glmSDKAPI.h"

#include "glmVector3.h"
#include "glmArray.h"
#include "glmPODArray.h"
#include "glmCharacterSkinMeshesInterface.h"

namespace glm
{
    class Vector3;
    class Entity;
    class CharacterSkinMeshes;

    class GLM_SDK_API EntityClothesInterface
    {
    public:
        EntityClothesInterface()
            : _characterSkinMeshes(NULL)
        {
        }
        virtual ~EntityClothesInterface()
        {
        }

        virtual bool isValid() const = 0;
        virtual const Entity* getEntity() const = 0;

        virtual CharacterSkinMeshesInterface* getCharacterSkinMeshes()
        {
            return _characterSkinMeshes;
        }
        virtual void setCharacterSkinMeshes(CharacterSkinMeshesInterface* characterSkinMeshes)
        {
			//set the skin mesh is needed before being able to call the getSimulatedClothMeshVertices method
            _characterSkinMeshes = characterSkinMeshes;
        } 

        virtual size_t getSimulatedClothesCount() const = 0;
        virtual bool isClothValid(size_t clothIndex) const = 0;
        virtual int getSimulatedClothAssetMeshIndex(size_t clothIndex) const = 0;
        virtual void getSimulatedClothMeshVertices(glm::PODArray<uint32_t>& meshVertexCountPerMeshIndex, glm::Array<Vector3>& meshVertices, const Vector3& coordinateSystemPos, const Quaternion& coordinateSystemOri, const size_t clothIndex) const = 0;

        virtual size_t getFrozenClothesCount() const = 0;
        virtual bool isFrozenClothValid(size_t /*clothIndex*/) const = 0;
        virtual int getFrozenClothAssetMeshIndex(size_t /*clothIndex*/) const = 0;
        virtual void getFrozenClothMeshVertices(glm::PODArray<uint32_t>& meshVertexCountPerMeshIndex, glm::Array<Vector3>& /*meshVertices*/, const Vector3& /*coordinateSystemPos*/, const Quaternion& /*coordinateSystemOri*/, const size_t /*clothIndex*/) const = 0;

    protected:
        CharacterSkinMeshesInterface* _characterSkinMeshes;
    };
} // namespace glm
