28 lines
714 B
C++
28 lines
714 B
C++
#ifndef LIGHTKEEPER_CHECKPOINT_H
|
|
#define LIGHTKEEPER_CHECKPOINT_H
|
|
|
|
#include <glm/vec3.hpp>
|
|
|
|
#include <destrum/ObjectModel/Component.h>
|
|
|
|
class Checkpoint final : public Component {
|
|
public:
|
|
explicit Checkpoint(GameObject& parent);
|
|
|
|
std::string GetTypeName() const override { return "Checkpoint"; }
|
|
|
|
void OnTriggerEnter(GameObject* other) override;
|
|
|
|
nlohmann::json Serialize() const override;
|
|
void Deserialize(const nlohmann::json& data) override;
|
|
void ImGuiInspector() override;
|
|
|
|
void SetSpawnOffset(const glm::vec3& offset) { m_SpawnOffset = offset; }
|
|
[[nodiscard]] glm::vec3 GetSpawnPoint() const;
|
|
|
|
private:
|
|
glm::vec3 m_SpawnOffset{0.0f};
|
|
};
|
|
|
|
#endif // LIGHTKEEPER_CHECKPOINT_H
|