I think the answer is NO. But is there a way to make a new sun/star? So you can have 2 stars/sun.
This is for Orbiter2010?
This is for Orbiter2010?
; === Configuration file for star by Anroalh12 ===
Name = Gargantua
Module = Sun
ErrorLimit = 1e-6
SamplingInterval = 1497 ; interpolation sampling interval [s]
; (interpolation error ~1m)
Mass = 1.9889194444e+30
Size = 5.0232e7 ; mean radius
; === Configuration file for star by Anroalh12 ===
Name = Gargantua
Module = [COLOR="Red"]SunG[/COLOR]
ErrorLimit = 1e-6
SamplingInterval = 1497 ; interpolation sampling interval [s]
; (interpolation error ~1m)
Mass = 1.9889194444e+30
Size = 5.0232e7 ; mean radius
The real problem is the computation of the planet orbits. Any series expansion solution will be very expensive w.r.t. the number of terms you need (in particular if they orbit in the stars' near field), and it will only be valid for a short period of time, so you may need to patch several solutions together (making sure that the transitions of the state vectors are continuous across the patches).
But simce one can do open a .dll to get the code. Not sure how to do that
#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 clbkEphemeris(double mjd, int req, double *ret)
{
// return planet position and velocity for Modified Julian date mjd in ret
}
int clbkFastEphemeris(double simt, int req, double *ret)
{
// return interpolated planet position and velocity for simulation time simt in ret
}
DLLCKBK 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
}
#include "OrbiterAPI.h"
#include "CelbodyAPI.h"
class DLLEXPORT MyPlanet : public CELBODY2 {
public:
MyPlanet(OBJHANDLE hObj);
void clbkInit(FILEHANDLE cfg);
int clbkEphemeris(double mjd, int req, double *ret);
int clbkFastEphemeris(double simt, int req, double *ret);
};
This means exactly what it says: you haven't declared the bEphemeris function in the header file.Error 1 error C2509: 'bEphemeris' : member function not declared in 'MyPlanet'
Thanks. But it is declared in CelbodyAPI.h
Even if I add CelbodyAPI.h into my project I get those errors.
not sure about this line:
Add orbiter.lib and orbitersdk.lib
as additional dependencies.
So this is how I get it set up. Following the set up in the api guide.
![]()
4 IntelliSense: inherited member is not allowed c:\orbiter100830\Orbitersdk\samples\NEWSUN\MyPlanet.CPP 13 16 MyPlanet
void bEphemeris() const;
MyPlanet::
#include "OrbiterAPI.h"
#include "CelbodyAPI.h"
class DLLEXPORT MyPlanet : public CELBODY2 {
public:
MyPlanet(OBJHANDLE hObj);
void clbkInit(FILEHANDLE cfg);
MyPlanet::int clbkEphemeris(double mjd, int req, double *ret);
MyPlanet::int clbkFastEphemeris(double simt, int req, double *ret);
void bEphemeris() const;
};
#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 clbkEphemeris(double mjd, int req, double *ret)
{
// return planet position and velocity for Modified Julian date mjd in ret
}
int clbkFastEphemeris(double simt, int req, double *ret)
{
// return interpolated planet position and velocity for simulation time simt in ret
}
DLLCKBK 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
}
#include "OrbiterAPI.h"
#include "CelbodyAPI.h"
class DLLEXPORT MyPlanet : public CELBODY2 {
public:
MyPlanet(OBJHANDLE hObj);
void clbkInit(FILEHANDLE cfg);
int clbkEphemeris(double mjd, int req, double *ret);
int clbkFastEphemeris(double simt, int req, double *ret);
bool bEphemeris() const;
};
#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 [COLOR="red"]MyPlanet::[/COLOR]clbkEphemeris(double mjd, int req, double *ret)
{
// return planet position and velocity for Modified Julian date mjd in ret
}
int [COLOR="Red"]MyPlanet::[/COLOR]clbkFastEphemeris(double simt, int req, double *ret)
{
// return interpolated planet position and velocity for simulation time simt in ret
[COLOR="red"]return 0;// or whatever should it be[/COLOR]
}
DLLCKBK 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
}
#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
}
DLLCKBK 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
}
DLLCLBK CELBODY *InitInstance(OBJHANDLE hBody)
{
// instance initialisation
return new MyPlanet;
}
MyPlanet::MyPlanet(OBJHANDLE hObj) : CELBODY2(hObj)
{
// add constructor code here
}