Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Sky.h
Go to the documentation of this file.
1 /* Project Starshatter 4.5
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: Sky.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Celestial sphere, stars, planets, space dust...
13 */
14 
15 #ifndef Sky_h
16 #define Sky_h
17 
18 #include "Types.h"
19 #include "Solid.h"
20 #include "Bitmap.h"
21 #include "Geometry.h"
22 
23 // +--------------------------------------------------------------------+
24 
25 class StarSystem;
26 
27 // +--------------------------------------------------------------------+
28 
29 class Stars : public Graphic
30 {
31 public:
32  Stars(int nstars);
33  virtual ~Stars();
34 
35  virtual void Illuminate(double scale);
36  virtual void Render(Video* video, DWORD flags);
37 
38 protected:
41 };
42 
43 // +--------------------------------------------------------------------+
44 
45 class Dust : public Graphic
46 {
47 public:
48  Dust(int ndust, bool bright=false);
49  virtual ~Dust();
50 
51  virtual void Render(Video* video, DWORD flags);
52  virtual void Reset(const Point& ref);
53  virtual void ExecFrame(double factor, const Point& ref);
54 
55  virtual void Hide();
56  virtual void Show();
57 
58 protected:
60  bool bright;
62 };
63 
64 // +--------------------------------------------------------------------+
65 
66 class PlanetRep : public Solid
67 {
68 public:
69  PlanetRep(const char* img_west, const char* img_glow,
70  double rad, const Vec3& pos, double tscale = 1,
71  const char* rngname=0, double minrad = 0, double maxrad = 0,
72  Color atmos = Color::Black, const char* img_gloss=0);
73  virtual ~PlanetRep();
74 
75  virtual Color Atmosphere() const { return atmosphere; }
76  virtual void SetAtmosphere(Color a) { atmosphere = a; }
77  virtual void SetDaytime(bool d);
78  virtual void SetStarSystem(StarSystem* system);
79 
80  virtual void Render(Video* video, DWORD flags);
81 
82  virtual int CheckRayIntersection(Point pt, Point vpn, double len, Point& ipt,
83  bool treat_translucent_polys_as_solid=true);
84 
85 protected:
86  void CreateSphere(double radius, int nrings, int nsections,
87  double minrad, double maxrad, int rsections,
88  double tscale);
89 
93  int has_ring;
96  double ring_rad;
97  double body_rad;
99  bool daytime;
100 
102 };
103 
104 #endif Sky_h
105