Move billboard state into LabelDrawableSettings
This commit is contained in:
@@ -23,8 +23,9 @@ namespace OpenVulkano::Scene
|
||||
float cornerRadius = 0.05f;
|
||||
float arrowLength = 0.5f;
|
||||
float arrowWidth = 0.2f;
|
||||
int32_t hasRoundedCorners = false;
|
||||
int32_t hasArrow = false;
|
||||
bool hasRoundedCorners = false;
|
||||
bool hasArrow = false;
|
||||
bool isBillboard = false;
|
||||
};
|
||||
|
||||
struct LabelUniformData
|
||||
@@ -43,8 +44,7 @@ namespace OpenVulkano::Scene
|
||||
class LabelDrawable final : public Drawable
|
||||
{
|
||||
public:
|
||||
LabelDrawable(const std::shared_ptr<AtlasData>& atlasData,
|
||||
const LabelDrawableSettings& settings = LabelDrawableSettings(), bool isBillboard = false);
|
||||
LabelDrawable(const std::shared_ptr<AtlasData>& 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; }
|
||||
@@ -52,7 +52,7 @@ namespace OpenVulkano::Scene
|
||||
[[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_isBillboard; }
|
||||
[[nodiscard]] bool IsBillboard() const { return m_settings.isBillboard; }
|
||||
[[nodiscard]] const Math::AABB& GetBoundingBox() const { return m_bbox; }
|
||||
std::optional<RayHit> Intersect(const Ray& ray) const override;
|
||||
|
||||
@@ -66,6 +66,5 @@ namespace OpenVulkano::Scene
|
||||
std::shared_ptr<AtlasData> m_atlasData;
|
||||
Math::Vector3f m_position = { 0, 0, 0 };
|
||||
Math::AABB m_bbox;
|
||||
bool m_isBillboard;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user