The constructor of MyPlanet has an argument...
#define ORBITER_MODULE
#include "MyPlanet.h"
MyPlanet::MyPlanet(OBJHANDLE hObj) : CELBODY2(hObj)
{
// add constructor code here
}
void MyPlanet::clbkInit(FILEHANDLE cfg)
{
// read parameters from config file (e.g. tolerance limits, etc)
// perform any required initialisation (e.g. read perturbation terms from data files)
}
bool MyPlanet::bEphemeris() const
{
return true;
// class supports ephemeris calculation
}
int MyPlanet::clbkEphemeris(double mjd, int req, double *ret)
{
// return planet position and velocity for Modified Julian date mjd in ret
}
int MyPlanet::clbkFastEphemeris(double simt, int req, double *ret)
{
// return interpolated planet position and velocity for simulation time simt in ret
return 0;// or whatever should it be
}
DLLCLBK CELBODY *InitInstance(OBJHANDLE hBody)
{
// instance initialisation
return new MyPlanet;
}
DLLCLBK void ExitInstance(CELBODY *body)
{
// instance cleanup
delete (MyPlanet*)body;
}
DLLCLBK void InitModule(HINSTANCE hModule)
{
// module initialisation
}
DLLCLBK void ExitModule(HINSTANCE hModule)
{
// module cleanup
}
Yes, not sure why the errors
Thanks. Not sure what i need to put in the constructor
#define ORBITER_MODULE
#include "MyPlanet.h"
MyPlanet::MyPlanet(OBJHANDLE hObj) : CELBODY2(hObj)
{
// add constructor code here
}
void MyPlanet::clbkInit(FILEHANDLE cfg)
{
// read parameters from config file (e.g. tolerance limits, etc)
// perform any required initialisation (e.g. read perturbation terms from data files)
}
bool MyPlanet::bEphemeris() const
{
return true;
// class supports ephemeris calculation
}
int MyPlanet::clbkEphemeris(double mjd, int req, double *ret)
{
// return planet position and velocity for Modified Julian date mjd in ret
return 0;
}
int MyPlanet::clbkFastEphemeris(double simt, int req, double *ret)
{
// return interpolated planet position and velocity for simulation time simt in ret
return 0;// or whatever should it be
}
DLLCLBK CELBODY *InitInstance(OBJHANDLE hBody)
{
// instance initialisation
//return new MyPlanet;
return new MyPlanet(hBody);
}
DLLCLBK void ExitInstance(CELBODY *body)
{
// instance cleanup
delete (MyPlanet*)body;
}
DLLCLBK void InitModule(HINSTANCE hModule)
{
// module initialisation
}
DLLCLBK void ExitModule(HINSTANCE hModule)
{
// module cleanup
}
; === Configuration file for star Sun ===
Name = Gargantuanew
Module = SunG
ErrorLimit = 1e-6
SamplingInterval = 1497 ; interpolation sampling interval [s]
; (interpolation error ~1m)
Mass = 1.9889194444e+30
Size = 5.0232e7 ; mean radius
; === Configuration file for solar system ===
Name = Interstellar
Star1 = Gargantuanew
Planet1 = Miller
Planet2 = Mann
Planet3 = Pantagruel
Pantagruel:Moon1 = Edmunds
void MyPlanet::clbkInit (FILEHANDLE cfg)
{
// read parameters from config file (e.g. tolerance limits, etc)
// perform any required initialisation (e.g. read perturbation terms from data files)
}
void MyPlanet::clbkInit (FILEHANDLE cfg)
{
// read parameters from config file (e.g. tolerance limits, etc)
// perform any required initialisation (e.g. read perturbation terms from data files)
}
; === Configuration file for star Sun ===
Name = Gargantua
Module = MyPlanet
ErrorLimit = 1e-6
SamplingInterval = 1497 ; interpolation sampling interval [s]
; (interpolation error ~1m)
Mass = 1.9889194444e+30
Size = 5.0232e7 ; mean radius
; === Configuration file for solar system ===
Name = Interstellar
Star1 = Gargantua
Planet1 = Miller
Planet2 = Mann
Planet3 = Pantagruel
Pantagruel:Moon1 = Edmunds
Thanks.
Code:void MyPlanet::clbkInit (FILEHANDLE cfg) { // read parameters from config file (e.g. tolerance limits, etc) // perform any required initialisation (e.g. read perturbation terms from data files) }
So this reads the info from the cfg, right?
this is what I have for MyPlanet.cfg
Well, it depends entirely on how you calculate your ephemerides. For example, the VSOP87 objects read the data files with the coefficients of the series expansion here. They also read the config files (provided by the FILEHANDLE parameter) to check the required tolerance limits and how often to compute a full solution (rather than an interpolation).Thanks. But not sure what goes there
int MyPlanet::clbkFastEphemeris(double simt, int req, double *ret)
{
// return interpolated planet position and velocity for simulation time simt in ret
return 0;// or whatever should it be
}
Thanks. But we were working in Orbiter2010
oh. Well then we may have to wait for svn upgrade then for 2016.Then you are out of luck.