mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
Simplify Overlays payloadGetBounds
This commit is contained in:
parent
6bb21b7a48
commit
e8da8e374c
2 changed files with 3 additions and 6 deletions
|
@ -47,6 +47,8 @@ public:
|
|||
void init(QScriptEngine* scriptEngine);
|
||||
virtual void update(float deltatime) {}
|
||||
virtual void render(RenderArgs* args) = 0;
|
||||
|
||||
virtual AABox getBounds() const = 0;
|
||||
|
||||
virtual bool addToScene(Overlay::Pointer overlay, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges);
|
||||
virtual void removeFromScene(Overlay::Pointer overlay, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges);
|
||||
|
|
|
@ -46,12 +46,7 @@ namespace render {
|
|||
}
|
||||
}
|
||||
template <> const Item::Bound payloadGetBound(const Overlay::Pointer& overlay) {
|
||||
if (overlay->is3D()) {
|
||||
return std::dynamic_pointer_cast<Base3DOverlay>(overlay)->getBounds();
|
||||
} else {
|
||||
QRect bounds = std::dynamic_pointer_cast<Overlay2D>(overlay)->getBounds();
|
||||
return AABox(glm::vec3(bounds.x(), bounds.y(), 0.0f), glm::vec3(bounds.width(), bounds.height(), 0.1f));
|
||||
}
|
||||
return overlay->getBounds();
|
||||
}
|
||||
template <> int payloadGetLayer(const Overlay::Pointer& overlay) {
|
||||
// MAgic number while we are defining the layering mechanism:
|
||||
|
|
Loading…
Reference in a new issue