mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Cleanup for Spheres and PSC (#827)
* Fade fixes * Clean up RenderableSphere. Add orientation properties. * Sane defaults for Digital Universe * Clean up New Horizons related code * Add basic scene * Add ability to initialize rotation as quaternion and mat3 * Adapt legacy code to new Renderable interface
This commit is contained in:
committed by
Alexander Bock
parent
e78121febc
commit
50ff2d96d2
@@ -46,7 +46,6 @@ struct SurfacePositionHandle;
|
||||
namespace documentation { struct Documentation; }
|
||||
|
||||
class Camera;
|
||||
class PowerScaledCoordinate;
|
||||
|
||||
class Renderable : public properties::PropertyOwner {
|
||||
public:
|
||||
@@ -60,7 +59,6 @@ public:
|
||||
static std::unique_ptr<Renderable> createFromDictionary(
|
||||
const ghoul::Dictionary& dictionary);
|
||||
|
||||
// constructors & destructor
|
||||
Renderable(const ghoul::Dictionary& dictionary);
|
||||
virtual ~Renderable() = default;
|
||||
|
||||
@@ -88,9 +86,6 @@ public:
|
||||
|
||||
void onEnabledChange(std::function<void(bool)> callback);
|
||||
|
||||
static void setPscUniforms(ghoul::opengl::ProgramObject& program,
|
||||
const Camera& camera, const PowerScaledCoordinate& position);
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
glm::dvec3 dvec3() const;
|
||||
|
||||
// length of the vector as a pss
|
||||
PowerScaledScalar length() const;
|
||||
float length() const;
|
||||
glm::vec3 direction() const;
|
||||
|
||||
// operator overloading
|
||||
@@ -80,8 +80,6 @@ public:
|
||||
// scalar operators
|
||||
PowerScaledCoordinate operator*(const double& rhs) const;
|
||||
PowerScaledCoordinate operator*(const float& rhs) const;
|
||||
PowerScaledCoordinate& operator*=(const PowerScaledScalar& rhs);
|
||||
PowerScaledCoordinate operator*(const PowerScaledScalar& rhs) const;
|
||||
PowerScaledCoordinate operator*(const glm::mat4& matrix) const;
|
||||
|
||||
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2019 *
|
||||
* *
|
||||
* 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___POWERSCALEDSCALAR___H__
|
||||
#define __OPENSPACE_CORE___POWERSCALEDSCALAR___H__
|
||||
|
||||
#include <ghoul/glm.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class PowerScaledScalar {
|
||||
public:
|
||||
PowerScaledScalar() = default;
|
||||
PowerScaledScalar(const glm::vec2 &v);
|
||||
PowerScaledScalar(float f1, float f2);
|
||||
static PowerScaledScalar CreatePSS(double d1);
|
||||
|
||||
const glm::vec2& vec2() const;
|
||||
float lengthf() const;
|
||||
double lengthd() const;
|
||||
|
||||
|
||||
// operator overloading
|
||||
PowerScaledScalar& operator=(const PowerScaledScalar& rhs);
|
||||
PowerScaledScalar& operator+=(const PowerScaledScalar& rhs);
|
||||
const PowerScaledScalar& operator+(const PowerScaledScalar& rhs) const;
|
||||
PowerScaledScalar& operator-=(const PowerScaledScalar& rhs);
|
||||
const PowerScaledScalar& operator-(const PowerScaledScalar& rhs) const;
|
||||
PowerScaledScalar& operator*=(const PowerScaledScalar& rhs);
|
||||
const PowerScaledScalar& operator*(const PowerScaledScalar& rhs) const;
|
||||
PowerScaledScalar& operator*=(float rhs);
|
||||
const PowerScaledScalar& operator*(float rhs) const;
|
||||
float& operator[](unsigned int idx);
|
||||
float operator[](unsigned int idx) const;
|
||||
|
||||
// comparison
|
||||
bool operator==(const PowerScaledScalar& other) const;
|
||||
bool operator<(const PowerScaledScalar& other) const;
|
||||
bool operator>(const PowerScaledScalar& other) const;
|
||||
bool operator<=(const PowerScaledScalar& other) const;
|
||||
bool operator>=(const PowerScaledScalar& other) const;
|
||||
|
||||
bool operator==(double other) const;
|
||||
bool operator<(double other) const;
|
||||
bool operator>(double other) const;
|
||||
bool operator<=(double other) const;
|
||||
bool operator>=(double other) const;
|
||||
|
||||
// glm integration
|
||||
PowerScaledScalar& operator=(const glm::vec2& rhs);
|
||||
PowerScaledScalar& operator=(float rhs);
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& os, const PowerScaledScalar& rhs);
|
||||
|
||||
// allow the power scaled coordinates to access private members
|
||||
friend class PowerScaledCoordinate;
|
||||
|
||||
private:
|
||||
// float vector used when returning float values
|
||||
glm::vec2 _data = glm::vec2(0.f);
|
||||
};
|
||||
|
||||
typedef PowerScaledScalar pss;
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___POWERSCALEDSCALAR___H__
|
||||
@@ -30,12 +30,11 @@
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class PowerScaledScalar;
|
||||
class PowerScaledSphere;
|
||||
|
||||
class PowerScaledSphere {
|
||||
public:
|
||||
PowerScaledSphere(const PowerScaledScalar& radius, int segments = 8);
|
||||
PowerScaledSphere(float radius, int segments = 8);
|
||||
PowerScaledSphere(glm::vec3 radius, int segments);
|
||||
PowerScaledSphere(const PowerScaledSphere& cpy);
|
||||
~PowerScaledSphere();
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define __OPENSPACE_CORE___SYNCBUFFER___H__
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
@@ -51,9 +51,6 @@ struct UpdateData {
|
||||
|
||||
struct RenderData {
|
||||
const Camera& camera;
|
||||
// psc position to be removed in favor of the double precision position defined in
|
||||
// the translation in transform.
|
||||
psc position;
|
||||
const Time time;
|
||||
bool doPerformanceMeasurement;
|
||||
int renderBinMask;
|
||||
|
||||
Reference in New Issue
Block a user