Body masses

The place to discuss creating, porting and modifying Celestia's source code.
Guest

Body masses

Post #1by Guest » 17.04.2002, 07:32

I've been working on adding gravity effects to the observer in celestia.

Each body has a mass variable but i cant find it being set anywhere.

the method body->setMass(float) is not used in the source (so far as i can find in ver 1.2.0)

Is the mass data available in the data files?
if not, how can i add mass information to the data files? im assuming they are the *.SSC files.

I understand that the mass for stars may not be available. I pland to approximate it using a stars class.

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 11 months
Location: Outback Australia

Marc posted this

Post #2by marc » 17.04.2002, 07:34

Whoops forgot to logon.
Anonymous was me Marc.

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 11 months
Location: Outback Australia

minor success.

Post #3by marc » 17.04.2002, 08:47

i added this to solarsys.cpp line 244

double mass = 1;
if(planetData->getNumber("Mass", mass))
body->setMass(mass);

and have also been adding mass entries to the *.ssc files.
Didnt realise they were a text file.
Next step modify simulation.

does anyone know of a nice table which will relate masses to the star type?

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 23 years
Location: Seattle, Washington, USA

minor success.

Post #4by chris » 17.04.2002, 18:16

marc wrote:i added this to solarsys.cpp line 244

double mass = 1;
if(planetData->getNumber("Mass", mass))
body->setMass(mass);

and have also been adding mass entries to the *.ssc files.
Didnt realise they were a text file.
Next step modify simulation.

does anyone know of a nice table which will relate masses to the star type?

I'll write a Star::getMass method later today when I have access to my astro library.

--Chris


Return to “Development”