mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-06 11:29:55 -05:00
Pass data regarding if sky browser and target are facing camera and using radius azimuth elevation to gui
This commit is contained in:
@@ -70,6 +70,7 @@ public:
|
||||
virtual bool isReady() const;
|
||||
bool isEnabled() const;
|
||||
bool isUsingRaeCoords() const;
|
||||
bool isFacingCamera() const;
|
||||
void setEnabled(bool isEnabled);
|
||||
float depth();
|
||||
|
||||
|
||||
@@ -75,7 +75,8 @@ public:
|
||||
|
||||
// Boolean functions
|
||||
bool hasFinishedFading(float goalState) const;
|
||||
|
||||
bool isFacingCamera() const;
|
||||
bool isUsingRadiusAzimuthElevation() const;
|
||||
bool isEnabled() const;
|
||||
bool isLocked() const;
|
||||
|
||||
|
||||
@@ -777,10 +777,40 @@ std::string SkyBrowserModule::selectedBrowserId() {
|
||||
return _selectedBrowser;
|
||||
}
|
||||
|
||||
std::string SkyBrowserModule::selectedTargetId()
|
||||
{
|
||||
if (getPair(_selectedBrowser)) {
|
||||
return getPair(_selectedBrowser)->targetId();
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
bool SkyBrowserModule::isCameraInSolarSystem() {
|
||||
return _isCameraInSolarSystem;
|
||||
}
|
||||
|
||||
bool SkyBrowserModule::isSelectedPairUsingRae()
|
||||
{
|
||||
if (getPair(_selectedBrowser)) {
|
||||
return getPair(_selectedBrowser)->isUsingRadiusAzimuthElevation();
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool SkyBrowserModule::isSelectedPairFacingCamera()
|
||||
{
|
||||
if (getPair(_selectedBrowser)) {
|
||||
return getPair(_selectedBrowser)->isFacingCamera();
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//std::vector<documentation::Documentation> SkyBrowserModule::documentations() const {
|
||||
// return {
|
||||
// ExoplanetsDataPreparationTask::documentation(),
|
||||
|
||||
@@ -74,6 +74,7 @@ public:
|
||||
RenderableSkyBrowser* get3dBrowser(const std::string& id);
|
||||
const std::unique_ptr<WwtDataHandler>& getWwtDataHandler();
|
||||
std::string selectedBrowserId();
|
||||
std::string selectedTargetId();
|
||||
|
||||
// Setters
|
||||
void set3dBrowser(const std::string& id);
|
||||
@@ -92,6 +93,8 @@ public:
|
||||
|
||||
// Boolean functions
|
||||
bool isCameraInSolarSystem();
|
||||
bool isSelectedPairFacingCamera();
|
||||
bool isSelectedPairUsingRae();
|
||||
|
||||
// Managing the target browser pairs
|
||||
void removeTargetBrowserPair(const std::string& browserId);
|
||||
|
||||
@@ -332,6 +332,12 @@ int getTargetData(lua_State* L) {
|
||||
lua_settable(L, -3);
|
||||
ghoul::lua::push(L, "selectedBrowserId", module->selectedBrowserId());
|
||||
lua_settable(L, -3);
|
||||
ghoul::lua::push(L, "selectedTargetId", module->selectedTargetId());
|
||||
lua_settable(L, -3);
|
||||
ghoul::lua::push(L, "isFacingCamera", module->isSelectedPairFacingCamera());
|
||||
lua_settable(L, -3);
|
||||
ghoul::lua::push(L, "isUsingRadiusAzimuthElevation", module->isSelectedPairUsingRae());
|
||||
lua_settable(L, -3);
|
||||
ghoul::lua::push(L, "cameraInSolarSystem", module->isCameraInSolarSystem());
|
||||
lua_settable(L, -3);
|
||||
// Set table for the current ImageData
|
||||
|
||||
@@ -337,6 +337,16 @@ namespace openspace {
|
||||
return isTargetFadeFinished(goalState) && isBrowserFadeFinished(goalState);
|
||||
}
|
||||
|
||||
bool Pair::isFacingCamera() const
|
||||
{
|
||||
return _browser->isFacingCamera() || _target->isFacingCamera();
|
||||
}
|
||||
|
||||
bool Pair::isUsingRadiusAzimuthElevation() const
|
||||
{
|
||||
return _browser->isUsingRaeCoords() || _target->isUsingRaeCoords();
|
||||
}
|
||||
|
||||
ScreenSpaceSkyTarget* Pair::getTarget() {
|
||||
return _target;
|
||||
}
|
||||
|
||||
@@ -464,6 +464,10 @@ bool ScreenSpaceRenderable::isUsingRaeCoords() const
|
||||
{
|
||||
return _useRadiusAzimuthElevation;
|
||||
}
|
||||
bool ScreenSpaceRenderable::isFacingCamera() const
|
||||
{
|
||||
return _faceCamera;
|
||||
}
|
||||
void ScreenSpaceRenderable::setEnabled(bool isEnabled)
|
||||
{
|
||||
_enabled = isEnabled;
|
||||
|
||||
Reference in New Issue
Block a user