Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
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
:
39
VertexSet
*
vset
;
40
Color
*
colors
;
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
:
59
bool
really_hidden
;
60
bool
bright
;
61
VertexSet
*
vset
;
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
90
Material
*
mtl_surf
;
91
Material
*
mtl_limb
;
92
Material
*
mtl_ring
;
93
int
has_ring
;
94
int
ring_verts
;
95
int
ring_polys
;
96
double
ring_rad
;
97
double
body_rad
;
98
Color
atmosphere
;
99
bool
daytime
;
100
101
StarSystem
*
star_system
;
102
};
103
104
#endif Sky_h
105
Stars45
Sky.h
Generated on Tue Jun 5 2012 20:47:12 for Starshatter_Open by
1.8.1