mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-24 21:39:02 -05:00
Some code facelifting
This commit is contained in:
+1
-1
Submodule ext/ghoul updated: 4a17b2a165...874300a089
@@ -175,7 +175,7 @@ TestResult OperatorVerifier<T, Operator>::operator()(const ghoul::Dictionary& di
|
||||
o.offender = key;
|
||||
o.reason = TestResult::Offense::Reason::Verification;
|
||||
r.offenses.push_back(o);
|
||||
return r;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -290,7 +290,7 @@ TestResult NotInListVerifier<T>::operator()(const ghoul::Dictionary& dict,
|
||||
o.offender = key;
|
||||
o.reason = TestResult::Offense::Reason::Verification;
|
||||
r.offenses.push_back(o);
|
||||
return r;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -346,7 +346,7 @@ TestResult InRangeVerifier<T>::operator()(const ghoul::Dictionary& dict,
|
||||
o.offender = key;
|
||||
o.reason = TestResult::Offense::Reason::WrongType;
|
||||
r.offenses.push_back(o);
|
||||
return r;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -363,7 +363,7 @@ TestResult InRangeVerifier<T>::operator()(const ghoul::Dictionary& dict,
|
||||
o.offender = key;
|
||||
o.reason = TestResult::Offense::Reason::Verification;
|
||||
r.offenses.push_back(o);
|
||||
return r;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -405,7 +405,7 @@ TestResult NotInRangeVerifier<T>::operator()(const ghoul::Dictionary& dict,
|
||||
o.offender = key;
|
||||
o.reason = TestResult::Offense::Reason::WrongType;
|
||||
r.offenses.push_back(o);
|
||||
return r;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -419,7 +419,7 @@ TestResult NotInRangeVerifier<T>::operator()(const ghoul::Dictionary& dict,
|
||||
o.offender = key;
|
||||
o.reason = TestResult::Offense::Reason::Verification;
|
||||
r.offenses.push_back(o);
|
||||
return r;
|
||||
return r;
|
||||
}
|
||||
else {
|
||||
return { true, {}, {} };
|
||||
|
||||
@@ -52,7 +52,7 @@ struct Event {
|
||||
// to see all events.
|
||||
// 4. Add a new case into the logAllEvents function that handles the new enum entry
|
||||
// 5. If the new event type has any parameters it takes in its constructor, go into
|
||||
// the `toParameter` function and add a case label for the new enum type and
|
||||
// the `toParameter` function and add a case label for the new enum type and
|
||||
// return a dictionary with these parameters. This dictionary is passed to actions
|
||||
// if they are triggered by events
|
||||
// 6. Add the new enum entry into the `toString` and `fromString` methods
|
||||
@@ -107,7 +107,7 @@ void logAllEvents(const Event* e);
|
||||
* This event is created whenever a new scene graph node is added to the system. By the
|
||||
* time this event is signalled, the scene graph node has already been created and added
|
||||
* to the scene.
|
||||
*
|
||||
*
|
||||
* \param Node The identifier of the node that was added
|
||||
*/
|
||||
struct EventSceneGraphNodeAdded : public Event {
|
||||
@@ -125,7 +125,7 @@ struct EventSceneGraphNodeAdded : public Event {
|
||||
*/
|
||||
struct EventSceneGraphNodeRemoved : public Event {
|
||||
static const Type Type = Event::Type::SceneGraphNodeRemoved;
|
||||
|
||||
|
||||
explicit EventSceneGraphNodeRemoved(const SceneGraphNode* node_);
|
||||
const tstring node;
|
||||
};
|
||||
@@ -164,7 +164,7 @@ struct EventProfileLoadingFinished : public Event {
|
||||
* This event is created whenever some information about the application shutdown sequence
|
||||
* changes. This can either be that the seqeuence started, was aborted, or is finished,
|
||||
* which means that OpenSpace is just about the shutdown.
|
||||
*
|
||||
*
|
||||
* \param State The next state of the application shutdown sequence; is one of `Started`,
|
||||
* `Aborted`, or `Finished`
|
||||
*/
|
||||
@@ -184,7 +184,7 @@ struct EventApplicationShutdown : public Event {
|
||||
/**
|
||||
* This event is created when a new screenspace renderable has been created. By the time
|
||||
* this event is craeted, the screenspace renderable is already registered and available.
|
||||
*
|
||||
*
|
||||
* \param Renderable The identifier of the new screenspace renderable that was just added
|
||||
* to the system
|
||||
*/
|
||||
@@ -199,7 +199,7 @@ struct EventScreenSpaceRenderableAdded : public Event {
|
||||
* This event is created when a screenspace renderable has been removed from the system.
|
||||
* When this event is created, the screenspace renderable has already been removed and is
|
||||
* no longer available
|
||||
*
|
||||
*
|
||||
* \param Renderable The identifier of the screenspace renderable that was removed
|
||||
*/
|
||||
struct EventScreenSpaceRenderableRemoved : public Event {
|
||||
@@ -215,11 +215,13 @@ struct EventScreenSpaceRenderableRemoved : public Event {
|
||||
* Each scene graph node has an interaction sphere radius that serves as the reference
|
||||
* distance for all spheres.
|
||||
```
|
||||
Diagram of events for a camera moving from right-to-left. Interaction sphere is 'O' in middle, and ')' are spherical boundaries. The approach factor, reach factor, and interaction sphere radius are all taken from the current focus node.
|
||||
Diagram of events for a camera moving from right-to-left. Interaction sphere is 'O' in
|
||||
middle, and ')' are spherical boundaries. The approach factor, reach factor, and
|
||||
interaction sphere radius are all taken from the current focus node.
|
||||
|
||||
|<------------------->| Approach factor * Interaction sphere
|
||||
|<------>| Reach Factor * Interaction sphere
|
||||
|
||||
|
||||
( ( O ) )
|
||||
^ ^ ^ ^
|
||||
Exiting Receding Reaching Approaching
|
||||
@@ -227,7 +229,7 @@ Exiting Receding Reaching Approachi
|
||||
*
|
||||
* \param Node The name of the node the camera is transitioning relative to. Currently is
|
||||
* always the same as the camera's focus node
|
||||
* \param Transition The transition type that the camera just finished; is one of
|
||||
* \param Transition The transition type that the camera just finished; is one of
|
||||
* `Approaching`, `Reaching`, `Receding`, or `Exiting`
|
||||
*/
|
||||
struct EventCameraFocusTransition : public Event {
|
||||
@@ -293,7 +295,7 @@ struct EventPlanetEclipsed : public Event {
|
||||
/**
|
||||
* This event is created when the interpolation of a property value is finished. If the
|
||||
* interpolation time of a property change is 0s, this event is not fired
|
||||
*
|
||||
*
|
||||
* \param Property The URI of the property whose interpolation has finished
|
||||
*/
|
||||
struct EventInterpolationFinished : public Event {
|
||||
@@ -307,7 +309,7 @@ struct EventInterpolationFinished : public Event {
|
||||
* This event is created when the camera changes focus nodes. Even if the camera position
|
||||
* is interpolated, the node change happens instantaneously and the event is fired at the
|
||||
* same time.
|
||||
*
|
||||
*
|
||||
* \param OldNode The identifier of the scene graph node which was the old focus node
|
||||
* \param NewNode The identifier of the scene graph node that is the new focus node
|
||||
*/
|
||||
@@ -321,7 +323,7 @@ struct EventFocusNodeChanged : public Event {
|
||||
|
||||
/**
|
||||
* This event is created when a layer is added to to a globe.
|
||||
*
|
||||
*
|
||||
* \param Globe The identifier of the globe to which the layer is added
|
||||
* \param Group The identifier of the layer group to which the layer is added
|
||||
* \param Layer The identifier of the layer that was added
|
||||
@@ -329,7 +331,7 @@ struct EventFocusNodeChanged : public Event {
|
||||
struct EventLayerAdded : public Event {
|
||||
static const Type Type = Event::Type::LayerAdded;
|
||||
|
||||
explicit EventLayerAdded(std::string_view node_, std::string_view layerGroup_,
|
||||
explicit EventLayerAdded(std::string_view node_, std::string_view layerGroup_,
|
||||
std::string_view layer_);
|
||||
const tstring node;
|
||||
const tstring layerGroup;
|
||||
@@ -338,7 +340,7 @@ struct EventLayerAdded : public Event {
|
||||
|
||||
/**
|
||||
* This event is created when a layer is removed from a globe.
|
||||
*
|
||||
*
|
||||
* \param Globe The identifier of the globe from which the layer is removed
|
||||
* \param Group The identifier of the layer group from which the layer is removed
|
||||
* \param Layer The identifier of the layer that was removed
|
||||
@@ -346,7 +348,7 @@ struct EventLayerAdded : public Event {
|
||||
struct EventLayerRemoved : public Event {
|
||||
static const Type Type = Event::Type::LayerRemoved;
|
||||
|
||||
explicit EventLayerRemoved(std::string_view node_, std::string_view layerGroup_,
|
||||
explicit EventLayerRemoved(std::string_view node_, std::string_view layerGroup_,
|
||||
std::string_view layer_);
|
||||
const tstring node;
|
||||
const tstring layerGroup;
|
||||
@@ -356,7 +358,7 @@ struct EventLayerRemoved : public Event {
|
||||
/**
|
||||
* This event is created when something regarding a session recording playback changes.
|
||||
* The event contains information about the new state of the session recording subsystem.
|
||||
*
|
||||
*
|
||||
* \param State The new state of the session recording; one of `Started`, `Paused`,
|
||||
* `Resumed`, `Finished`
|
||||
*/
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
* no event exists. To navigate the full list of events, you can access the returned
|
||||
* Event's next function. If the end of the list is reached, the next pointer will be
|
||||
* a nullptr
|
||||
*
|
||||
*
|
||||
* \return The first event stored in the EventEngine or nullptr if no event exists
|
||||
*/
|
||||
events::Event* firstEvent() const;
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
* constructor. An example of usage is
|
||||
* <code>engine.publishEvent<MyEvent>("a", 2.0);</code> which would call the
|
||||
* constructor of \c MyEvent with a <code>const char*</code> and \c double parameter.
|
||||
*
|
||||
*
|
||||
* \param args The arguments that are passed to the constructor of T
|
||||
* \tparam T The subclass of Event that is to be published
|
||||
*/
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
|
||||
/**
|
||||
* Removing registration for a type/action combination.
|
||||
*
|
||||
*
|
||||
* \param type The type of the action that should be unregistered
|
||||
* \param actionIdentifier The identifier of the action that should be unregistered
|
||||
* \param filter The optional filter applied to the event-action combination
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
void triggerActions() const;
|
||||
|
||||
static scripting::LuaLibrary luaLibrary();
|
||||
|
||||
|
||||
private:
|
||||
/// The storage space in which Events are stored
|
||||
ghoul::MemoryPool<4096> _memory;
|
||||
|
||||
@@ -371,10 +371,10 @@ private:
|
||||
|
||||
/**
|
||||
* Orbit the current anchor node, in a right-bound orbit, by updating the position
|
||||
* and global rotation of the camera.
|
||||
*
|
||||
* and global rotation of the camera.
|
||||
*
|
||||
* Used for IdleBehavior::Behavior::Orbit
|
||||
*
|
||||
*
|
||||
* \param deltaTime The time step to use for the motion. Controls the rotation angle
|
||||
* \param position The position of the camera. Will be changed by the function
|
||||
* \param globalRotation The camera's global rotation. Will be changed by the function
|
||||
@@ -384,15 +384,15 @@ private:
|
||||
glm::dquat& globalRotation, double speedScale);
|
||||
|
||||
/**
|
||||
* Orbit the current anchor node, by adding a rotation around the given axis. For
|
||||
* example, when the axis is the north vector, the camera will stay on the current
|
||||
* latitude band. Note that this creates a rolling motion if the camera's forward
|
||||
* vector coincides with the axis, and should be used with care.
|
||||
*
|
||||
* Orbit the current anchor node, by adding a rotation around the given axis. For
|
||||
* example, when the axis is the north vector, the camera will stay on the current
|
||||
* latitude band. Note that this creates a rolling motion if the camera's forward
|
||||
* vector coincides with the axis, and should be used with care.
|
||||
*
|
||||
* Used for:
|
||||
* IdleBehavior::Behavior::OrbitAtConstantLat ( axis = north = z-axis ) and
|
||||
* IdleBehavior::Behavior::OrbitAroundUp ( axis = up = y-axis )
|
||||
*
|
||||
*
|
||||
* \param axis The axis to arbit around, given in model coordinates of the anchor
|
||||
* \param deltaTime The time step to use for the motion. Controls the rotation angle
|
||||
* \param position The position of the camera. Will be changed by the function
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
namespace openspace {
|
||||
struct CameraPose;
|
||||
namespace openspace {
|
||||
struct CameraPose;
|
||||
} // namespace openspace
|
||||
|
||||
namespace openspace::interaction {
|
||||
@@ -44,10 +44,10 @@ public:
|
||||
Linear,
|
||||
ZoomOutOverview,
|
||||
AvoidCollisionWithLookAt // @TODO (2021-08-13, emmbr) This type right now leads
|
||||
// to rapid rotations, but is useful in specific
|
||||
// scenarios, e.g. close to surfaces. Later we want to
|
||||
// to rapid rotations, but is useful in specific
|
||||
// scenarios, e.g. close to surfaces. Later we want to
|
||||
// remove it, and create a curve type that looks nicely
|
||||
// at the targets when moving, avoids collisions and
|
||||
// at the targets when moving, avoids collisions and
|
||||
// doesn't introduce sudden large changes in rotation
|
||||
};
|
||||
|
||||
@@ -63,21 +63,21 @@ public:
|
||||
double pathLength() const;
|
||||
|
||||
/**
|
||||
* Return a vector of positions corresponding to the control points of the path's
|
||||
* Return a vector of positions corresponding to the control points of the path's
|
||||
* spline curve
|
||||
*/
|
||||
std::vector<glm::dvec3> controlPoints() const;
|
||||
|
||||
/**
|
||||
* Take a step along the current path, corresponding to the delta time step \p dt, and
|
||||
* return the resulting camera pose. The \p speedScale is a factor that will be
|
||||
* return the resulting camera pose. The \p speedScale is a factor that will be
|
||||
* multiplied with the traversal speed
|
||||
*/
|
||||
CameraPose traversePath(double dt, float speedScale = 1.f);
|
||||
|
||||
/**
|
||||
* Return the identifer of the node that is the current appropriate anchor node, of
|
||||
* the start and end waypoint's reference node. Dtermined based on how far along the
|
||||
* Return the identifer of the node that is the current appropriate anchor node, of
|
||||
* the start and end waypoint's reference node. Dtermined based on how far along the
|
||||
* path we have traveled
|
||||
*/
|
||||
std::string currentAnchor() const;
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
|
||||
private:
|
||||
/**
|
||||
* Interpolate between the paths start and end rotation using the approach that
|
||||
* Interpolate between the paths start and end rotation using the approach that
|
||||
* corresponds to the path's curve type. The interpolation parameter \p t is the
|
||||
* same as for the position interpolation, i.e. the relative traveled in distance
|
||||
* along the path, in [0, 1]
|
||||
@@ -107,14 +107,14 @@ private:
|
||||
glm::dquat easedSlerpRotation(double t) const;
|
||||
|
||||
/**
|
||||
* Compute the interpolated rotation quaternion using an approach that first
|
||||
* interpolates to look at the start node, and then the end node, before
|
||||
* Compute the interpolated rotation quaternion using an approach that first
|
||||
* interpolates to look at the start node, and then the end node, before
|
||||
* interpolating to the end rotation
|
||||
*/
|
||||
glm::dquat lookAtTargetsRotation(double t) const;
|
||||
|
||||
/**
|
||||
* Evaluate the current traversal speed along the path, based on the currently
|
||||
* Evaluate the current traversal speed along the path, based on the currently
|
||||
* traveled distance. The final speed will be scaled to match the desired duration
|
||||
* for the path (which might have been specified by the user)
|
||||
*/
|
||||
@@ -134,9 +134,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// Create a path of the given type based on an instruction given as a dictionary.
|
||||
// See top of cpp file for documentation on keys and values for the dictionary.
|
||||
// Returns the created path.
|
||||
// Create a path of the given type based on an instruction given as a dictionary.
|
||||
// See top of cpp file for documentation on keys and values for the dictionary.
|
||||
// Returns the created path.
|
||||
Path createPathFromDictionary(const ghoul::Dictionary& dictionary, Path::Type type);
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
@@ -46,9 +46,9 @@ public:
|
||||
glm::dvec3 positionAt(double relativeDistance) const;
|
||||
|
||||
/**
|
||||
* Get the intorlatied position along the spline, based on the given curve parameter
|
||||
* u in range [0, 1]. A curve parameter of 0 returns the start position and 1 the end
|
||||
* position. Note that u does not correspond to the relatively traveled distance.
|
||||
* Get the intorlatied position along the spline, based on the given curve parameter
|
||||
* u in range [0, 1]. A curve parameter of 0 returns the start position and 1 the end
|
||||
* position. Note that u does not correspond to the relatively traveled distance.
|
||||
*/
|
||||
virtual glm::dvec3 interpolate(double u) const;
|
||||
|
||||
|
||||
@@ -45,4 +45,4 @@ private:
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
#endif // __OPENSPACE_MODULE_AUTONAVIGATION___AVOIDCOLLISIONCURVE___H__
|
||||
#endif // __OPENSPACE_CORE___AVOIDCOLLISIONCURVE___H__
|
||||
|
||||
@@ -53,7 +53,8 @@ public:
|
||||
private:
|
||||
CameraPose _pose;
|
||||
std::string _nodeIdentifier;
|
||||
double _validBoundingSphere = 0.0; // to be able to handle nodes with faulty bounding spheres
|
||||
// to be able to handle nodes with faulty bounding spheres
|
||||
double _validBoundingSphere = 0.0;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
@@ -114,7 +114,8 @@ public:
|
||||
using TemplateProperty<std::set<std::string>>::operator=;
|
||||
|
||||
protected:
|
||||
std::set<std::string> fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
std::set<std::string> fromLuaConversion(lua_State* state,
|
||||
bool& success) const override;
|
||||
|
||||
void toLuaConversion(lua_State* state) const override;
|
||||
|
||||
|
||||
@@ -357,7 +357,9 @@ constexpr double convertUnit(DistanceUnit fromUnit, DistanceUnit toUnit) {
|
||||
return convertMeters(toMeter(fromUnit), toUnit);
|
||||
}
|
||||
|
||||
constexpr double convertDistance(double distance, DistanceUnit fromUnit, DistanceUnit toUnit) {
|
||||
constexpr double convertDistance(double distance, DistanceUnit fromUnit,
|
||||
DistanceUnit toUnit)
|
||||
{
|
||||
return distance * convertUnit(fromUnit, toUnit);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___TSTRING___H__
|
||||
#define __OPENSPACE_CORE___TSTRING___H__
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
@@ -39,7 +42,7 @@ using tstring = std::string_view;
|
||||
|
||||
/**
|
||||
* Allocate and create a temporary string from the passed std::string.
|
||||
*
|
||||
*
|
||||
* \param str The string to be copied into a newly allocated tstring
|
||||
* \return The copy of the str as a temporary string
|
||||
*/
|
||||
@@ -47,7 +50,7 @@ tstring temporaryString(const std::string& str);
|
||||
|
||||
/**
|
||||
* Allocate and create a temporary string from the passed std::string_view.
|
||||
*
|
||||
*
|
||||
* \param str The string to be copied into a newly allocated tstring
|
||||
* \return The copy of the str as a temporary string
|
||||
*/
|
||||
@@ -55,10 +58,12 @@ tstring temporaryString(std::string_view str);
|
||||
|
||||
/**
|
||||
* Allocate and create a temporary string from the passed char array.
|
||||
*
|
||||
*
|
||||
* \param str The string to be copied into a newly allocated tstring
|
||||
* \return The copy of the str as a temporary string
|
||||
*/
|
||||
tstring temporaryString(const char str[]);
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___TSTRING___H__
|
||||
|
||||
@@ -498,7 +498,7 @@ void AtmosphereDeferredcaster::setParameters(float atmosphereRadius, float plane
|
||||
float averageGroundReflectance,
|
||||
float groundRadianceEmission,
|
||||
float rayleighHeightScale, bool enableOzone,
|
||||
float ozoneHeightScale, float mieHeightScale,
|
||||
float ozoneHeightScale, float mieHeightScale,
|
||||
float miePhaseConstant, float sunRadiance,
|
||||
glm::vec3 rayScatteringCoefficients,
|
||||
glm::vec3 ozoneExtinctionCoefficients,
|
||||
@@ -529,7 +529,7 @@ void AtmosphereDeferredcaster::setHardShadows(bool enabled) {
|
||||
|
||||
void AtmosphereDeferredcaster::calculateTransmittance() {
|
||||
ZoneScoped
|
||||
|
||||
|
||||
glFramebufferTexture(
|
||||
GL_FRAMEBUFFER,
|
||||
GL_COLOR_ATTACHMENT0,
|
||||
@@ -566,7 +566,7 @@ void AtmosphereDeferredcaster::calculateTransmittance() {
|
||||
|
||||
GLuint AtmosphereDeferredcaster::calculateDeltaE() {
|
||||
ZoneScoped
|
||||
|
||||
|
||||
GLuint deltaE = createTexture(_deltaETableSize, "DeltaE");
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, deltaE, 0);
|
||||
glViewport(0, 0, _deltaETableSize.x, _deltaETableSize.y);
|
||||
@@ -595,7 +595,7 @@ GLuint AtmosphereDeferredcaster::calculateDeltaE() {
|
||||
|
||||
std::pair<GLuint, GLuint> AtmosphereDeferredcaster::calculateDeltaS() {
|
||||
ZoneScoped
|
||||
|
||||
|
||||
GLuint deltaSRayleigh = createTexture(_textureSize, "DeltaS Rayleigh", 3);
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, deltaSRayleigh, 0);
|
||||
GLuint deltaSMie = createTexture(_textureSize, "DeltaS Mie", 3);
|
||||
@@ -649,7 +649,7 @@ std::pair<GLuint, GLuint> AtmosphereDeferredcaster::calculateDeltaS() {
|
||||
|
||||
void AtmosphereDeferredcaster::calculateIrradiance() {
|
||||
ZoneScoped
|
||||
|
||||
|
||||
glFramebufferTexture(
|
||||
GL_FRAMEBUFFER,
|
||||
GL_COLOR_ATTACHMENT0,
|
||||
@@ -678,7 +678,7 @@ void AtmosphereDeferredcaster::calculateInscattering(GLuint deltaSRayleigh,
|
||||
GLuint deltaSMie)
|
||||
{
|
||||
ZoneScoped
|
||||
|
||||
|
||||
glFramebufferTexture(
|
||||
GL_FRAMEBUFFER,
|
||||
GL_COLOR_ATTACHMENT0,
|
||||
@@ -726,7 +726,7 @@ void AtmosphereDeferredcaster::calculateDeltaJ(int scatteringOrder,
|
||||
GLuint deltaSRayleigh, GLuint deltaSMie)
|
||||
{
|
||||
ZoneScoped
|
||||
|
||||
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, deltaJ, 0);
|
||||
glViewport(0, 0, _textureSize.x, _textureSize.y);
|
||||
program.activate();
|
||||
@@ -745,7 +745,7 @@ void AtmosphereDeferredcaster::calculateDeltaJ(int scatteringOrder,
|
||||
deltaSRayleighUnit.activate();
|
||||
glBindTexture(GL_TEXTURE_3D, deltaSRayleigh);
|
||||
program.setUniform("deltaSRTexture", deltaSRayleighUnit);
|
||||
|
||||
|
||||
ghoul::opengl::TextureUnit deltaSMieUnit;
|
||||
deltaSMieUnit.activate();
|
||||
glBindTexture(GL_TEXTURE_3D, deltaSMie);
|
||||
@@ -784,7 +784,7 @@ void AtmosphereDeferredcaster::calculateDeltaE(int scatteringOrder,
|
||||
GLuint deltaSMie)
|
||||
{
|
||||
ZoneScoped
|
||||
|
||||
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, deltaE, 0);
|
||||
glViewport(0, 0, _deltaETableSize.x, _deltaETableSize.y);
|
||||
program.activate();
|
||||
@@ -823,7 +823,7 @@ void AtmosphereDeferredcaster::calculateDeltaS(int scatteringOrder,
|
||||
GLuint deltaSRayleigh, GLuint deltaJ)
|
||||
{
|
||||
ZoneScoped
|
||||
|
||||
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, deltaSRayleigh, 0);
|
||||
glViewport(0, 0, _textureSize.x, _textureSize.y);
|
||||
program.activate();
|
||||
@@ -863,7 +863,7 @@ void AtmosphereDeferredcaster::calculateIrradiance(int scatteringOrder,
|
||||
GLuint deltaE)
|
||||
{
|
||||
ZoneScoped
|
||||
|
||||
|
||||
glFramebufferTexture(
|
||||
GL_FRAMEBUFFER,
|
||||
GL_COLOR_ATTACHMENT0,
|
||||
@@ -895,7 +895,7 @@ void AtmosphereDeferredcaster::calculateInscattering(int scatteringOrder,
|
||||
|
||||
{
|
||||
ZoneScoped
|
||||
|
||||
|
||||
glFramebufferTexture(
|
||||
GL_FRAMEBUFFER,
|
||||
GL_COLOR_ATTACHMENT0,
|
||||
|
||||
@@ -114,9 +114,9 @@ private:
|
||||
|
||||
UniformCache(cullAtmosphere, Rg, Rt, groundRadianceEmission, HR, betaRayleigh, HM,
|
||||
betaMieExtinction, mieG, sunRadiance, ozoneLayerEnabled, HO, betaOzoneExtinction,
|
||||
SAMPLES_R, SAMPLES_MU, SAMPLES_MU_S, SAMPLES_NU, inverseModelTransformMatrix,
|
||||
SAMPLES_R, SAMPLES_MU, SAMPLES_MU_S, SAMPLES_NU, inverseModelTransformMatrix,
|
||||
modelTransformMatrix, projectionToModelTransform, viewToWorldMatrix,
|
||||
camPosObj, sunDirectionObj, hardShadows, transmittanceTexture, irradianceTexture,
|
||||
camPosObj, sunDirectionObj, hardShadows, transmittanceTexture, irradianceTexture,
|
||||
inscatterTexture) _uniformCache;
|
||||
|
||||
ghoul::opengl::TextureUnit _transmittanceTableTextureUnit;
|
||||
|
||||
@@ -649,8 +649,8 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
|
||||
|
||||
// Model transform and view transform needs to be in double precision
|
||||
const glm::dmat4 modelTransform =
|
||||
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation
|
||||
glm::dmat4(data.modelTransform.rotation) * // Spice rotation
|
||||
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) *
|
||||
glm::dmat4(data.modelTransform.rotation) *
|
||||
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)) *
|
||||
glm::scale(
|
||||
glm::dmat4(_modelTransform.value()),
|
||||
@@ -770,8 +770,9 @@ void RenderableModel::update(const UpdateData& data) {
|
||||
// be converted to the animation time range, so the animation knows which
|
||||
// keyframes it should interpolate between for each frame. The conversion is
|
||||
// done in different ways depending on the animation mode.
|
||||
// Explanation: s indicates start time, / indicates animation is played once forwards,
|
||||
// \ indicates animation is played once backwards, time moves to the right.
|
||||
// Explanation: s indicates start time, / indicates animation is played once
|
||||
// forwards, \ indicates animation is played once backwards, time moves to the
|
||||
// right.
|
||||
switch (_animationMode) {
|
||||
case AnimationMode::LoopFromStart:
|
||||
// Start looping from the start time
|
||||
|
||||
@@ -329,7 +329,12 @@ void RenderablePrism::render(const RenderData& data, RendererTasks&) {
|
||||
glLineWidth(_lineWidth);
|
||||
glBindVertexArray(_vaoId);
|
||||
|
||||
glDrawElements(GL_LINE_LOOP, static_cast<GLsizei>(_indexArray.size()), GL_UNSIGNED_BYTE, nullptr);
|
||||
glDrawElements(
|
||||
GL_LINE_LOOP,
|
||||
static_cast<GLsizei>(_indexArray.size()),
|
||||
GL_UNSIGNED_BYTE,
|
||||
nullptr
|
||||
);
|
||||
|
||||
glBindVertexArray(0);
|
||||
global::renderEngine->openglStateCache().resetLineState();
|
||||
|
||||
@@ -151,7 +151,7 @@ int renderCameraPath(lua_State* L) {
|
||||
};
|
||||
|
||||
auto addDirectionLine = [addPoint, addLineBetweenPoints]
|
||||
(const std::string& pointId, const CameraPose& p,
|
||||
(const std::string& pointId, const CameraPose& p,
|
||||
double lineLength)
|
||||
{
|
||||
const glm::dvec3 dir = glm::normalize(p.rotation * glm::dvec3(0.0, 0.0, -1.0));
|
||||
@@ -291,7 +291,7 @@ int removePathControlPoints(lua_State* L) {
|
||||
int addCartesianAxes(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, { 1, 2 }, "lua::addCartesianAxes");
|
||||
|
||||
auto [nodeIdentifier, scale] =
|
||||
auto [nodeIdentifier, scale] =
|
||||
ghoul::lua::values<std::string, std::optional<double>>(L);
|
||||
|
||||
SceneGraphNode* n = global::renderEngine->scene()->sceneGraphNode(nodeIdentifier);
|
||||
|
||||
@@ -557,7 +557,7 @@ void createExoplanetSystem(const std::string& starName) {
|
||||
|
||||
int addExoplanetSystem(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::addExoplanetSystem");
|
||||
std::variant<std::string, ghoul::Dictionary> v =
|
||||
std::variant<std::string, ghoul::Dictionary> v =
|
||||
ghoul::lua::value<std::variant<std::string, ghoul::Dictionary>>(L);
|
||||
|
||||
if (std::holds_alternative<std::string>(v)) {
|
||||
|
||||
@@ -462,7 +462,7 @@ void ConstructOctreeTask::constructOctreeFromFolder(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::vector<float> filterValues;
|
||||
auto writeThreads = std::vector<std::thread>(8);
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ void ReadFitsTask::readAllFitsFilesFromFolder(const Task::ProgressCallback&) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
size_t nInputFiles = allInputFiles.size();
|
||||
LINFO("Files to read: " + std::to_string(nInputFiles));
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace {
|
||||
struct [[codegen::Dictionary(ReadSpeckTask)]] Parameters {
|
||||
// The path to the SPECK file that are to be read
|
||||
std::string inFilePath;
|
||||
|
||||
|
||||
// The path to the file to export raw VBO data to
|
||||
std::string outFilePath;
|
||||
};
|
||||
|
||||
@@ -406,7 +406,7 @@ scripting::LuaLibrary GlobeBrowsingModule::luaLibrary() const {
|
||||
{
|
||||
// @TODO (2021-06-23, emmbr) Combine with the above function when the camera
|
||||
// paths work really well close to surfaces
|
||||
"flyToGeo",
|
||||
"flyToGeo",
|
||||
&globebrowsing::luascriptfunctions::flyToGeo,
|
||||
{},
|
||||
"[string], number, number, number [, bool, number]",
|
||||
|
||||
@@ -301,9 +301,8 @@ int flyToGeo(lua_State* L) {
|
||||
altitude
|
||||
);
|
||||
|
||||
using namespace std::string_literals;
|
||||
ghoul::Dictionary instruction;
|
||||
instruction.setValue("TargetType", "Node"s);
|
||||
instruction.setValue("TargetType", std::string("Node"));
|
||||
instruction.setValue("Target", n->identifier());
|
||||
instruction.setValue("Position", positionModelCoords);
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ GlobeTranslation::GlobeTranslation(const ghoul::Dictionary& dictionary)
|
||||
|
||||
_altitude = p.altitude.value_or(_altitude);
|
||||
// @TODO (emmbr) uncomment when ranges with negative values are supported
|
||||
//_altitude.setExponent(8.f);
|
||||
//_altitude.setExponent(8.f);
|
||||
_altitude.onChange([this]() { setUpdateVariables(); });
|
||||
addProperty(_altitude);
|
||||
|
||||
@@ -171,7 +171,7 @@ glm::dvec3 GlobeTranslation::position(const UpdateData&) const {
|
||||
const_cast<GlobeTranslation*>(this)->fillAttachedNode();
|
||||
_positionIsDirty = true;
|
||||
}
|
||||
|
||||
|
||||
if (!_positionIsDirty) {
|
||||
return _position;
|
||||
}
|
||||
|
||||
@@ -1209,8 +1209,8 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
|
||||
if (global::sessionRecording->isSavingFramesDuringPlayback()) {
|
||||
// If our tile cache is very full, we assume we need to adjust the level of detail
|
||||
// dynamically to not keep rendering frames with unavailable data
|
||||
// After certain number of iterations(_debugProperties.dynamicLodIterationCount) of
|
||||
// unavailable/available data in a row, we assume that a change could be made.
|
||||
// After certain number of iterations(_debugProperties.dynamicLodIterationCount)
|
||||
// of unavailable/available data in a row, we assume that a change could be made.
|
||||
const int iterCount = _debugProperties.dynamicLodIterationCount;
|
||||
const bool exceededIterations =
|
||||
static_cast<int>(_iterationsOfUnavailableData) > iterCount;
|
||||
|
||||
@@ -64,7 +64,8 @@ namespace {
|
||||
"modelViewProjectionMatrix", "textureOffset", "colorFilterValue", "nightFactor",
|
||||
"sunPosition", "sunPositionObj", "camPositionObj", "ringTextureFwrd",
|
||||
"ringTextureBckwrd", "ringTextureUnlit", "ringTextureColor",
|
||||
"ringTextureTransparency", "shadowMatrix", "shadowMapTexture", "zFightingPercentage"
|
||||
"ringTextureTransparency", "shadowMatrix", "shadowMapTexture",
|
||||
"zFightingPercentage"
|
||||
};
|
||||
|
||||
constexpr const std::array<const char*, 3> GeomUniformNames = {
|
||||
@@ -413,7 +414,10 @@ void RingsComponent::draw(const RenderData& data, RenderPass renderPass,
|
||||
modelViewProjectionTransform
|
||||
);
|
||||
_shader->setUniform(_uniformCacheAdvancedRings.textureOffset, _offset);
|
||||
_shader->setUniform(_uniformCacheAdvancedRings.colorFilterValue, _colorFilter);
|
||||
_shader->setUniform(
|
||||
_uniformCacheAdvancedRings.colorFilterValue,
|
||||
_colorFilter
|
||||
);
|
||||
_shader->setUniform(_uniformCacheAdvancedRings.nightFactor, _nightFactor);
|
||||
_shader->setUniform(_uniformCacheAdvancedRings.sunPosition, _sunPosition);
|
||||
|
||||
@@ -496,7 +500,10 @@ void RingsComponent::draw(const RenderData& data, RenderPass renderPass,
|
||||
ghoul::opengl::TextureUnit shadowMapUnit;
|
||||
shadowMapUnit.activate();
|
||||
glBindTexture(GL_TEXTURE_2D, shadowData.shadowDepthTexture);
|
||||
_shader->setUniform(_uniformCacheAdvancedRings.shadowMapTexture, shadowMapUnit);
|
||||
_shader->setUniform(
|
||||
_uniformCacheAdvancedRings.shadowMapTexture,
|
||||
shadowMapUnit
|
||||
);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnablei(GL_BLEND, 0);
|
||||
|
||||
@@ -171,7 +171,7 @@ ShadowComponent::ShadowComponent(const ghoul::Dictionary& dictionary)
|
||||
return;
|
||||
}
|
||||
ghoul::Dictionary d = dictionary.value<ghoul::Dictionary>("Shadows");
|
||||
|
||||
|
||||
const Parameters p = codegen::bake<Parameters>(d);
|
||||
|
||||
addProperty(_enabled);
|
||||
|
||||
@@ -868,7 +868,7 @@ TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary)
|
||||
useFixedTime = dictionary.value<bool>(temporal::UseFixedTimeInfo.identifier);
|
||||
}
|
||||
addProperty(useFixedTime);
|
||||
|
||||
|
||||
if (dictionary.hasValue<std::string>(temporal::FixedTimeInfo.identifier)) {
|
||||
fixedTime = dictionary.value<std::string>(temporal::FixedTimeInfo.identifier);
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_MODULE_IMGUI___GUISHORTCUTSCOMPONENT___H__
|
||||
#define __OPENSPACE_MODULE_IMGUI___GUISHORTCUTSCOMPONENT___H__
|
||||
#ifndef __OPENSPACE_MODULE_IMGUI___GUIACTIONCOMPONENT___H__
|
||||
#define __OPENSPACE_MODULE_IMGUI___GUIACTIONCOMPONENT___H__
|
||||
|
||||
#include <modules/imgui/include/guicomponent.h>
|
||||
|
||||
@@ -38,4 +38,4 @@ public:
|
||||
|
||||
} // namespace openspace::gui
|
||||
|
||||
#endif // __OPENSPACE_MODULE_IMGUI___GUISHORTCUTSCOMPONENT___H__
|
||||
#endif // __OPENSPACE_MODULE_IMGUI___GUIACTIONCOMPONENT___H__
|
||||
|
||||
@@ -270,7 +270,10 @@ void renderStringProperty(Property* prop, const std::string& ownerName,
|
||||
void renderListProperty(const std::string& name, const std::string& fullIdentifier,
|
||||
const std::string& stringValue, IsRegularProperty isRegular)
|
||||
{
|
||||
ghoul_assert(stringValue.size() > 2, "an empty list should have the string value '[]'");
|
||||
ghoul_assert(
|
||||
stringValue.size() > 2,
|
||||
"an empty list should have the string value '[]'"
|
||||
);
|
||||
|
||||
// Remove brackets from the string value
|
||||
std::string value = stringValue.substr(1, stringValue.size() - 2);
|
||||
|
||||
@@ -529,35 +529,35 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
|
||||
_dataMapping.bvColor = p.dataMapping.bv.value_or("");
|
||||
_dataMapping.bvColor.onChange([this]() { _dataIsDirty = true; });
|
||||
_dataMappingContainer.addProperty(_dataMapping.bvColor);
|
||||
|
||||
|
||||
_dataMapping.luminance = p.dataMapping.luminance.value_or("");
|
||||
_dataMapping.luminance.onChange([this]() { _dataIsDirty = true; });
|
||||
_dataMappingContainer.addProperty(_dataMapping.luminance);
|
||||
|
||||
|
||||
_dataMapping.absoluteMagnitude = p.dataMapping.absoluteMagnitude.value_or("");
|
||||
_dataMapping.absoluteMagnitude.onChange([this]() { _dataIsDirty = true; });
|
||||
_dataMappingContainer.addProperty(_dataMapping.absoluteMagnitude);
|
||||
|
||||
|
||||
_dataMapping.apparentMagnitude = p.dataMapping.apparentMagnitude.value_or("");
|
||||
_dataMapping.apparentMagnitude.onChange([this]() { _dataIsDirty = true; });
|
||||
_dataMappingContainer.addProperty(_dataMapping.apparentMagnitude);
|
||||
|
||||
|
||||
_dataMapping.vx = p.dataMapping.vx.value_or("");
|
||||
_dataMapping.vx.onChange([this]() { _dataIsDirty = true; });
|
||||
_dataMappingContainer.addProperty(_dataMapping.vx);
|
||||
|
||||
|
||||
_dataMapping.vy = p.dataMapping.vy.value_or("");
|
||||
_dataMapping.vy.onChange([this]() { _dataIsDirty = true; });
|
||||
_dataMappingContainer.addProperty(_dataMapping.vy);
|
||||
|
||||
|
||||
_dataMapping.vz = p.dataMapping.vz.value_or("");
|
||||
_dataMapping.vz.onChange([this]() { _dataIsDirty = true; });
|
||||
_dataMappingContainer.addProperty(_dataMapping.vz);
|
||||
|
||||
|
||||
_dataMapping.speed = p.dataMapping.speed.value_or("");
|
||||
_dataMapping.speed.onChange([this]() { _dataIsDirty = true; });
|
||||
_dataMappingContainer.addProperty(_dataMapping.speed);
|
||||
|
||||
|
||||
addPropertySubOwner(_dataMappingContainer);
|
||||
|
||||
_speckFile = p.speckFile.string();
|
||||
|
||||
@@ -172,7 +172,7 @@ Dataset loadFile(std::filesystem::path path, SkipAllZeroLines skipAllZeroLines)
|
||||
if (startsWith(line, "datavar")) {
|
||||
// each datavar line is following the form:
|
||||
// datavar <idx> <description>
|
||||
// with <idx> being the index of the data variable
|
||||
// with <idx> being the index of the data variable
|
||||
|
||||
std::stringstream str(line);
|
||||
std::string dummy;
|
||||
@@ -197,7 +197,7 @@ Dataset loadFile(std::filesystem::path path, SkipAllZeroLines skipAllZeroLines)
|
||||
std::stringstream str(line);
|
||||
std::string dummy;
|
||||
str >> dummy >> res.textureDataIndex;
|
||||
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -216,8 +216,8 @@ Dataset loadFile(std::filesystem::path path, SkipAllZeroLines skipAllZeroLines)
|
||||
std::stringstream str(line);
|
||||
std::string dummy;
|
||||
str >> dummy >> res.orientationDataIndex;
|
||||
|
||||
// Ok.. this is kind of weird. Speck unfortunately doesn't tell us in the
|
||||
|
||||
// Ok.. this is kind of weird. Speck unfortunately doesn't tell us in the
|
||||
// specification how many values a datavar has. Usually this is 1 value per
|
||||
// datavar, unless it is a polygon orientation thing. Now, the datavar name
|
||||
// for these can be anything (have seen 'orientation' and 'ori' before, so we
|
||||
@@ -268,7 +268,7 @@ Dataset loadFile(std::filesystem::path path, SkipAllZeroLines skipAllZeroLines)
|
||||
return lhs.index < rhs.index;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
std::sort(
|
||||
res.textures.begin(), res.textures.end(),
|
||||
[](const Dataset::Texture& lhs, const Dataset::Texture& rhs) {
|
||||
@@ -292,7 +292,7 @@ Dataset loadFile(std::filesystem::path path, SkipAllZeroLines skipAllZeroLines)
|
||||
if (line.back() == '\r') {
|
||||
line = line.substr(0, line.length() - 1);
|
||||
}
|
||||
|
||||
|
||||
strip(line);
|
||||
|
||||
if (line.empty()) {
|
||||
@@ -357,7 +357,7 @@ std::optional<Dataset> loadCachedFile(std::filesystem::path path) {
|
||||
if (!file.good()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
|
||||
Dataset result;
|
||||
|
||||
int8_t fileVersion;
|
||||
@@ -394,7 +394,7 @@ std::optional<Dataset> loadCachedFile(std::filesystem::path path) {
|
||||
result.textures.resize(nTextures);
|
||||
for (int i = 0; i < nTextures; i += 1) {
|
||||
Dataset::Texture tex;
|
||||
|
||||
|
||||
int16_t idx;
|
||||
file.read(reinterpret_cast<char*>(&idx), sizeof(int16_t));
|
||||
tex.index = idx;
|
||||
@@ -784,7 +784,7 @@ ColorMap loadFile(std::filesystem::path path, SkipAllZeroLines) {
|
||||
if (nColorLines == -1) {
|
||||
// This is the first time we get this far, it will have to be the first number
|
||||
// meaning that it is the number of color values
|
||||
|
||||
|
||||
str >> nColorLines;
|
||||
res.entries.reserve(nColorLines);
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary)
|
||||
|
||||
_alwaysDrawFov = p.alwaysDrawFov.value_or(_alwaysDrawFov);
|
||||
addProperty(_alwaysDrawFov);
|
||||
|
||||
|
||||
_simplifyBounds = p.simplifyBounds.value_or(_simplifyBounds);
|
||||
|
||||
addProperty(_colors.defaultStart);
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace {
|
||||
};
|
||||
|
||||
constexpr const std::array<const char*, 6> FboUniformNames = {
|
||||
"projectionTexture", "ProjectorMatrix", "ModelTransform",
|
||||
"projectionTexture", "ProjectorMatrix", "ModelTransform",
|
||||
"boresight", "radius", "segments"
|
||||
};
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ class SequenceParser;
|
||||
* large image data-sets across all openspace renderable instances, both for past and
|
||||
* future unmanned-spacecraft missions. To load the instance with data the client must
|
||||
* provide a parser inherited from the abstract base class SequenceParser. Hence, there is
|
||||
* no restriction imposed on data input, whether its data in the form of existing images or
|
||||
* in the form of a planned observation schedule. Notably, in order for the sequencer to
|
||||
* function the client must provide or write a parser that fills the ImageSequencers
|
||||
* no restriction imposed on data input, whether its data in the form of existing images
|
||||
* or in the form of a planned observation schedule. Notably, in order for the sequencer
|
||||
* to function the client must provide or write a parser that fills the ImageSequencers
|
||||
* private members.
|
||||
*
|
||||
* \see SequenceParser
|
||||
@@ -136,7 +136,7 @@ private:
|
||||
void sortData();
|
||||
|
||||
/**
|
||||
* This handles any types of ambiguities between the data and SPICE calls. This map is
|
||||
* This handles any types of ambiguities between the data and SPICE calls. This map is
|
||||
* composed of a key that is a string in the data to be translated and a Decoder that
|
||||
* holds the corresponding translation provided through as asset.
|
||||
* \see Decoder
|
||||
@@ -179,7 +179,7 @@ private:
|
||||
std::string _defaultCaptureImage;
|
||||
|
||||
std::map<std::string, Image> _latestImages;
|
||||
|
||||
|
||||
// if no data, no run
|
||||
bool _hasData = false;
|
||||
};
|
||||
|
||||
@@ -109,8 +109,8 @@ namespace {
|
||||
InstrumentTimes [[codegen::key("instrument-times")]],
|
||||
ImageAndInstrumentTimes [[codegen::key("image-and-instrument-times")]]
|
||||
};
|
||||
// This value determines which type of sequencer is used for generating image
|
||||
// schedules. The 'playbook' is using a custom format designed by the New Horizons
|
||||
// This value determines which type of sequencer is used for generating image
|
||||
// schedules. The 'playbook' is using a custom format designed by the New Horizons
|
||||
// team, the 'image-sequence' uses lbl files from a directory, and the 'hybrid'
|
||||
// uses both methods
|
||||
std::optional<Type> sequenceType;
|
||||
@@ -128,7 +128,7 @@ namespace {
|
||||
// SPICE integer
|
||||
std::string target [[codegen::annotation("A SPICE name of the observed object")]];
|
||||
|
||||
// The aberration correction that is supposed to be used for the projection. The
|
||||
// The aberration correction that is supposed to be used for the projection. The
|
||||
// values for the correction correspond to the SPICE definition as described in
|
||||
// ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/IDL/cspice/spkezr_c.html
|
||||
std::string aberration [[codegen::inlist("NONE", "LT", "LT+S", "CN", "CN+S",
|
||||
@@ -137,18 +137,18 @@ namespace {
|
||||
// The list of potential targets that are involved with the image projection
|
||||
std::optional<std::vector<std::string>> potentialTargets;
|
||||
|
||||
// Determines whether the object requires a self-shadowing algorithm. This is
|
||||
// necessary if the object is concave and might cast a shadow on itself during
|
||||
// Determines whether the object requires a self-shadowing algorithm. This is
|
||||
// necessary if the object is concave and might cast a shadow on itself during
|
||||
// presentation. The default value is 'false'
|
||||
std::optional<bool> textureMap;
|
||||
|
||||
// Determines whether the object requires a self-shadowing algorithm. This is
|
||||
// necessary if the object is concave and might cast a shadow on itself during
|
||||
// Determines whether the object requires a self-shadowing algorithm. This is
|
||||
// necessary if the object is concave and might cast a shadow on itself during
|
||||
// presentation. The default value is 'false'
|
||||
std::optional<bool> shadowMap;
|
||||
|
||||
// Sets the desired aspect ratio of the projected texture. This might be necessary
|
||||
// as planets usually have 2x1 aspect ratios, whereas this does not hold for
|
||||
// Sets the desired aspect ratio of the projected texture. This might be necessary
|
||||
// as planets usually have 2x1 aspect ratios, whereas this does not hold for
|
||||
// non-planet objects (comets, asteroids, etc). The default value is '1.0'
|
||||
std::optional<float> aspectRatio;
|
||||
|
||||
|
||||
@@ -194,7 +194,8 @@ scripting::LuaLibrary StateMachineModule::luaLibrary() const {
|
||||
&luascriptfunctions::printCurrentStateInfo,
|
||||
{},
|
||||
"",
|
||||
"Prints information about the current state and possible transitions to the log."
|
||||
"Prints information about the current state and possible transitions to the "
|
||||
"log."
|
||||
},
|
||||
{
|
||||
"saveToDotFile",
|
||||
|
||||
@@ -49,22 +49,22 @@ namespace {
|
||||
// provided, all files will be downloaded to the same directory
|
||||
std::variant<std::string, std::vector<std::string>> url;
|
||||
|
||||
// This optional identifier will be part of the used folder structure and, if
|
||||
// This optional identifier will be part of the used folder structure and, if
|
||||
// provided, can be used to manually find the downloaded folder in the
|
||||
// synchronization folder. If this value is not specified, 'UseHash' has to be set
|
||||
// to 'true'
|
||||
std::optional<std::string> identifier;
|
||||
|
||||
// If this value is set to 'true' and it is not overwritten by the global
|
||||
// settings, the file(s) pointed to by this URLSynchronization will always be
|
||||
// downloaded, thus overwriting the local files. This is useful for files that are
|
||||
// settings, the file(s) pointed to by this URLSynchronization will always be
|
||||
// downloaded, thus overwriting the local files. This is useful for files that are
|
||||
// updated regularly remotely and should be fetch at every startup
|
||||
std::optional<bool> forceOverride [[codegen::key("override")]];
|
||||
|
||||
// If this value is set to 'true' (the default), the hash of the URL is appended
|
||||
// to the directory name to produce a unique directory under all circumstances. If
|
||||
// to the directory name to produce a unique directory under all circumstances. If
|
||||
// this is not desired, the URLSynchronization use the bare directory name alone
|
||||
// if this value is 'false'. If this value is 'false', the identifier has to be
|
||||
// if this value is 'false'. If this value is 'false', the identifier has to be
|
||||
// specified
|
||||
std::optional<bool> useHash;
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace {
|
||||
// actual time. The default value is 0
|
||||
std::optional<float> secondsBefore;
|
||||
|
||||
// Specifies the number of seconds to show the the last timestep after its
|
||||
// Specifies the number of seconds to show the the last timestep after its
|
||||
// actual time
|
||||
float secondsAfter;
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ std::string GenerateRawVolumeTask::description() {
|
||||
"value by evaluating the lua function: `{}`, with three arguments (x, y, z) "
|
||||
"ranging from ({}, {}, {}) to ({}, {}, {}). Write raw volume data into {} and "
|
||||
"dictionary with metadata to {}",
|
||||
_dimensions.x, _dimensions.y, _dimensions.z, _valueFunctionLua,
|
||||
_dimensions.x, _dimensions.y, _dimensions.z, _valueFunctionLua,
|
||||
_lowerDomainBound.x, _lowerDomainBound.y, _lowerDomainBound.z,
|
||||
_upperDomainBound.x, _upperDomainBound.y, _upperDomainBound.z,
|
||||
_rawVolumeOutputPath, _dictionaryOutputPath
|
||||
|
||||
@@ -462,7 +462,7 @@ TestResult TemplateVerifier<glm::ivec2>::operator()(const ghoul::Dictionary& dic
|
||||
o.offender = key;
|
||||
o.reason = TestResult::Offense::Reason::MissingKey;
|
||||
res.offenses.push_back(o);
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -498,7 +498,7 @@ TestResult TemplateVerifier<glm::ivec3>::operator()(const ghoul::Dictionary& dic
|
||||
o.offender = key;
|
||||
o.reason = TestResult::Offense::Reason::WrongType;
|
||||
res.offenses.push_back(o);
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -508,7 +508,7 @@ TestResult TemplateVerifier<glm::ivec3>::operator()(const ghoul::Dictionary& dic
|
||||
o.offender = key;
|
||||
o.reason = TestResult::Offense::Reason::WrongType;
|
||||
res.offenses.push_back(o);
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -565,7 +565,7 @@ TestResult TemplateVerifier<glm::ivec4>::operator()(const ghoul::Dictionary& dic
|
||||
o.offender = key;
|
||||
o.reason = TestResult::Offense::Reason::WrongType;
|
||||
res.offenses.push_back(o);
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -575,7 +575,7 @@ TestResult TemplateVerifier<glm::ivec4>::operator()(const ghoul::Dictionary& dic
|
||||
o.offender = key;
|
||||
o.reason = TestResult::Offense::Reason::MissingKey;
|
||||
res.offenses.push_back(o);
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ ghoul::Dictionary toParameter(const Event& e) {
|
||||
case EventParallelConnection::State::Lost:
|
||||
d.setValue("State", "Lost"s);
|
||||
break;
|
||||
case EventParallelConnection::State::HostshipGained:
|
||||
case EventParallelConnection::State::HostshipGained:
|
||||
d.setValue("State", "HostshipGained"s);
|
||||
break;
|
||||
case EventParallelConnection::State::HostshipLost:
|
||||
|
||||
@@ -200,7 +200,7 @@ int actions(lua_State* L) {
|
||||
action.synchronization == interaction::Action::IsSynchronized::Yes
|
||||
);
|
||||
lua_settable(L, -3);
|
||||
|
||||
|
||||
lua_settable(L, -3);
|
||||
}
|
||||
|
||||
|
||||
@@ -1979,9 +1979,13 @@ bool SessionRecording::processCameraKeyframe(double now) {
|
||||
}
|
||||
|
||||
// getPrevTimestamp();
|
||||
double prevTime = appropriateTimestamp(_timeline[_idxTimeline_cameraPtrPrev].t3stamps);
|
||||
double prevTime = appropriateTimestamp(
|
||||
_timeline[_idxTimeline_cameraPtrPrev].t3stamps
|
||||
);
|
||||
// getNextTimestamp();
|
||||
double nextTime = appropriateTimestamp(_timeline[_idxTimeline_cameraPtrNext].t3stamps);
|
||||
double nextTime = appropriateTimestamp(
|
||||
_timeline[_idxTimeline_cameraPtrNext].t3stamps
|
||||
);
|
||||
|
||||
double t;
|
||||
if ((nextTime - prevTime) < 1e-7) {
|
||||
|
||||
@@ -215,7 +215,7 @@ void NavigationHandler::applyNavigationState(const NavigationState& ns) {
|
||||
|
||||
void NavigationHandler::updateCameraTransitions() {
|
||||
// This function is concerned with managing transitions of the camera between
|
||||
// different distances of interest relative to the focus node. For each transition two
|
||||
// different distances of interest relative to the focus node. For each transition two
|
||||
// scenarios are handled; SceneGraphNodes can have attached actions for each
|
||||
// transition, which are automatically triggered. Additionally, an
|
||||
// EventCameraTransition event is fired that contains information about the focus node
|
||||
@@ -228,7 +228,7 @@ void NavigationHandler::updateCameraTransitions() {
|
||||
//
|
||||
// |<------------------->| Approach factor * Interaction sphere
|
||||
// |<------>| Reach Factor * Interaction sphere
|
||||
//
|
||||
//
|
||||
// ( ( O ) )
|
||||
// ^ ^ ^ ^
|
||||
// OnExit OnMoveAway OnReach OnApproach
|
||||
|
||||
@@ -217,7 +217,7 @@ int bindJoystickButton(lua_State* L) {
|
||||
actionStr = actionStr.value_or("Press");
|
||||
isRemote = isRemote.value_or(true);
|
||||
|
||||
interaction::JoystickAction action =
|
||||
interaction::JoystickAction action =
|
||||
ghoul::from_string<interaction::JoystickAction>(*actionStr);
|
||||
|
||||
global::navigationHandler->bindJoystickButtonCommand(
|
||||
|
||||
@@ -80,8 +80,8 @@ NavigationState::NavigationState(const ghoul::Dictionary& dictionary) {
|
||||
}
|
||||
|
||||
NavigationState::NavigationState(std::string anchor_, std::string aim_,
|
||||
std::string referenceFrame_, glm::dvec3 position_,
|
||||
std::optional<glm::dvec3> up_,
|
||||
std::string referenceFrame_, glm::dvec3 position_,
|
||||
std::optional<glm::dvec3> up_,
|
||||
double yaw_, double pitch_)
|
||||
: anchor(std::move(anchor_))
|
||||
, aim(std::move(aim_))
|
||||
|
||||
@@ -463,7 +463,9 @@ OrbitalNavigator::OrbitalNavigator()
|
||||
addPropertySubOwner(_linearFlight);
|
||||
addPropertySubOwner(_idleBehavior);
|
||||
|
||||
_idleBehaviorDampenInterpolator.setTransferFunction(ghoul::quadraticEaseInOut<double>);
|
||||
_idleBehaviorDampenInterpolator.setTransferFunction(
|
||||
ghoul::quadraticEaseInOut<double>
|
||||
);
|
||||
_idleBehavior.dampenInterpolationTime.onChange([&]() {
|
||||
_idleBehaviorDampenInterpolator.setInterpolationTime(
|
||||
_idleBehavior.dampenInterpolationTime
|
||||
@@ -1631,8 +1633,8 @@ void OrbitalNavigator::applyIdleBehavior(double deltaTime, glm::dvec3& position,
|
||||
break;
|
||||
case IdleBehavior::Behavior::OrbitAtConstantLat: {
|
||||
// Assume that "north" coincides with the local z-direction
|
||||
// @TODO (2021-07-09, emmbr) Make each scene graph node aware of its own
|
||||
// north/up, so that we can query this information rather than assuming it.
|
||||
// @TODO (2021-07-09, emmbr) Make each scene graph node aware of its own
|
||||
// north/up, so that we can query this information rather than assuming it.
|
||||
// The we could also combine this idle behavior with the next
|
||||
const glm::dvec3 north = glm::dvec3(0.0, 0.0, 1.0);
|
||||
orbitAroundAxis(north, deltaTime, position, globalRotation, speedScale);
|
||||
@@ -1672,14 +1674,14 @@ void OrbitalNavigator::orbitAnchor(double deltaTime, glm::dvec3& position,
|
||||
position += rotationDiffVec3;
|
||||
}
|
||||
|
||||
void OrbitalNavigator::orbitAroundAxis(const glm::dvec3 axis, double deltaTime,
|
||||
void OrbitalNavigator::orbitAroundAxis(const glm::dvec3 axis, double deltaTime,
|
||||
glm::dvec3& position, glm::dquat& globalRotation,
|
||||
double speedScale)
|
||||
{
|
||||
ghoul_assert(_anchorNode != nullptr, "Node to orbit must be set!");
|
||||
|
||||
const glm::dmat4 modelTransform = _anchorNode->modelTransform();
|
||||
const glm::dvec3 axisInWorldCoords =
|
||||
const glm::dvec3 axisInWorldCoords =
|
||||
glm::dmat3(modelTransform) * glm::normalize(axis);
|
||||
|
||||
// Compute rotation to be applied around the axis
|
||||
|
||||
@@ -59,7 +59,8 @@ namespace {
|
||||
// The desired duration traversing the specified path segment should take
|
||||
std::optional<float> duration;
|
||||
|
||||
// (Node): The target node of the camera path. Not optional for 'Node' instructions
|
||||
// (Node): The target node of the camera path. Not optional for 'Node'
|
||||
// instructions
|
||||
std::optional<std::string> target;
|
||||
|
||||
// (Node): An optional position in relation to the target node, in model
|
||||
@@ -271,9 +272,11 @@ double Path::speedAlongPath(double traveledDistance) const {
|
||||
speed *= remainingDistance / closeUpDistance + 0.01;
|
||||
}
|
||||
|
||||
// TODO: also dampen speed based on curvature, or make sure the curve has a rounder shape
|
||||
// TODO: also dampen speed based on curvature, or make sure the curve has a rounder
|
||||
// shape
|
||||
|
||||
// TODO: check for when path is shorter than the starUpDistance or closeUpDistance variables
|
||||
// TODO: check for when path is shorter than the starUpDistance or closeUpDistance
|
||||
// variables
|
||||
|
||||
return _speedFactorFromDuration * speed;
|
||||
}
|
||||
@@ -384,7 +387,9 @@ Waypoint computeWaypointFromNodeInfo(const NodeInfo& info, const Waypoint& start
|
||||
if (info.position.has_value()) {
|
||||
// The position in instruction is given in the targetNode's local coordinates.
|
||||
// Convert to world coordinates
|
||||
targetPos = glm::dvec3(targetNode->modelTransform() * glm::dvec4(*info.position, 1.0));
|
||||
targetPos = glm::dvec3(
|
||||
targetNode->modelTransform() * glm::dvec4(*info.position, 1.0)
|
||||
);
|
||||
}
|
||||
else {
|
||||
const double radius = Waypoint::findValidBoundingSphere(targetNode);
|
||||
|
||||
@@ -80,7 +80,8 @@ ZoomOutOverviewCurve::ZoomOutOverviewCurve(const Waypoint& start, const Waypoint
|
||||
goodStepDirection = glm::normalize(n1 + n2);
|
||||
}
|
||||
|
||||
// Find a direction that is orthogonal to the line between the start and end position
|
||||
// Find a direction that is orthogonal to the line between the start and end
|
||||
// position
|
||||
const glm::dvec3 startPosToEndPos = end.position() - start.position();
|
||||
const glm::dvec3 outwardStepVector =
|
||||
0.5 * glm::length(startPosToEndPos) * goodStepDirection;
|
||||
|
||||
@@ -72,7 +72,8 @@ namespace {
|
||||
"triggered once the path has reached its target."
|
||||
};
|
||||
|
||||
constexpr const openspace::properties::Property::PropertyInfo MinBoundingSphereInfo = {
|
||||
constexpr const openspace::properties::Property::PropertyInfo MinBoundingSphereInfo =
|
||||
{
|
||||
"MinimalValidBoundingSphere",
|
||||
"Minimal Valid Bounding Sphere",
|
||||
"The minimal allowed value for a bounding sphere, in meters. Used for "
|
||||
@@ -203,8 +204,10 @@ void PathNavigator::updateCamera(double deltaTime) {
|
||||
|
||||
if (_applyIdleBehaviorOnFinish) {
|
||||
constexpr const char* ApplyIdleBehaviorScript =
|
||||
"local f = 'NavigationHandler.OrbitalNavigator.IdleBehavior.ApplyIdleBehavior';"
|
||||
"openspace.setPropertyValueSingle(f, true);";
|
||||
"openspace.setPropertyValueSingle("
|
||||
"'NavigationHandler.OrbitalNavigator.IdleBehavior.ApplyIdleBehavior',"
|
||||
"true"
|
||||
");";
|
||||
|
||||
global::scriptEngine->queueScript(
|
||||
ApplyIdleBehaviorScript,
|
||||
|
||||
@@ -86,9 +86,8 @@ int goTo(lua_State* L) {
|
||||
return ghoul::lua::luaError(L, "Unknown node name: " + nodeIdentifier);
|
||||
}
|
||||
|
||||
using namespace std::string_literals;
|
||||
ghoul::Dictionary insDict;
|
||||
insDict.setValue("TargetType", "Node"s);
|
||||
insDict.setValue("TargetType", std::string("Node"));
|
||||
insDict.setValue("Target", nodeIdentifier);
|
||||
if (useUpFromTargetOrDuration.has_value()) {
|
||||
if (std::holds_alternative<bool>(*useUpFromTargetOrDuration)) {
|
||||
@@ -134,9 +133,8 @@ int goToHeight(lua_State* L) {
|
||||
return ghoul::lua::luaError(L, "Unknown node name: " + nodeIdentifier);
|
||||
}
|
||||
|
||||
using namespace std::string_literals;
|
||||
ghoul::Dictionary insDict;
|
||||
insDict.setValue("TargetType", "Node"s);
|
||||
insDict.setValue("TargetType", std::string("Node"));
|
||||
insDict.setValue("Target", nodeIdentifier);
|
||||
insDict.setValue("Height", height);
|
||||
if (useUpFromTargetOrDuration.has_value()) {
|
||||
@@ -190,9 +188,8 @@ int goToNavigationState(lua_State* L) {
|
||||
);
|
||||
}
|
||||
|
||||
using namespace std::string_literals;
|
||||
ghoul::Dictionary instruction;
|
||||
instruction.setValue("TargetType", "NavigationState"s);
|
||||
instruction.setValue("TargetType", std::string("NavigationState"));
|
||||
instruction.setValue("NavigationState", navigationState);
|
||||
|
||||
if (duration.has_value()) {
|
||||
|
||||
@@ -53,7 +53,7 @@ Waypoint::Waypoint(const glm::dvec3& pos, const glm::dquat& rot, const std::stri
|
||||
}
|
||||
|
||||
Waypoint::Waypoint(const NavigationState& ns) {
|
||||
const SceneGraphNode* anchorNode = sceneGraphNode(ns.anchor);
|
||||
const SceneGraphNode* anchorNode = sceneGraphNode(ns.anchor);
|
||||
|
||||
if (!anchorNode) {
|
||||
LERROR(fmt::format("Could not find node '{}' to target", ns.anchor));
|
||||
@@ -92,7 +92,7 @@ double Waypoint::validBoundingSphere() const {
|
||||
double Waypoint::findValidBoundingSphere(const SceneGraphNode* node) {
|
||||
double bs = static_cast<double>(node->boundingSphere());
|
||||
|
||||
const double minValidBoundingSphere =
|
||||
const double minValidBoundingSphere =
|
||||
global::navigationHandler->pathNavigator().minValidBoundingSphere();
|
||||
|
||||
if (bs < minValidBoundingSphere) {
|
||||
|
||||
@@ -458,7 +458,7 @@ std::pair<std::vector<Vertex>, std::vector<GLushort>> createSphere(int nSegments
|
||||
// 0 -> PI
|
||||
// azimuth angle (east to west)
|
||||
const float theta = fi * glm::pi<float>() / nSegments;
|
||||
|
||||
|
||||
// 0 -> 2*PI
|
||||
const float phi = fj * glm::pi<float>() * 2.f / nSegments;
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace {
|
||||
"Enabled Font Color",
|
||||
"The font color used for enabled options."
|
||||
};
|
||||
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo DisabledFontColorInfo = {
|
||||
"DisabledFontColor",
|
||||
"Disabled Font Color",
|
||||
@@ -399,7 +399,7 @@ RenderEngine::RenderEngine()
|
||||
|
||||
_enabledFontColor.setViewOption(openspace::properties::Property::ViewOptions::Color);
|
||||
addProperty(_enabledFontColor);
|
||||
|
||||
|
||||
_disabledFontColor.setViewOption(openspace::properties::Property::ViewOptions::Color);
|
||||
addProperty(_disabledFontColor);
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace {
|
||||
std::optional<float> opacity [[codegen::inrange(0.f, 1.f)]];
|
||||
|
||||
// Defines either a single or multiple tags that apply to this
|
||||
// ScreenSpaceRenderable, thus making it possible to address multiple, separate
|
||||
// ScreenSpaceRenderable, thus making it possible to address multiple, separate
|
||||
// Renderables with a single property change
|
||||
std::optional<std::variant<std::string, std::vector<std::string>>> tag;
|
||||
};
|
||||
|
||||
+4
-2
@@ -911,14 +911,16 @@ scripting::LuaLibrary Scene::luaLibrary() {
|
||||
&luascriptfunctions::worldPosition,
|
||||
{},
|
||||
"string",
|
||||
"Returns the world position of the scene graph node with the given string as identifier"
|
||||
"Returns the world position of the scene graph node with the given "
|
||||
"string as identifier"
|
||||
},
|
||||
{
|
||||
"worldRotation",
|
||||
& luascriptfunctions::worldRotation,
|
||||
{},
|
||||
"string",
|
||||
"Returns the world rotation matrix of the scene graph node with the given string as identifier"
|
||||
"Returns the world rotation matrix of the scene graph node with the "
|
||||
"given string as identifier"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -618,7 +618,7 @@ int addSceneGraphNode(lua_State* L) {
|
||||
d.value<std::string>("Identifier") :
|
||||
"Scene";
|
||||
LERRORC(cat, ghoul::to_string(e.result));
|
||||
|
||||
|
||||
return ghoul::lua::luaError(
|
||||
L,
|
||||
fmt::format("Error loading scene graph node: {}", e.what())
|
||||
|
||||
@@ -70,12 +70,30 @@ std::string SceneLicenseWriter::generateJson() const {
|
||||
constexpr const char* replStr = R"("{}": "{}", )";
|
||||
constexpr const char* replStr2 = R"("{}": "{}")";
|
||||
json << "{";
|
||||
json << fmt::format(replStr, "name", escapedJson(global::profile->meta->name.value()));
|
||||
json << fmt::format(replStr, "version", escapedJson(global::profile->meta->version.value()));
|
||||
json << fmt::format(replStr, "description", escapedJson(global::profile->meta->description.value()));
|
||||
json << fmt::format(replStr, "author", escapedJson(global::profile->meta->author.value()));
|
||||
json << fmt::format(replStr, "url", escapedJson(global::profile->meta->url.value()));
|
||||
json << fmt::format(replStr2, "license", escapedJson(global::profile->meta->license.value()));
|
||||
json << fmt::format(
|
||||
replStr,
|
||||
"name", escapedJson(global::profile->meta->name.value_or(""))
|
||||
);
|
||||
json << fmt::format(
|
||||
replStr,
|
||||
"version", escapedJson(global::profile->meta->version.value_or(""))
|
||||
);
|
||||
json << fmt::format(
|
||||
replStr,
|
||||
"description", escapedJson(global::profile->meta->description.value_or(""))
|
||||
);
|
||||
json << fmt::format(
|
||||
replStr,
|
||||
"author", escapedJson(global::profile->meta->author.value_or(""))
|
||||
);
|
||||
json << fmt::format(
|
||||
replStr,
|
||||
"url", escapedJson(global::profile->meta->url.value_or(""))
|
||||
);
|
||||
json << fmt::format(
|
||||
replStr2,
|
||||
"license", escapedJson(global::profile->meta->license.value_or(""))
|
||||
);
|
||||
json << "}";
|
||||
|
||||
if (++metaCount != metaTotal) {
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace {
|
||||
// executed instead
|
||||
std::string time;
|
||||
|
||||
// The Lua script that will be executed when the specified time is passed
|
||||
// The Lua script that will be executed when the specified time is passed
|
||||
// independent of its direction. This script will be executed before the
|
||||
// specific scripts if both versions are specified
|
||||
std::optional<std::string> script;
|
||||
|
||||
@@ -46,7 +46,7 @@ int loadFile(lua_State* L) {
|
||||
for (size_t i = 1; i <= scriptsDict.size(); ++i) {
|
||||
ghoul::Dictionary d = scriptsDict.value<ghoul::Dictionary>(std::to_string(i));
|
||||
|
||||
scripting::ScriptScheduler::ScheduledScript script =
|
||||
scripting::ScriptScheduler::ScheduledScript script =
|
||||
scripting::ScriptScheduler::ScheduledScript(d);
|
||||
scripts.push_back(script);
|
||||
}
|
||||
|
||||
+4
-4
@@ -93,9 +93,9 @@ std::string keyToString(KeyWithModifier keyWithModifier) {
|
||||
std::string modifier;
|
||||
if (keyWithModifier.modifier != KeyModifier::None) {
|
||||
for (const openspace::KeyModifierInfo& kmi : openspace::KeyModifierInfos) {
|
||||
// No need for an extra check for the empty modifier since that is mapped to 0,
|
||||
// meaning that the `hasKeyModifier` will always fail for it since it checks
|
||||
// internally against != 0
|
||||
// No need for an extra check for the empty modifier since that is mapped
|
||||
// to 0, meaning that the `hasKeyModifier` will always fail for it since it
|
||||
// checks internally against != 0
|
||||
|
||||
if (hasKeyModifier(keyWithModifier.modifier, kmi.modifier)) {
|
||||
modifier += fmt::format("{}+", kmi.identifier);
|
||||
@@ -126,7 +126,7 @@ std::string to_string(const openspace::Key& key) {
|
||||
return std::string(ki.name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace {
|
||||
struct [[codegen::Dictionary(ResourceSynchronization)]] Parameters {
|
||||
// This key specifies the type of ResourceSyncrhonization that gets created. It
|
||||
// has to be one of the valid ResourceSyncrhonizations that are available for
|
||||
// creation (see the FactoryDocumentation for a list of possible
|
||||
// creation (see the FactoryDocumentation for a list of possible
|
||||
// ResourceSyncrhonizations), which depends on the configration of the application
|
||||
std::string type
|
||||
[[codegen::annotation("A ResourceSynchronization created by a factory")]];
|
||||
|
||||
@@ -1377,20 +1377,22 @@ scripting::LuaLibrary SpiceManager::luaLibrary() {
|
||||
&luascriptfunctions::rotationMatrix,
|
||||
{},
|
||||
"{string, string, string}",
|
||||
"Returns the rotationMatrix for a given body in a frame of reference at a specific"
|
||||
"time. The first agument is the target body, the second is the frame of reference,"
|
||||
" the third is the time. Example: openspace.spice.rotationMatrix('"
|
||||
"INSIGHT_LANDER_CRUISE','MARS', '2018 NOV 26 19:45:34')."
|
||||
"Returns the rotationMatrix for a given body in a frame of reference at "
|
||||
"a specific time. The first agument is the target body, the second is "
|
||||
"the frame of reference, the third is the time. Example: "
|
||||
"openspace.spice.rotationMatrix('INSIGHT_LANDER_CRUISE','MARS',"
|
||||
"'2018 NOV 26 19:45:34')."
|
||||
},
|
||||
{
|
||||
"position",
|
||||
&luascriptfunctions::position,
|
||||
{},
|
||||
"{string, string, string, string}",
|
||||
"Returns the position for a target by an observer in a frame of reference at a specific"
|
||||
"time. The first agument is the target body, the second is the observer body, the third"
|
||||
"is the frame of reference, and the fourth is the time. Example: openspace.spice."
|
||||
"position('INSIGHT','MARS','GALACTIC', '2018 NOV 26 19:45:34')."
|
||||
"Returns the position for a target by an observer in a frame of "
|
||||
"reference at a specific time. The first agument is the target body, the "
|
||||
"second is the observer body, the third is the frame of reference, and "
|
||||
"the fourth is the time. Example: openspace.spice.position('INSIGHT',"
|
||||
"'MARS','GALACTIC', '2018 NOV 26 19:45:34')."
|
||||
},
|
||||
{
|
||||
"getSpiceBodies",
|
||||
|
||||
@@ -58,7 +58,7 @@ int loadKernel(lua_State* L) {
|
||||
*/
|
||||
int unloadKernel(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::unloadKernel");
|
||||
std::variant<std::string, unsigned int> argument =
|
||||
std::variant<std::string, unsigned int> argument =
|
||||
ghoul::lua::value<std::variant<std::string, unsigned int>>(L);
|
||||
|
||||
if (std::holds_alternative<std::string>(argument)) {
|
||||
@@ -161,7 +161,7 @@ int rotationMatrix(lua_State* L) {
|
||||
|
||||
/**
|
||||
* position({string, string, string, string}):
|
||||
* Returns the position for a given body relative to another body,
|
||||
* Returns the position for a given body relative to another body,
|
||||
* in a given frame of reference, at a specific time.
|
||||
*/
|
||||
int position(lua_State* L) {
|
||||
|
||||
@@ -227,7 +227,7 @@ int time_interpolateTogglePause(lua_State* L) {
|
||||
*/
|
||||
int time_pauseToggleViaKeyboard(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::time_pauseToggleViaKeyboard");
|
||||
|
||||
|
||||
if (global::sessionRecording->isPlayingBack()) {
|
||||
bool isPlaybackPaused = global::sessionRecording->isPlaybackPaused();
|
||||
global::sessionRecording->setPlaybackPause(!isPlaybackPaused);
|
||||
@@ -462,17 +462,17 @@ int time_advancedTime(lua_State* L) {
|
||||
|
||||
try {
|
||||
double value = std::stod(std::string(modifier.begin(), it));
|
||||
std::string unitName = std::string(it, modifier.end());
|
||||
std::string uName = std::string(it, modifier.end());
|
||||
|
||||
TimeUnit unit = TimeUnit::Second;
|
||||
if (unitName == "s") { unit = TimeUnit::Second; }
|
||||
else if (unitName == "m") { unit = TimeUnit::Minute; }
|
||||
else if (unitName == "h") { unit = TimeUnit::Hour; }
|
||||
else if (unitName == "d") { unit = TimeUnit::Day; }
|
||||
else if (unitName == "M") { unit = TimeUnit::Month; }
|
||||
else if (unitName == "y") { unit = TimeUnit::Year; }
|
||||
if (uName == "s") { unit = TimeUnit::Second; }
|
||||
else if (uName == "m") { unit = TimeUnit::Minute; }
|
||||
else if (uName == "h") { unit = TimeUnit::Hour; }
|
||||
else if (uName == "d") { unit = TimeUnit::Day; }
|
||||
else if (uName == "M") { unit = TimeUnit::Month; }
|
||||
else if (uName == "y") { unit = TimeUnit::Year; }
|
||||
else {
|
||||
return ghoul::lua::luaError(L, fmt::format("Unknown unit '{}'", unitName));
|
||||
return ghoul::lua::luaError(L, fmt::format("Unknown unit '{}'", uName));
|
||||
}
|
||||
|
||||
dt = convertTime(value, unit, TimeUnit::Second);
|
||||
|
||||
Reference in New Issue
Block a user