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

#pragma once

#include "glmSDKAPI.h"

#include <glmAbstractTrigger.h>
#include <glmSimuEntityHandle.h>
#include <glmCollisionFilter.h>

namespace glm
{
    struct CollisionData;

    // Detects collisions on a physic entity
    class GLM_SDK_API EntityCollisionTrigger : public AbstractTrigger
    {
    public:
        CollisionFilter _filter;

    public:
		GLM_CLASS_STAT_ID(glm::MemoryStatIds::Simulation)
        typedef SmartPointer<EntityCollisionTrigger> SP;

        EntityCollisionTrigger();
        virtual ~EntityCollisionTrigger();

		virtual bool isShareable() override;

    protected:
        // cloning
        friend class CloneFactory;
        inline virtual EntityCollisionTrigger* create() const override;

        virtual bool doCall(int64_t index, AbstractBehavior* behavior, BehaviorGraph& behaviorGraph, bool isAttached) override;
    };

    //-------------------------------------------------------------------------
    inline EntityCollisionTrigger* EntityCollisionTrigger::create() const
    {
        EntityCollisionTrigger* myNewEntityCollisionTrigger = GLM_NEW(EntityCollisionTrigger, myNewEntityCollisionTrigger, getClassMemoryStatId());
        return myNewEntityCollisionTrigger;
    }
} // namespace glm
