Planet.hpp   Planet.hpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _PLANET_HPP_ #ifndef _PLANET_HPP_
#define _PLANET_HPP_ #define _PLANET_HPP_
#include <QString>
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "VecMath.hpp" #include "VecMath.hpp"
#include "StelFader.hpp" #include "StelFader.hpp"
#include "renderer/GenericVertexTypes.hpp" #include "StelTextureTypes.hpp"
#include "renderer/StelIndexBuffer.hpp"
#include "renderer/StelVertexBuffer.hpp"
#include "StelProjectorType.hpp" #include "StelProjectorType.hpp"
#include <QString>
// The callback type for the external position computation function // The callback type for the external position computation function
// The last variable is the userData pointer. // The last variable is the userData pointer.
typedef void (*posFuncType)(double, double*, void*); typedef void (*posFuncType)(double, double*, void*);
typedef void (OsculatingFunctType)(double jd0,double jd,double xyz[3]); typedef void (OsculatingFunctType)(double jd0,double jd,double xyz[3]);
// epoch J2000: 12 UT on 1 Jan 2000 // epoch J2000: 12 UT on 1 Jan 2000
#define J2000 2451545.0 #define J2000 2451545.0
#define ORBIT_SEGMENTS 360 #define ORBIT_SEGMENTS 360
class StelFont; class StelFont;
class StelPainter;
class StelTranslator; class StelTranslator;
class QOpenGLShaderProgram;
struct TrailPoint
{
Vec3d point;
double date;
};
struct ShadowPlanetShaderInfo
{
int info;
int current;
int infoCount;
float infoSize;
};
// Class used to store orbital elements // Class used to store orbital elements
class RotationElements class RotationElements
{ {
public: public:
RotationElements(void) : period(1.), offset(0.), epoch(J2000), obliq uity(0.), ascendingNode(0.), precessionRate(0.) {} RotationElements(void) : period(1.), offset(0.), epoch(J2000), obliq uity(0.), ascendingNode(0.), precessionRate(0.), siderealPeriod(0.) {}
float period; // rotation period float period; // rotation period
float offset; // rotation at epoch float offset; // rotation at epoch
double epoch; double epoch;
float obliquity; // tilt of rotation axis w.r.t. ecliptic float obliquity; // tilt of rotation axis w.r.t. ecliptic
float ascendingNode; // long. of ascending node of equator on the ecliptic float ascendingNode; // long. of ascending node of equator on the ecliptic
float precessionRate; // rate of precession of rotation axis in rad s/day float precessionRate; // rate of precession of rotation axis in rad s/day
double siderealPeriod; // sidereal period (Planet year in earth days ) double siderealPeriod; // sidereal period (Planet year in earth days )
}; };
// Class to manage rings for planets like saturn // Class to manage rings for planets like saturn
class Ring class Ring
{ {
friend class Planet;
public: public:
Ring(double radiusMin,double radiusMax,const QString &texname); Ring(float radiusMin, float radiusMax,const QString &texname);
~Ring(void);
//! Draw the ring
//!
//! Note that ring drawing doesn't use light
//! (it didn't use it before the refactor either, but there was code
//! to do lighting on the CPU in StelPainter::sRing)
//!
//! @param projector Projector to project the vertices.
//! @param renderer Renderer to draw with.
//! @param transform Used to determine whether we're above or below
the ring.
//! @param shader Shader to use for drawing.
//! @param screenSz Screen size.
//! @param info Shader information.
void draw(StelProjectorP projector, class StelRenderer* renderer, St
elProjector::ModelViewTranformP transform, class StelGLSLShader *shader, do
uble screenSz, ShadowPlanetShaderInfo *info);
double getSize(void) const {return radiusMax;} double getSize(void) const {return radiusMax;}
private: const float radiusMin;
const double radiusMin; const float radiusMax;
const double radiusMax; StelTextureSP tex;
const QString texName;
class StelTextureNew* texture;
//! Graphics representation of the ring.
class StelGeometryRing* ring;
}; };
class Planet : public StelObject class Planet : public StelObject
{ {
protected:
//! Stores graphics data that is shared between planets and must be
initialized by
//! a StelRenderer.
struct SharedPlanetGraphics
{
//! Texture used to draw earth shadow.
class StelTextureNew* texEarthShadow;
//! Texture used to draw planet hint.
class StelTextureNew* texHintCircle;
//! Shader used to draw the planet (with lighting), if light
ing is used and GLSL is supported.
class StelGLSLShader* simplePlanetShader;
//! Shader used to draw the planet (with lighting and shadow
ing).
class StelGLSLShader* shadowPlanetShader;
//! Currently used shader, one of the two above.
class StelGLSLShader* planetShader;
//! Are we initialized yet?
bool initialized;
//! Information for the shadow planet shader.
ShadowPlanetShaderInfo info;
//! Default constructor - construct uninitialized SharedPlan
etGraphics.
SharedPlanetGraphics(): initialized(false){}
//! Destructor - frees resources if initialized.
~SharedPlanetGraphics();
//! Lazily initialize the data, using given renderer to crea
te textures/shader.
void lazyInit(class StelRenderer* renderer);
//! Loads the shaders.
bool loadPlanetShaders(StelRenderer *renderer);
};
public: public:
friend class SolarSystem; friend class SolarSystem;
Planet(const QString& englishName, Planet(const QString& englishName,
int flagLighting, int flagLighting,
double radius, double radius,
double oblateness, double oblateness,
Vec3f color, Vec3f color,
float albedo, float albedo,
const QString& texMapName, const QString& texMapName,
const QString& normalMapName,
posFuncType _coordFunc, posFuncType _coordFunc,
void* userDataPtr, void* userDataPtr,
OsculatingFunctType *osculatingFunc, OsculatingFunctType *osculatingFunc,
bool closeOrbit, bool closeOrbit,
bool hidden, bool hidden,
bool hasAtmosphere, bool hasAtmosphere,
bool hasHalo,
const QString &pType); const QString &pType);
~Planet(); virtual ~Planet();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods inherited from StelObject // Methods inherited from StelObject
//! Get a string with data about the Planet. //! Get a string with data about the Planet.
//! Planets support the following InfoStringGroup flags: //! Planets support the following InfoStringGroup flags:
//! - Name //! - Name
//! - Magnitude //! - Magnitude
//! - RaDec //! - RaDec
//! - AltAzi //! - AltAzi
//! - Distance //! - Distance
//! - Size //! - Size
//! - PlainText //! - PlainText
//! - Extra1: Heliocentric Ecliptical Coordinates & Observer-planeto //! - Extra: Heliocentric Ecliptical Coordinates & Observer-planetoc
centric Ecliptical Coordinates entric Ecliptical Coordinates, Phase, illumination, phase angle & elongatio
//! - Extra2: Phase, illumination, phase angle & elongation from the n from the Sun
Sun
//! @param core the StelCore object //! @param core the StelCore object
//! @param flags a set of InfoStringGroup items to include in the re turn value. //! @param flags a set of InfoStringGroup items to include in the re turn value.
//! @return a QString containing an HMTL encoded description of the Planet. //! @return a QString containing an HMTL encoded description of the Planet.
virtual QString getInfoString(const StelCore *core, const InfoString Group& flags) const; virtual QString getInfoString(const StelCore *core, const InfoString Group& flags) const;
virtual double getCloseViewFov(const StelCore* core) const; virtual double getCloseViewFov(const StelCore* core) const;
virtual double getSatellitesFov(const StelCore* core) const; virtual double getSatellitesFov(const StelCore* core) const;
virtual double getParentSatellitesFov(const StelCore* core) const; virtual double getParentSatellitesFov(const StelCore* core) const;
virtual float getVMagnitude(const StelCore* core, bool withExtinctio n=false) const; virtual float getVMagnitude(const StelCore* core) const;
virtual float getSelectPriority(const StelCore* core) const; virtual float getSelectPriority(const StelCore* core) const;
virtual Vec3f getInfoColor(void) const; virtual Vec3f getInfoColor(void) const;
virtual QString getType(void) const {return "Planet";} virtual QString getType(void) const {return "Planet";}
virtual Vec3d getJ2000EquatorialPos(const StelCore *core) const; virtual Vec3d getJ2000EquatorialPos(const StelCore *core) const;
virtual QString getEnglishName(void) const {return englishName;} virtual QString getEnglishName(void) const {return englishName;}
virtual QString getNameI18n(void) const {return nameI18;} virtual QString getNameI18n(void) const {return nameI18;}
virtual double getAngularSize(const StelCore* core) const; virtual double getAngularSize(const StelCore* core) const;
virtual bool hasAtmosphere(void) {return atmosphere;} virtual bool hasAtmosphere(void) {return atmosphere;}
virtual bool hasHalo(void) {return halo;}
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods of SolarSystem object // Methods of SolarSystem object
//! Translate planet name using the passed translator //! Translate planet name using the passed translator
virtual void translateName(StelTranslator& trans); virtual void translateName(const StelTranslator &trans);
//! Draw the Planet. // Draw the Planet
//! // GZ Made that virtual to allow comets having their own draw().
//! @param core The StelCore object. virtual void draw(StelCore* core, float maxMagLabels, const QFont& p
//! @param renderer Renderer used for drawing. lanetNameFont);
//! @param maxMagLabels Maximum visual magnitude to draw the label
at.
//! @param planetNameFont Font used to draw the planet label.
//! @param planetGraphics Graphics shared among planets.
void draw(StelCore* core, class StelRenderer* renderer, float maxMag
Labels,
const QFont& planetNameFont, SharedPlanetGraphics& planetG
raphics);
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods specific to Planet // Methods specific to Planet
//! Get the radius of the planet in AU. //! Get the radius of the planet in AU.
//! @return the radius of the planet in astronomical units. //! @return the radius of the planet in astronomical units.
double getRadius(void) const {return radius;} double getRadius(void) const {return radius;}
//! Get duration of sidereal day //! Get duration of sidereal day
double getSiderealDay(void) const {return re.period;} double getSiderealDay(void) const {return re.period;}
//! Get duration of sidereal year //! Get duration of sidereal year
double getSiderealPeriod(void) const { return re.siderealPeriod; } // GZ: made that virtual for Comets.
virtual double getSiderealPeriod(void) const { return re.siderealPer
iod; }
//! Get duration of mean solar day //! Get duration of mean solar day
double getMeanSolarDay(void) const; double getMeanSolarDay(void) const;
const QString& getTextMapName() const {return texMapName;} const QString& getTextMapName() const {return texMapName;}
// Compute the z rotation to use from equatorial to geographic coord inates // Compute the z rotation to use from equatorial to geographic coord inates
double getSiderealTime(double jd) const; double getSiderealTime(double jd) const;
Mat4d getRotEquatorialToVsop87(void) const; Mat4d getRotEquatorialToVsop87(void) const;
void setRotEquatorialToVsop87(const Mat4d &m); void setRotEquatorialToVsop87(const Mat4d &m);
const RotationElements &getRotationElements(void) const {return re;} const RotationElements &getRotationElements(void) const {return re;}
// Compute the position in the parent Planet coordinate system // Compute the position in the parent Planet coordinate system
void computePositionWithoutOrbits(const double date); void computePositionWithoutOrbits(const double date);
void computePosition(const double date); void computePosition(const double date);
// Compute the transformation matrix from the local Planet coordinat e to the parent Planet coordinate // Compute the transformation matrix from the local Planet coordinat e to the parent Planet coordinate
void computeTransMatrix(double date); void computeTransMatrix(double date);
// Compute the transformation matrix from model to world coordinates
void computeModelMatrix(Mat4d& result) const;
// Get the phase angle (rad) for an observer at pos obsPos in helioc entric coordinates (in AU) // Get the phase angle (rad) for an observer at pos obsPos in helioc entric coordinates (in AU)
double getPhaseAngle(const Vec3d& obsPos) const; double getPhaseAngle(const Vec3d& obsPos) const;
// Get the elongation angle (rad) for an observer at pos obsPos in h eliocentric coordinates (in AU) // Get the elongation angle (rad) for an observer at pos obsPos in h eliocentric coordinates (in AU)
double getElongation(const Vec3d& obsPos) const; double getElongation(const Vec3d& obsPos) const;
// Get the angular size of the spheroid of the planet (i.e. without the rings) // Get the angular size of the spheroid of the planet (i.e. without the rings)
double getSpheroidAngularSize(const StelCore* core) const; double getSpheroidAngularSize(const StelCore* core) const;
// Get the planet phase for an observer at pos obsPos in heliocentri c coordinates (in AU) // Get the planet phase for an observer at pos obsPos in heliocentri c coordinates (in AU)
float getPhase(const Vec3d& obsPos) const; float getPhase(const Vec3d& obsPos) const;
// Set the orbital elements // Set the orbital elements
void setRotationElements(float _period, float _offset, double _epoch , void setRotationElements(float _period, float _offset, double _epoch ,
float _obliquity, float _ascendingNode, float _obliquity, float _ascendingNode,
float _precessionRate, double _siderealPeri od); float _precessionRate, double _siderealPeri od);
double getRotAscendingnode(void) const {return re.ascendingNode;} double getRotAscendingnode(void) const {return re.ascendingNode;}
double getRotObliquity(void) const {return re.obliquity;} double getRotObliquity(double JDay) const;
//! Get the Planet position in the parent Planet ecliptic coordinate in AU //! Get the Planet position in the parent Planet ecliptic coordinate in AU
Vec3d getEclipticPos() const; Vec3d getEclipticPos() const;
// Return the heliocentric ecliptical position // Return the heliocentric ecliptical position
Vec3d getHeliocentricEclipticPos() const; Vec3d getHeliocentricEclipticPos() const;
// Return the heliocentric transformation for local coordinate // Return the heliocentric transformation for local coordinate
Vec3d getHeliocentricPos(Vec3d) const; Vec3d getHeliocentricPos(Vec3d) const;
void setHeliocentricEclipticPos(const Vec3d &pos); void setHeliocentricEclipticPos(const Vec3d &pos);
// Compute the distance to the given position in heliocentric coordi nate (in AU) // Compute the distance to the given position in heliocentric coordi nate (in AU)
double computeDistance(const Vec3d& obsHelioPos); double computeDistance(const Vec3d& obsHelioPos);
double getDistance(void) const {return distance;} double getDistance(void) const {return distance;}
void setRings(Ring* r) {rings = r;} void setRings(Ring* r) {rings = r;}
void setSphereScale(float s); void setSphereScale(float s) {sphereScale = s;}
float getSphereScale(void) const {return sphereScale;} float getSphereScale(void) const {return sphereScale;}
const QSharedPointer<Planet> getParent(void) const {return parent;} const QSharedPointer<Planet> getParent(void) const {return parent;}
static void setLabelColor(const Vec3f& lc) {labelColor = lc;} static void setLabelColor(const Vec3f& lc) {labelColor = lc;}
static const Vec3f& getLabelColor(void) {return labelColor;} static const Vec3f& getLabelColor(void) {return labelColor;}
// update displayed elements. @param deltaTime: ms (?)
void update(int deltaTime); void update(int deltaTime);
void setFlagHints(bool b){hintFader = b;} void setFlagHints(bool b){hintFader = b;}
bool getFlagHints(void) const {return hintFader;} bool getFlagHints(void) const {return hintFader;}
void setFlagLabels(bool b){flagLabels = b;} void setFlagLabels(bool b){flagLabels = b;}
bool getFlagLabels(void) const {return flagLabels;} bool getFlagLabels(void) const {return flagLabels;}
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// DEPRECATED // DEPRECATED
///// Orbit related code ///// Orbit related code
// Should move to an OrbitPath class which works on a SolarSystemObj ect, not a Planet // Should move to an OrbitPath class which works on a SolarSystemObj ect, not a Planet
void setFlagOrbits(bool b){orbitFader = b;} void setFlagOrbits(bool b){orbitFader = b;}
bool getFlagOrbits(void) const {return orbitFader;} bool getFlagOrbits(void) const {return orbitFader;}
//! A simple 2D vertex with only a position.
struct Vertex2D
{
Vec2f position;
Vertex2D(const float x, const float y) : position(x, y){}
VERTEX_ATTRIBUTES(Vec2f Position);
};
//! Vertex buffer used to draw the orbit.
StelVertexBuffer<Vertex2D>* orbitVertices;
LinearFader orbitFader; LinearFader orbitFader;
// draw orbital path of Planet // draw orbital path of Planet
void drawOrbit(const StelCore* core, class StelRenderer* renderer); void drawOrbit(const StelCore*);
Vec3d orbit[ORBIT_SEGMENTS+1]; // store heliocentric coordinates f or drawing the orbit Vec3d orbit[ORBIT_SEGMENTS+1]; // store heliocentric coordinates f or drawing the orbit
Vec3d orbitP[ORBIT_SEGMENTS+1]; // store local coordinate for orbit Vec3d orbitP[ORBIT_SEGMENTS+1]; // store local coordinate for orbit
double lastOrbitJD; double lastOrbitJD;
double deltaJD; double deltaJD; // time difference between position al updates.
double deltaOrbitJD; double deltaOrbitJD;
bool orbitCached; // whether orbit calculations are c ached for drawing orbit yet bool orbitCached; // whether orbit calculations are c ached for drawing orbit yet
bool closeOrbit; // whether to connect the beginning of the orbit line to bool closeOrbit; // whether to connect the beginning of the orbit line to
// the end: good for elliptical orb // the end: good for elliptical orb
its, bad for parabolic its, bad for parabolic
// and hyperbolic orbits // and hyperbolic orbits
static Vec3f orbitColor; static Vec3f orbitColor;
static void setOrbitColor(const Vec3f& oc) {orbitColor = oc;} static void setOrbitColor(const Vec3f& oc) {orbitColor = oc;}
static const Vec3f& getOrbitColor() {return orbitColor;} static const Vec3f& getOrbitColor() {return orbitColor;}
//! Return the list of planets which project some shadow on this pla
net
QVector<const Planet*> getCandidatesForShadow() const;
protected: protected:
// draw earth shadow on moon for lunar eclipses static StelTextureSP texEarthShadow; // for lunar eclipses
void drawEarthShadow(StelCore* core, class StelRenderer* renderer,
SharedPlanetGraphics& planetGraphics); void computeModelMatrix(Mat4d &result) const;
// Return the information string "ready to print" :) // Return the information string "ready to print" :)
QString getSkyLabel(const StelCore* core) const; QString getSkyLabel(const StelCore* core) const;
//! Draw the 3d model. Call the proper functions if there are rings // Draw the 3d model. Call the proper functions if there are rings e
etc. . tc..
//! void draw3dModel(StelCore* core, StelProjector::ModelViewTranformP t
//! @param core The StelCore object. ransfo, float screenSz, bool drawOnlyRing=false);
//! @param renderer Renderer used for drawing.
//! @param planetGraphics Graphics resources shared between planets, // Draw the 3D sphere
e.g. planet lighting shader. void drawSphere(StelPainter* painter, float screenSz, bool drawOnlyR
//! @param transfo Modelview transform. ing=false);
//! @param screenSz Screen size.
void draw3dModel(StelCore* core, class StelRenderer* renderer,
SharedPlanetGraphics& planetGraphics,
StelProjector::ModelViewTranformP transfo, float sc
reenSz);
//! Draw the unlit sphere model.
//!
//! Used either when lighting is disabled or when it is done in shad
ers.
//!
//! Called by drawSphere.
//!
//! @param renderer Renderer to draw with.
//! @param projector Projector to project the vertices.
void drawUnlitSphere(class StelRenderer* renderer, StelProjectorP pr
ojector);
//! Draw the 3D sphere.
//!
//! @param renderer Renderer to draw with.
//! @param projector Projector to project vertices.
//! @param light If NULL, lighting is not used. Otherwise t
he sphere is
//! either generated with lighting (no shaders
), or lit in
//! shaders (if GLSL is supported).
//! @param planetGraphics To render the planet using a shader on the
GPU if
//! possible.
//! @param screenSz Screen size.
void drawSphere(class StelRenderer* renderer, StelProjectorP project
or,
const struct StelLight* light, SharedPlan
etGraphics &planetGraphics, float screenSz);
// Draw the circle and name of the Planet // Draw the circle and name of the Planet
void drawHints(const StelCore* core, class StelRenderer* renderer, void drawHints(const StelCore* core, const QFont& planetNameFont);
const QFont& planetNameFont, SharedPlanetGraphics& pl
anetGraphics);
QString englishName; // english planet name QString englishName; // english planet name
QString nameI18; // International translated name QString nameI18; // International translated name
QString texMapName; // Texture file path QString texMapName; // Texture file path
QString normalMapName; // Texture file path
int flagLighting; // Set whether light computation ha
s to be proceed
RotationElements re; // Rotation param RotationElements re; // Rotation param
double radius; // Planet radius in AU
// Note: vertex/index buffer generation depends on the fact that double oneMinusOblateness; // (polar radius)/(equatorial radiu
// flagLighting, radius and oneMinusOblateness don't change. s)
// If they change, buffers will have to be regenerated to reflect th
e change.
const int flagLighting; // Set whether light computation ha
s to be proceed
const double radius; // Planet radius in AU
const double oneMinusOblateness; // (polar radius)/(equatorial radiu
s)
Vec3d eclipticPos; // Position in AU in the rectangula r ecliptic coordinate system Vec3d eclipticPos; // Position in AU in the rectangula r ecliptic coordinate system
// centered on the parent Planet // centered on the parent Planet
Vec3d screenPos; // Used to store temporarily the 2D position on screen Vec3d screenPos; // Used to store temporarily the 2D position on screen
Vec3d previousScreenPos; // The position of this planet in t he previous frame. Vec3d previousScreenPos; // The position of this planet in t he previous frame.
Vec3f color; Vec3f color; // exclusively used for drawing the planet halo
float albedo; // Planet albedo float albedo; // Planet albedo. Used for magnitud e computation (but formula dubious!)
Mat4d rotLocalToParent; Mat4d rotLocalToParent;
float axisRotation; // Rotation angle of the Planet on it's axis float axisRotation; // Rotation angle of the Planet on it's axis
StelTextureSP texMap; // Planet map texture
class StelTextureNew* texture; // Planet map texture StelTextureSP normalMap; // Planet normal map texture
Ring* rings; // Planet rings Ring* rings; // Planet rings
double distance; // Temporary variable used to store the distance to a given point double distance; // Temporary variable used to store the distance to a given point
// it is used for sorting while dra wing // it is used for sorting while dra wing
float sphereScale; // Artificial scaling for better vi ewing float sphereScale; // Artificial scaling for better vi ewing
double lastJD; double lastJD; // caches JD of last positional com putation
// The callback for the calculation of the equatorial rect heliocent ric position at time JD. // The callback for the calculation of the equatorial rect heliocent ric position at time JD.
posFuncType coordFunc; posFuncType coordFunc;
void* userDataPtr; void* userDataPtr;
OsculatingFunctType *const osculatingFunc; OsculatingFunctType *const osculatingFunc;
QSharedPointer<Planet> parent; // Planet parent i.e. sun f or earth QSharedPointer<Planet> parent; // Planet parent i.e. sun f or earth
QList<QSharedPointer<Planet> > satellites; // satellites of the Planet QList<QSharedPointer<Planet> > satellites; // satellites of the Planet
LinearFader hintFader; LinearFader hintFader;
LinearFader labelsFader; // Store the current state of the l abel for this planet LinearFader labelsFader; // Store the current state of the l abel for this planet
bool flagLabels; // Define whether labels should be displayed bool flagLabels; // Define whether labels should be displayed
bool hidden; // useful for fake planets used as observation positions - not drawn or labeled bool hidden; // useful for fake planets used as observation positions - not drawn or labeled
bool atmosphere; // Does the planet have an atmosphe re? bool atmosphere; // Does the planet have an atmosphe re?
bool halo; // Does the planet have a halo?
QString pType; // Type of body QString pType; // Type of body
//! Sphere used to draw the planet when lighting is disabled or when
it is done in shaders.
class StelGeometrySphere* unlitSphere;
//! Sphere used to draw the planet when lighting is enabled and shad
ers are not used.
class StelGeometrySphere* litSphere;
static Vec3f labelColor; static Vec3f labelColor;
static StelTextureSP hintCircleTex;
// Shader-related variables
struct PlanetShaderVars {
int projectionMatrix;
int texCoord;
int unprojectedVertex;
int vertex;
int texture;
int lightDirection;
int eyeDirection;
int diffuseLight;
int ambientLight;
int shadowCount;
int shadowData;
int sunInfo;
void initLocations(QOpenGLShaderProgram*);
};
static PlanetShaderVars planetShaderVars;
static QOpenGLShaderProgram* planetShaderProgram;
// Shader-related variables
struct RingPlanetShaderVars : public PlanetShaderVars {
// Rings-specific variables
int isRing;
int ring;
int outerRadius;
int innerRadius;
int ringS;
};
static RingPlanetShaderVars ringPlanetShaderVars;
static QOpenGLShaderProgram* ringPlanetShaderProgram;
struct MoonShaderVars : public PlanetShaderVars {
// Moon-specific variables
int earthShadow;
int normalMap;
};
static MoonShaderVars moonShaderVars;
static QOpenGLShaderProgram* moonShaderProgram;
static void initShader();
static void deinitShader();
}; };
#endif // _PLANET_HPP_ #endif // _PLANET_HPP_
 End of changes. 42 change blocks. 
204 lines changed or deleted 109 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/