mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-28 07:59:37 -06:00
Merge branch 'master' into feature/model-opacity
* Solve conflicts in renderablemodel.cpp and renderabletrail.cpp
This commit is contained in:
@@ -55,6 +55,11 @@ class Camera;
|
||||
|
||||
class Renderable : public properties::PropertyOwner, public Fadeable {
|
||||
public:
|
||||
struct Settings {
|
||||
bool automaticallyUpdateRenderBin = true;
|
||||
bool shouldUpdateIfDisabled = false;
|
||||
};
|
||||
|
||||
enum class RenderBin : int {
|
||||
Background = 1,
|
||||
Opaque = 2,
|
||||
@@ -67,7 +72,7 @@ public:
|
||||
static ghoul::mm_unique_ptr<Renderable> createFromDictionary(
|
||||
ghoul::Dictionary dictionary);
|
||||
|
||||
Renderable(const ghoul::Dictionary& dictionary);
|
||||
Renderable(const ghoul::Dictionary& dictionary, Settings settings = Settings());
|
||||
virtual ~Renderable() override = default;
|
||||
|
||||
virtual void initialize();
|
||||
@@ -77,12 +82,12 @@ public:
|
||||
|
||||
virtual bool isReady() const = 0;
|
||||
bool isEnabled() const;
|
||||
bool shouldUpdateIfDisabled() const;
|
||||
bool shouldUpdateIfDisabled() const noexcept;
|
||||
|
||||
double boundingSphere() const;
|
||||
double interactionSphere() const;
|
||||
double boundingSphere() const noexcept;
|
||||
double interactionSphere() const noexcept;
|
||||
|
||||
std::string_view typeAsString() const;
|
||||
std::string_view typeAsString() const noexcept;
|
||||
|
||||
virtual void update(const UpdateData& data);
|
||||
virtual void render(const RenderData& data, RendererTasks& rendererTask);
|
||||
@@ -119,15 +124,14 @@ protected:
|
||||
void setInteractionSphere(double interactionSphere);
|
||||
|
||||
void setRenderBinFromOpacity();
|
||||
void registerUpdateRenderBinFromOpacity();
|
||||
|
||||
/// Returns the full opacity constructed from the _opacity and _fade property values
|
||||
float opacity() const override;
|
||||
float opacity() const noexcept override;
|
||||
|
||||
SceneGraphNode* parent() const noexcept;
|
||||
|
||||
bool automaticallyUpdatesRenderBin() const noexcept;
|
||||
|
||||
double _boundingSphere = 0.0;
|
||||
double _interactionSphere = 0.0;
|
||||
SceneGraphNode* _parent = nullptr;
|
||||
bool _shouldUpdateIfDisabled = false;
|
||||
RenderBin _renderBin = RenderBin::Opaque;
|
||||
|
||||
// An optional renderbin that renderables can use for certain components, in cases
|
||||
@@ -135,6 +139,14 @@ protected:
|
||||
std::optional<RenderBin> _secondaryRenderBin;
|
||||
|
||||
private:
|
||||
void registerUpdateRenderBinFromOpacity();
|
||||
|
||||
double _boundingSphere = 0.0;
|
||||
double _interactionSphere = 0.0;
|
||||
SceneGraphNode* _parent = nullptr;
|
||||
const bool _shouldUpdateIfDisabled = false;
|
||||
bool _automaticallyUpdateRenderBin = true;
|
||||
|
||||
// We only want the SceneGraphNode to be able manipulate the parent, so we don't want
|
||||
// to provide a set method for this. Otherwise, anyone might mess around with our
|
||||
// parentage and that's no bueno
|
||||
|
||||
Reference in New Issue
Block a user