Stellarium 0.13.0
Meteor.hpp
1 /*
2  * Stellarium
3  * This file Copyright (C) 2004 Robert Spearman
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 #ifndef _METEOR_HPP_
21 #define _METEOR_HPP_
22 
23 #include "VecMath.hpp"
24 class StelCore;
25 class StelPainter;
26 
27 // all in km - altitudes make up meteor range
28 #define EARTH_RADIUS 6369.f
29 #define HIGH_ALTITUDE 115.f
30 #define LOW_ALTITUDE 70.f
31 #define VISIBLE_RADIUS 457.8f
32 
39 class Meteor
40 {
41 public:
44  Meteor(const StelCore*, double v);
45  virtual ~Meteor();
46 
49  bool update(double deltaTime);
50 
52  void draw(const StelCore* core, StelPainter& sPainter);
53 
56  bool isAlive(void);
57 
58 private:
59  Mat4d mmat; // tranformation matrix to align radiant with earth direction of travel
60  Vec3d obs; // observer position in meteor coord. system
61  Vec3d position; // equatorial coordinate position
62  Vec3d posInternal; // middle of train
63  Vec3d posTrain; // end of train
64  bool train; // point or train visible?
65  double startH; // start height above center of earth
66  double endH; // end height
67  double velocity; // km/s
68  bool alive; // is it still visible?
69  float mag; // Apparent magnitude at head, 0-1
70  float maxMag; // 0-1
71  float absMag; // absolute magnitude
72  float visMag; // visual magnitude at observer
73  double xydistance; // distance in XY plane (orthogonal to meteor path) from observer to meteor
74  double initDist; // initial distance from observer
75  double minDist; // nearest point to observer along path
76  double distMultiplier; // scale magnitude due to changes in distance
77 
78 };
79 
80 
81 #endif // _METEOR_HPP_
Meteor(const StelCore *, double v)
Create a Meteor object.
Main class for Stellarium core processing.
Definition: StelCore.hpp:46
void draw(const StelCore *core, StelPainter &sPainter)
Draws the meteor.
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:71
bool update(double deltaTime)
Updates the position of the meteor, and expires it if necessary.
bool isAlive(void)
Determine if a meteor is alive or has burned out.
Models a single meteor.
Definition: Meteor.hpp:39