Dawn/archive/physics_components/2d/TriggerController2D.hpp

27 lines
773 B
C++

// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "Collider2D.hpp"
#include "BoxCollider.hpp"
namespace Dawn {
class CharacterController2D;
class TriggerController2D : public SceneItemComponent {
public:
std::shared_ptr<Collider2D> collider;
StateEvent<CharacterController2D*> eventTriggerEnter;
TriggerController2D(std::weak_ptr<SceneItem> i);
std::vector<std::shared_ptr<SceneItemComponent>> getDependencies() override;
/**
* Returns whether or not the given moving object is colliding with this
* trigger collider.
*/
bool_t getCollidingResult(std::shared_ptr<Collider2D> movingObject);
};
}