| 1 |
#pragma once |
| 2 |
|
| 3 |
#include <memory> |
| 4 |
#include <sigc++/signal.h> |
| 5 |
#include "igeometrystore.h" |
| 6 |
#include "math/AABB.h" |
| 7 |
#include "math/Matrix4.h" |
| 8 |
|
| 9 |
namespace render |
| 10 |
{ |
| 11 |
|
| 12 |
class IRenderableObject |
| 13 |
{ |
| 14 |
public: |
| 15 |
using Ptr = std::shared_ptr<IRenderableObject>; |
| 16 |
|
| 17 |
virtual ~IRenderableObject() {} |
| 18 |
|
| 19 |
// Returns true if this object is not empty and should be rendered |
| 20 |
virtual bool isVisible() = 0; |
| 21 |
|
| 22 |
// Returns true if this object has a non-identity transformation matrix |
| 23 |
virtual bool isOriented() = 0; |
| 24 |
|
| 25 |
// The model view matrix used to render this object |
| 26 |
virtual const Matrix4& getObjectTransform() = 0; |
| 27 |
|
| 28 |
// The object bounds in local coordinates |
| 29 |
virtual const AABB& getObjectBounds() = 0; |
| 30 |
|
| 31 |
// Emitted when the object bounds have changed, |
| 32 |
// because it has been either moved or resized. |
| 33 |
virtual sigc::signal<void>& signal_boundsChanged() = 0; |
| 34 |
|
| 35 |
// Returns the key to access the vertex data in the renderer's geometry store |
| 36 |
virtual IGeometryStore::Slot getStorageLocation() = 0; |
| 37 |
|
| 38 |
// Returns true if this surface produces shadows when lit |
| 39 |
virtual bool isShadowCasting() = 0; |
| 40 |
}; |
| 41 |
|
| 42 |
} |