diff --git a/openVulkanoCpp/Scene/IRayIntersectable.hpp b/openVulkanoCpp/Scene/IRayIntersectable.hpp index 0deaf91..1e4d741 100644 --- a/openVulkanoCpp/Scene/IRayIntersectable.hpp +++ b/openVulkanoCpp/Scene/IRayIntersectable.hpp @@ -13,6 +13,7 @@ namespace OpenVulkano::Scene class IRayIntersectable { public: + virtual ~IRayIntersectable() = default; virtual std::optional Intersect(const Ray& ray) const = 0; }; } diff --git a/openVulkanoCpp/Scene/Prefabs/LabelDrawable.hpp b/openVulkanoCpp/Scene/Prefabs/LabelDrawable.hpp index e50ec50..fe0e747 100644 --- a/openVulkanoCpp/Scene/Prefabs/LabelDrawable.hpp +++ b/openVulkanoCpp/Scene/Prefabs/LabelDrawable.hpp @@ -45,16 +45,19 @@ namespace OpenVulkano::Scene { public: LabelDrawable(const std::shared_ptr& atlasData, const LabelDrawableSettings& settings = LabelDrawableSettings()); + void AddText(const std::string& text, const TextConfig& config = TextConfig()); void SetLabelSettings(const LabelDrawableSettings& settings); void SetPosition(const Math::Vector3f& pos) { m_position = pos; } + [[nodiscard]] std::list& GetTexts() { return m_texts; } [[nodiscard]] LabelDrawableSettings& GetSettings() { return m_settings; } [[nodiscard]] UniformBuffer* GetLabelBuffer() { return &m_labelBuffer; } [[nodiscard]] Math::Vector3f& GetPosition() { return m_position; } [[nodiscard]] bool IsBillboard() const { return m_settings.isBillboard; } [[nodiscard]] const Math::AABB2f& GetBoundingBox() const { return m_bbox; } - std::optional Intersect(const Ray& ray) const override; + + [[nodiscard]] std::optional Intersect(const Ray& ray) const override; private: std::shared_ptr m_atlasData; diff --git a/openVulkanoCpp/Scene/TextDrawable.hpp b/openVulkanoCpp/Scene/TextDrawable.hpp index 60f2a6b..2dac8d8 100644 --- a/openVulkanoCpp/Scene/TextDrawable.hpp +++ b/openVulkanoCpp/Scene/TextDrawable.hpp @@ -48,9 +48,11 @@ namespace OpenVulkano::Scene TextDrawable(const std::string& atlasMetadataFile, Texture* atlasTex, const TextConfig& config = TextConfig()); TextDrawable(const Array& atlasMetadata, Texture* atlasTex, const TextConfig& config = TextConfig()); TextDrawable(const std::shared_ptr& atlasData, const TextConfig& config = TextConfig()); + void GenerateText(const std::string& text, const Math::Vector2f& pos = Math::Vector2f(0.f)); void SetConfig(const TextConfig& cfg) { m_cfg = cfg; } void SetAtlasData(const std::shared_ptr& atlasData); + [[nodiscard]] Math::AABB2f& GetBoundingBox() { return m_bbox; } [[nodiscard]] TextConfig& GetConfig() { return m_cfg; } [[nodiscard]] const std::string& GetText() const { return m_text; }