38 #pragma region overridden_functions
42 return std::make_unique<Collider>(*
this);
45 auto onUpdate(
float dt) ->
void override;
54 auto save(
Stream& stream)
const ->
void override;
61#pragma region collider_functions
68 auto checkCollision(
const std::pair<float,float>& position)
const -> bool;
87#pragma region member_variables
sys::Json Stream
Definition AudioObject.h:20
The base class for components, holding all of their shared All components should inherit from this.
nlohmann::json json
Definition Json.cpp:19
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Collider.cpp:79
auto operator=(Collider &&other) noexcept -> Collider &=default
auto checkCollision(const std::pair< float, float > &position) const -> bool
Checks if a position is within the parent entity.
Definition Collider.cpp:98
auto load(Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Collider.cpp:88
auto componentShowMenu() -> void override
Definition Collider.cpp:66
friend auto from_json(const json &j, Collider &c) -> void
Definition Collider.cpp:151
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Collider.h:48
auto broadcastCollision(const std::pair< float, float > &position) -> bool
Checks if a position is within the parent entity.
Definition Collider.cpp:126
Collider()
Definition Collider.cpp:32
auto getColliderLayer() const -> unsigned int
Gets the collision layer of the collider.
Definition Collider.cpp:137
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Collider.cpp:93
auto onUpdate(float dt) -> void override
called once every frame.
Definition Collider.cpp:62
Collider & operator=(const Collider &other)=default
auto onEnterEngine() -> void override
hook that is called when a GameObject enters the Engine tree.
Definition Collider.cpp:83
~Collider() override
Definition Collider.cpp:46
std::string collisionEvent
Definition Collider.h:91
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Collider.h:40
friend auto to_json(json &j, const Collider &c) -> void
Definition Collider.cpp:142
unsigned int colliderLayer
Definition Collider.h:90
Component(ComponentTypeEnum type, const char *typeName)
Definition Component.cpp:72
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:23