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

#pragma once

#include "glmSDKAPI.h"
#include "glmAbstractMotionBehavior.h"

namespace glm
{
    class RagdollEntityComponent_PhysX;
    class AnimationData;
    class PhysicalizeBehavior_switch;

    class GLM_SDK_API AbstractDynamicsBehavior : public AbstractUserBehavior
    {
        friend class PhysicalizeBehavior_switch;
        friend class RagdollEntityComponent_PhysX;

    protected:
        Array<bool> _mask;
        glm::PODArray<int> _ragdollBonesIndices; /// per entity type

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

        AbstractDynamicsBehavior();
        virtual ~AbstractDynamicsBehavior();

        inline const Array<bool>& getMask() const { return _mask; }
        inline void setMask(const Array<bool>& mask) { _mask = mask; }

        // type checking - value derived from this type
        virtual bool isThisType(const AbstractBehavior* value) const override;

    protected:
        // cloning
        friend class CloneFactory;
        virtual AbstractDynamicsBehavior* create() const override = 0;

        virtual void doInit(BehaviorGraph& graph) override;
        virtual void doFinish(BehaviorGraph& graph) override;
    };
} // namespace glm
