mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06:00
Automatic billboard orientation based on projection type.
This commit is contained in:
@@ -78,6 +78,7 @@ public:
|
||||
void sendMessageToExternalControl(const std::vector<char>& message) const override;
|
||||
|
||||
bool isSimpleRendering() const override;
|
||||
bool isFisheyeRendering() const override;
|
||||
|
||||
void takeScreenshot(bool applyWarping = false) const override;
|
||||
|
||||
|
||||
@@ -282,6 +282,13 @@ public:
|
||||
*/
|
||||
virtual bool isSimpleRendering() const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the rendering is being done using a Fisheye lens;
|
||||
* <code>false</code> otherwise. On default, this method returns
|
||||
* <code>false</code>
|
||||
*/
|
||||
virtual bool isFisheyeRendering() const;
|
||||
|
||||
/**
|
||||
* Advises the windowing system to take a screenshot. This method defaults to a no-op.
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/configuration.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
|
||||
#include <ghoul/filesystem/cachemanager.h>
|
||||
@@ -465,7 +465,13 @@ namespace openspace {
|
||||
// DEBUG:
|
||||
_renderOption.addOption(0, "Camera View Direction");
|
||||
_renderOption.addOption(1, "Camera Position Normal");
|
||||
_renderOption.set(1);
|
||||
if (OsEng.windowWrapper().isFisheyeRendering()) {
|
||||
_renderOption.set(1);
|
||||
}
|
||||
else {
|
||||
_renderOption.set(0);
|
||||
}
|
||||
|
||||
addProperty(_renderOption);
|
||||
|
||||
if (dictionary.hasKey(keyUnit)) {
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
@@ -285,7 +286,12 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
|
||||
|
||||
_renderOption.addOption(0, "Camera View Direction");
|
||||
_renderOption.addOption(1, "Camera Position Normal");
|
||||
_renderOption.set(1);
|
||||
if (OsEng.windowWrapper().isFisheyeRendering()) {
|
||||
_renderOption.set(1);
|
||||
}
|
||||
else {
|
||||
_renderOption.set(0);
|
||||
}
|
||||
addProperty(_renderOption);
|
||||
|
||||
if (dictionary.hasKey(keyUnit)) {
|
||||
|
||||
@@ -275,6 +275,12 @@ bool SGCTWindowWrapper::isSimpleRendering() const {
|
||||
sgct::Engine::NonLinearBuffer);
|
||||
}
|
||||
|
||||
bool SGCTWindowWrapper::isFisheyeRendering() const {
|
||||
return dynamic_cast<sgct_core::FisheyeProjection *>(
|
||||
sgct::Engine::instance()->getCurrentWindowPtr()->getViewport(0)->getNonLinearProjectionPtr()
|
||||
);
|
||||
}
|
||||
|
||||
void SGCTWindowWrapper::takeScreenshot(bool applyWarping) const {
|
||||
sgct::SGCTSettings::instance()->setCaptureFromBackBuffer(applyWarping);
|
||||
sgct::Engine::instance()->takeScreenshot();
|
||||
|
||||
@@ -190,6 +190,10 @@ bool WindowWrapper::isSimpleRendering() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WindowWrapper::isFisheyeRendering() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void WindowWrapper::takeScreenshot(bool) const {}
|
||||
|
||||
void WindowWrapper::swapBuffer() const {}
|
||||
|
||||
Reference in New Issue
Block a user