Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Development
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Development Developers post news, updates, & discussions here about your projects in development.

Reply
 
Thread Tools
Old 12-18-2017, 02:44 PM   #31
mrozigor
Donator
Default

Quote:
Originally Posted by gattispilot View Post
 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
This is the function which is proper for initialization. But you have to fill it with code you want. Those two lines are only comments.
mrozigor is offline   Reply With Quote
Thanked by:
Old 12-18-2017, 03:31 PM   #32
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Thanks. But not sure what goes there

Can't seem to find an example

Last edited by gattispilot; 12-18-2017 at 06:13 PM.
gattispilot is offline   Reply With Quote
Old 12-18-2017, 07:45 PM   #33
martins
Orbiter Founder
Default

Quote:
Originally Posted by gattispilot View Post
 Thanks. But not sure what goes there
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).

Since you haven't actually implemented your ephemerides code yet ("return 0") I can't say what you need. Note that clbkEphemeris() should probably do better than just return 0. Not returning any state vectors may lead to undefined behaviour. In the best case it will just keep your object in the origin, which should be a fairly good approximation for a massive star or a black hole, depending on what is orbiting it. But you better check that this is really what's happening, since it is undocumented.

You may want to read the API documentation (Orbitersdk\doc\API_Reference.chm) for the CELBODY and CELBODY2 classes. This tells you what the various callback functions are expected to return.

On another note: I may have lost the plot somewhere in this thread, but did you say that you want to generate a DLL just to change the texture? This is not what the celbody DLL does. It is meant to provide the object's state vectors (via clbkEphemerides) on demand, and if required, the atmospheric parameters at a given point, using the CelBody2 interface. The texture file is currently hard-coded to star.dds. I can change that if required, but it's really just eye-candy. Currently stars don't even use a mesh, just a billboard texture.
martins is offline   Reply With Quote
Thanked by:
Old 12-18-2017, 08:06 PM   #34
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Thanks. Well I think we need 2 stars. One that uses the star.dds for the orbiter solar system and then another that uses a new star texture for the interstellar world.

Code:
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
}
I think if we had a way to have star1 use star.dds and star2 use another texture

Last edited by gattispilot; 12-18-2017 at 11:26 PM.
gattispilot is offline   Reply With Quote
Old 12-19-2017, 03:43 AM   #35
BenSisko
Donator
 
BenSisko's Avatar
Default

Gattispilot has been working with me and a few other Orbiteers to create the look (if not the physics) of the Gargantua-Pantagruel system ultimately for an add-on of the ships from Interstellar. We're using add-ons from Anroalh12 https://www.orbithangar.com/searchid.php?ID=6745 for the Interstellar system and olrik jhor https://www.orbithangar.com/search_q...15&submit.y=11 for the Gargantua texture. Anroalh12 has set up the system well but the only way to achieve the appearance of Gargantua is to replace the star texture (star.dds) with the Gargantua texture. Unfortunately, this makes all the primary planetary system stars in your Orbiter installation appear as Gargantua. We were looking for a way to create the "eye candy" of Gargantua only for the Gargantua-Pantagruel system yet not alter the primary star for any other system that might be in one's Orbiter installation.
BenSisko is offline   Reply With Quote
Thanked by:
Old 12-19-2017, 10:48 AM   #36
martins
Orbiter Founder
Default

OK, I understand. As I said, in Orbiter 2016 the star texture is a billboard hardcoded to read from star.dds. I can change this in the next SVN commit to allow a config-defined file name. This will still be a billboard, so will look OK only if the object is spherically symmetric (which I understand may not be the case for your project) and as long as you don't get too close.

Eventually I would like to support mesh-based visuals for the central star(s) as well to fix these limitations, but that is a bit further down the line.
martins is offline   Reply With Quote
Thanked by:
Old 12-19-2017, 11:05 AM   #37
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Thanks. But we were working in Orbiter2010
gattispilot is offline   Reply With Quote
Old 12-19-2017, 11:09 AM   #38
martins
Orbiter Founder
Default

Quote:
Originally Posted by gattispilot View Post
 Thanks. But we were working in Orbiter2010
Then you are out of luck.
martins is offline   Reply With Quote
Thanked by:
Old 12-19-2017, 11:28 AM   #39
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by martins View Post
 Then you are out of luck.
oh. Well then we may have to wait for svn upgrade then for 2016.

And do a switch for 2010
gattispilot is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Addon Development


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 07:01 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.