mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-05 10:59:47 -05:00
Merge pull request #1063 from OpenSpace/bug/macosbuild
macos compile and build (still needs ring shader const fix)
This commit is contained in:
@@ -78,7 +78,7 @@ ghoul::Dictionary NavigationHandler::NavigationState::dictionary() const {
|
||||
cameraDict.setValue(KeyAim, aim);
|
||||
}
|
||||
if (up.has_value()) {
|
||||
cameraDict.setValue(KeyUp, up.value());
|
||||
cameraDict.setValue(KeyUp, *up);
|
||||
|
||||
if (std::abs(yaw) > Epsilon) {
|
||||
cameraDict.setValue(KeyYaw, yaw);
|
||||
@@ -218,7 +218,7 @@ void NavigationHandler::updateCamera(double deltaTime) {
|
||||
ghoul_assert(_camera != nullptr, "Camera must not be nullptr");
|
||||
|
||||
if (_pendingNavigationState.has_value()) {
|
||||
applyNavigationState(_pendingNavigationState.value());
|
||||
applyNavigationState(*_pendingNavigationState);
|
||||
_orbitalNavigator.resetVelocities();
|
||||
_pendingNavigationState.reset();
|
||||
}
|
||||
@@ -274,7 +274,7 @@ void NavigationHandler::applyNavigationState(const NavigationHandler::Navigation
|
||||
glm::dvec3(referenceFrameTransform * glm::dvec4(ns.position, 1.0));
|
||||
|
||||
glm::dvec3 up = ns.up.has_value() ?
|
||||
glm::normalize(referenceFrameTransform * ns.up.value()) :
|
||||
glm::normalize(referenceFrameTransform * *ns.up) :
|
||||
glm::dvec3(0.0, 1.0, 0.0);
|
||||
|
||||
// Construct vectors of a "neutral" view, i.e. when the aim is centered in view.
|
||||
|
||||
@@ -101,7 +101,7 @@ int getNavigationState(lua_State* L) {
|
||||
|
||||
if (state.up.has_value()) {
|
||||
ghoul::lua::push(L, "Up");
|
||||
pushVector(L, state.up.value());
|
||||
pushVector(L, *state.up);
|
||||
lua_rawset(L, -3);
|
||||
}
|
||||
if (state.yaw != 0) {
|
||||
|
||||
@@ -424,7 +424,7 @@ void OrbitalNavigator::updateCameraStateFromStates(double deltaTime) {
|
||||
|
||||
const glm::dvec3 prevCameraPosition = _camera->positionVec3();
|
||||
const glm::dvec3 anchorDisplacement = _previousAnchorNodePosition.has_value() ?
|
||||
(anchorPos - _previousAnchorNodePosition.value()) :
|
||||
(anchorPos - *_previousAnchorNodePosition) :
|
||||
glm::dvec3(0.0);
|
||||
|
||||
CameraPose pose = {
|
||||
@@ -464,10 +464,10 @@ void OrbitalNavigator::updateCameraStateFromStates(double deltaTime) {
|
||||
if (_aimNode && _aimNode != _anchorNode && hasPreviousPositions) {
|
||||
const glm::dvec3 aimPos = _aimNode->worldPosition();
|
||||
const glm::dvec3 cameraToAnchor =
|
||||
_previousAnchorNodePosition.value() - prevCameraPosition;
|
||||
*_previousAnchorNodePosition - prevCameraPosition;
|
||||
|
||||
Displacement anchorToAim = {
|
||||
_previousAimNodePosition.value() - _previousAnchorNodePosition.value(),
|
||||
*_previousAimNodePosition - *_previousAnchorNodePosition,
|
||||
aimPos - anchorPos
|
||||
};
|
||||
|
||||
@@ -502,7 +502,7 @@ void OrbitalNavigator::updateCameraStateFromStates(double deltaTime) {
|
||||
glm::quat_cast(_anchorNode->worldRotationMatrix());
|
||||
|
||||
glm::dquat anchorNodeRotationDiff = _previousAnchorNodeRotation.has_value() ?
|
||||
_previousAnchorNodeRotation.value() * glm::inverse(anchorRotation) :
|
||||
*_previousAnchorNodeRotation * glm::inverse(anchorRotation) :
|
||||
glm::dquat(1.0, 0.0, 0.0, 0.0);
|
||||
|
||||
_previousAnchorNodeRotation = anchorRotation;
|
||||
|
||||
@@ -166,7 +166,7 @@ void LoadingScreen::render() {
|
||||
|
||||
const glm::vec2 dpiScaling = global::windowDelegate.dpiScaling();
|
||||
const glm::ivec2 res =
|
||||
glm::vec2(global::windowDelegate.currentSubwindowSize()) / dpiScaling;
|
||||
glm::vec2(global::windowDelegate.currentSubwindowSize()) * dpiScaling;
|
||||
|
||||
float screenAspectRatio = static_cast<float>(res.x) / static_cast<float>(res.y);
|
||||
|
||||
@@ -317,7 +317,6 @@ void LoadingScreen::render() {
|
||||
ProgressbarCenter.y + progressbarSize.y
|
||||
};
|
||||
|
||||
|
||||
for (Item& item : _items) {
|
||||
if (!item.hasLocation) {
|
||||
// Compute a new location
|
||||
|
||||
@@ -179,7 +179,7 @@ bool ScriptEngine::runScript(const std::string& script, ScriptCallback callback)
|
||||
if (callback) {
|
||||
ghoul::Dictionary returnValue =
|
||||
ghoul::lua::loadArrayDictionaryFromString(script, _state);
|
||||
callback.value()(returnValue);
|
||||
callback(returnValue);
|
||||
} else {
|
||||
ghoul::lua::runScript(_state, script);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ void VersionChecker::cancel() {
|
||||
}
|
||||
|
||||
VersionChecker::SemanticVersion VersionChecker::latestVersion() {
|
||||
return _latestVersion.value();
|
||||
return *_latestVersion;
|
||||
}
|
||||
|
||||
bool operator<(const VersionChecker::SemanticVersion a,
|
||||
|
||||
Reference in New Issue
Block a user