mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-03 10:58:34 -06:00
Merge branch 'master' into feature/model-opacity
* Resolve conflicts in shaders for models and modelprojections
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#ifndef __OPENSPACE_CORE___CONFIGURATION___H__
|
||||
#define __OPENSPACE_CORE___CONFIGURATION___H__
|
||||
|
||||
#include <openspace/util/keys.h>
|
||||
#include <ghoul/lua/luastate.h>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <filesystem>
|
||||
@@ -91,6 +92,8 @@ struct Configuration {
|
||||
bool isLoggingOpenGLCalls = false;
|
||||
bool isPrintingEvents = false;
|
||||
|
||||
Key consoleKey = Key::GraveAccent;
|
||||
|
||||
float shutdownCountdown = 0.f;
|
||||
|
||||
bool shouldUseScreenshotDate = false;
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
#include <openspace/properties/optionproperty.h>
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
#include <openspace/properties/property.h>
|
||||
#include <openspace/properties/stringproperty.h>
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
#include <openspace/properties/stringproperty.h>
|
||||
#include <openspace/scene/profile.h>
|
||||
#include <openspace/util/keys.h>
|
||||
#include <openspace/util/mouse.h>
|
||||
@@ -145,6 +146,7 @@ private:
|
||||
properties::BoolProperty _printEvents;
|
||||
properties::OptionProperty _visibility;
|
||||
properties::BoolProperty _showHiddenSceneGraphNodes;
|
||||
properties::FloatProperty _fadeOnEnableDuration;
|
||||
properties::BoolProperty _disableAllMouseInputs;
|
||||
|
||||
std::unique_ptr<Scene> _scene;
|
||||
|
||||
@@ -519,7 +519,7 @@ struct EventRenderableDisabled : public Event {
|
||||
*/
|
||||
explicit EventRenderableDisabled(const SceneGraphNode* node_);
|
||||
|
||||
const tstring node;
|
||||
const tstring node;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -530,8 +530,15 @@ struct EventCameraPathStarted : public Event {
|
||||
|
||||
/**
|
||||
* Creates an instance of an EventCameraPathStarted event.
|
||||
*
|
||||
* \param origin_ The scene graph node from which the path started
|
||||
* \param destination_ The scene graph node at which the path ends
|
||||
*/
|
||||
EventCameraPathStarted();
|
||||
EventCameraPathStarted(const SceneGraphNode* origin_,
|
||||
const SceneGraphNode* destination_);
|
||||
|
||||
const tstring origin;
|
||||
const tstring destination;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -542,8 +549,15 @@ struct EventCameraPathFinished : public Event {
|
||||
|
||||
/**
|
||||
* Creates an instance of an EventCameraPathStarted event.
|
||||
*
|
||||
* \param origin_ The scene graph node from which the path started
|
||||
* \param destination_ The scene graph node where the path ended
|
||||
*/
|
||||
EventCameraPathFinished();
|
||||
EventCameraPathFinished(const SceneGraphNode* origin_,
|
||||
const SceneGraphNode* destination_);
|
||||
|
||||
const tstring origin;
|
||||
const tstring destination;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
namespace openspace::interaction {
|
||||
|
||||
struct Action {
|
||||
BooleanType(IsSynchronized);
|
||||
BooleanType(IsLocal);
|
||||
|
||||
/// Unique identifier that identifies this action. There is no special naming scheme
|
||||
/// that we enforce, we are trying to stick to the same . separated structure that
|
||||
@@ -59,10 +59,11 @@ struct Action {
|
||||
/// for the root path
|
||||
std::string guiPath = "/";
|
||||
|
||||
/// If this value is set to `Yes`, the execution of this action is synchronized to
|
||||
/// other OpenSpace instances, for example other nodes in a cluster environment, or
|
||||
/// to other OpenSpace instances using a parallel connection
|
||||
IsSynchronized synchronization = IsSynchronized::Yes;
|
||||
/// If this value is set to `Yes`, the execution of this action is restricted to the
|
||||
/// current OpenSpace instance. If it is `No`, it is synchronized to other OpenSpace
|
||||
/// instances, for example other nodes in a cluster environment, or to other OpenSpace
|
||||
/// instances using a parallel connection
|
||||
IsLocal isLocal = IsLocal::Yes;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
62
include/openspace/rendering/fadeable.h
Normal file
62
include/openspace/rendering/fadeable.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___FADEABLE___H__
|
||||
#define __OPENSPACE_CORE___FADEABLE___H__
|
||||
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
/**
|
||||
* This class is an interface for all things fadeable in the software; things that need
|
||||
* a fade and opacity property, which will be combined into a final opacity value
|
||||
*
|
||||
* A Fadeable can also be dependent on the fade value from a specified parent fadeable,
|
||||
* so that it fades out together with the parent
|
||||
*/
|
||||
class Fadeable {
|
||||
public:
|
||||
Fadeable();
|
||||
virtual ~Fadeable() = default;
|
||||
|
||||
void setFade(float fade);
|
||||
void setParentFadeable(Fadeable* parent);
|
||||
|
||||
float fade() const;
|
||||
virtual bool isVisible() const;
|
||||
|
||||
/// Returns the full opacity constructed from the _opacity and _fade property values
|
||||
virtual float opacity() const;
|
||||
|
||||
protected:
|
||||
properties::FloatProperty _opacity;
|
||||
properties::FloatProperty _fade;
|
||||
|
||||
Fadeable* _parentFadeable = nullptr;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___FADEABLE___H__
|
||||
@@ -58,6 +58,8 @@ public:
|
||||
void render();
|
||||
float currentHeight() const;
|
||||
|
||||
void setCommandInputButton(Key key);
|
||||
|
||||
private:
|
||||
void parallelConnectionChanged(const ParallelConnection::Status& status);
|
||||
|
||||
@@ -71,6 +73,8 @@ private:
|
||||
properties::Vec4Property _historyTextColor;
|
||||
properties::IntProperty _historyLength;
|
||||
|
||||
Key _commandInputButton = Key::GraveAccent;
|
||||
|
||||
size_t _inputPosition = 0;
|
||||
std::vector<std::string> _commandsHistory;
|
||||
size_t _activeCommand = 0;
|
||||
|
||||
@@ -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,
|
||||
@@ -103,9 +104,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);
|
||||
|
||||
@@ -113,8 +112,6 @@ public:
|
||||
|
||||
protected:
|
||||
properties::BoolProperty _enabled;
|
||||
properties::FloatProperty _opacity;
|
||||
properties::FloatProperty _fade;
|
||||
properties::StringProperty _renderableType;
|
||||
properties::BoolProperty _dimInAtmosphere;
|
||||
|
||||
@@ -125,7 +122,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;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define __OPENSPACE_CORE___SCREENSPACERENDERABLE___H__
|
||||
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
#include <openspace/rendering/fadeable.h>
|
||||
|
||||
#include <openspace/properties/triggerproperty.h>
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
@@ -49,7 +50,7 @@ namespace documentation { struct Documentation; }
|
||||
* the planes from Spherical to Cartesian coordinates and back. It also specifies the
|
||||
* interface that its children need to implement.
|
||||
*/
|
||||
class ScreenSpaceRenderable : public properties::PropertyOwner {
|
||||
class ScreenSpaceRenderable : public properties::PropertyOwner, public Fadeable {
|
||||
public:
|
||||
static std::unique_ptr<ScreenSpaceRenderable> createFromDictionary(
|
||||
const ghoul::Dictionary& dictionary);
|
||||
@@ -111,7 +112,6 @@ protected:
|
||||
glm::vec3 cartesianToSpherical(const glm::vec3& cartesian) const;
|
||||
glm::vec3 sphericalToCartesian(glm::vec3 spherical) const;
|
||||
glm::vec3 sanitizeSphericalCoordinates(glm::vec3 spherical) const;
|
||||
float opacity() const;
|
||||
|
||||
properties::BoolProperty _enabled;
|
||||
properties::BoolProperty _usePerspectiveProjection;
|
||||
@@ -133,8 +133,6 @@ protected:
|
||||
properties::FloatProperty _gamma;
|
||||
properties::Vec3Property _multiplyColor;
|
||||
properties::Vec4Property _backgroundColor;
|
||||
properties::FloatProperty _opacity;
|
||||
properties::FloatProperty _fade;
|
||||
properties::TriggerProperty _delete;
|
||||
|
||||
glm::ivec2 _objectSize = glm::ivec2(0);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <filesystem>
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <list>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
@@ -164,10 +164,10 @@ private:
|
||||
|
||||
/// This list contains all of the assets that are queued to be loading in the next
|
||||
/// update call
|
||||
std::unordered_set<std::string> _assetAddQueue;
|
||||
std::list<std::string> _assetAddQueue;
|
||||
|
||||
/// The list contains all of the assets that should be removed in the next update call
|
||||
std::unordered_set<std::string> _assetRemoveQueue;
|
||||
std::list<std::string> _assetRemoveQueue;
|
||||
|
||||
/// This list contains all assets that need to be initialized in the next update call
|
||||
std::vector<Asset*> _toBeInitialized;
|
||||
|
||||
@@ -346,7 +346,7 @@ private:
|
||||
std::chrono::time_point<std::chrono::steady_clock> beginTime;
|
||||
float durationSeconds;
|
||||
std::string postScript;
|
||||
|
||||
|
||||
ghoul::EasingFunc<float> easingFunction;
|
||||
bool isExpired = false;
|
||||
};
|
||||
@@ -355,6 +355,9 @@ private:
|
||||
ghoul::MemoryPool<4096> _memoryPool;
|
||||
};
|
||||
|
||||
// Convert the input string to a format that is valid as an identifier
|
||||
std::string makeIdentifier(std::string str);
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___SCENE___H__
|
||||
|
||||
Reference in New Issue
Block a user