mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-26 14:08:53 -05:00
Fading of propertyowners through GUI, and more owners with fade property (#2557)
* Add property in OpenSpaceEngine for fading duration when enabling / disabling * Add interface for fadeable components and apply to renderable * Make layers a fadeable component * Make globelabels a fadeable component * Make labelscomponent a fadeable, and give it an enabled property * Make screenspace renderables fadeable components * Introduce concept of parent fadeables, to fade out subowners with parent * Make rings fadeable as well --------- Co-authored-by: Alexander Bock <alexander.bock@liu.se>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#define __OPENSPACE_CORE___RENDERABLE___H__
|
||||
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
#include <openspace/rendering/fadeable.h>
|
||||
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <openspace/properties/scalar/doubleproperty.h>
|
||||
@@ -52,7 +53,7 @@ namespace documentation { struct Documentation; }
|
||||
|
||||
class Camera;
|
||||
|
||||
class Renderable : public properties::PropertyOwner {
|
||||
class Renderable : public properties::PropertyOwner, public Fadeable {
|
||||
public:
|
||||
enum class RenderBin : int {
|
||||
Background = 1,
|
||||
@@ -102,9 +103,7 @@ public:
|
||||
|
||||
bool matchesSecondaryRenderBin(int binMask) const noexcept;
|
||||
|
||||
void setFade(float fade);
|
||||
|
||||
bool isVisible() const;
|
||||
bool isVisible() const override;
|
||||
|
||||
void onEnabledChange(std::function<void(bool)> callback);
|
||||
|
||||
@@ -112,8 +111,6 @@ public:
|
||||
|
||||
protected:
|
||||
properties::BoolProperty _enabled;
|
||||
properties::FloatProperty _opacity;
|
||||
properties::FloatProperty _fade;
|
||||
properties::StringProperty _renderableType;
|
||||
properties::BoolProperty _dimInAtmosphere;
|
||||
|
||||
@@ -124,7 +121,7 @@ protected:
|
||||
void registerUpdateRenderBinFromOpacity();
|
||||
|
||||
/// Returns the full opacity constructed from the _opacity and _fade property values
|
||||
float opacity() const;
|
||||
float opacity() const override;
|
||||
|
||||
double _boundingSphere = 0.0;
|
||||
double _interactionSphere = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user