In galaxy.h we have to declare a new SBbc type and enumerate accordingly:
Code: Select all
public:
enum GalaxyType {
S0 = 0,
Sa = 1,
Sb = 2,
Sc = 3,
SBa = 4,
SBb = 5,
SBc = 6,
// begin new/modified code block
SBbc = 7, // new galaxy type
E0 = 8, // increment +1 the next types
E1 = 9,
E2 = 10,
E3 = 11,
E4 = 12,
E5 = 13,
E6 = 14,
E7 = 15,
Irr = 16
// end new/modified code block
};
There are several things to do in galaxy.ccp.
First, we add the new type's name:
Code: Select all
static GalaxyTypeName GalaxyTypeNames[] =
{
{ "S0", Galaxy::S0 },
{ "Sa", Galaxy::Sa },
{ "Sb", Galaxy::Sb },
{ "Sc", Galaxy::Sc },
{ "SBa", Galaxy::SBa },
{ "SBb", Galaxy::SBb },
{ "SBc", Galaxy::SBc },
// begin new galaxy type
{ "SBbc", Galaxy::SBbc },
// end new galaxy type
{ "E0", Galaxy::E0 },
{ "E1", Galaxy::E1 },
{ "E2", Galaxy::E2 },
{ "E3", Galaxy::E3 },
{ "E4", Galaxy::E4 },
{ "E5", Galaxy::E5 },
{ "E6", Galaxy::E6 },
{ "E7", Galaxy::E7 },
{ "Irr", Galaxy::Irr },
};
Then let's Celestia pick up its choice:
Code: Select all
switch (type)
{
case S0:
case Sa:
case Sb:
case Sc:
case SBa:
case SBb:
case SBc:
// begin new galaxy type
case SBbc:
// end new galaxy type
form = spiralForms[type - S0];
break;
case E0:
case E1:
case E2:
case E3:
case E4:
case E5:
case E6:
case E7:
form = ellipticalForms[type - E0];
//form = NULL;
break;
case Irr:
form = irregularForm;
break;
Now we increase the number of forms and add a new one:
Code: Select all
// spiralForms = new GalacticForm*[7];
// begin changed line - we have 8 Hubble types now instead of 7
// we have to add the new form here
spiralForms = new GalacticForm*[8]; // <-- 8 forms now
// end changed line
spiralForms[Galaxy::S0] = buildGalacticForms("models/S0.pts");
spiralForms[Galaxy::Sa] = buildGalacticForms("models/Sa.pts");
spiralForms[Galaxy::Sb] = buildGalacticForms("models/Sb.pts");
spiralForms[Galaxy::Sc] = buildGalacticForms("models/Sc.pts");
spiralForms[Galaxy::SBa] = buildGalacticForms("models/SBa.pts");
spiralForms[Galaxy::SBb] = buildGalacticForms("models/SBb.pts");
spiralForms[Galaxy::SBc] = buildGalacticForms("models/SBc.pts");
// begin new galaxy type
spiralForms[Galaxy::SBbc] = buildGalacticForms("models/SBbc.pts");
// end new galaxy type
That's it for the code.
We have now to edit the type for the Milky Way from SBc to SBbc in the deepsky.dsc file which sits in /celestia/data/ so that it reads:
Code: Select all
# Milky Way
Galaxy "Milky Way"
{
Type "SBbc"
RA 17.7500
Dec -28.9300
Distance 2.772e+04
Radius 5e+04
AbsMag -20.5
Axis [ 0.8660 0.4910 0.0910]
Angle 176.0000
}
We are done.
The SBbc.pts model is there:
http://jmmi.club.fr/celestia/MW/SBbc.pts.zip
I hope I did not forget anything