Page 1 of 1
Modify and Barycenters
Posted: 17.01.2009, 00:31
by ajtribick
SVN 4599
Is it supposed to be possible to convert a star into a barycenter via Modify (or vice-versa)? The following .stc will result in Arcturus being turned into a sphere with uninitialised texture (seems to depend on what textures have been loaded). The information display gives it as a star with class "Bary" (complete with magnitudes, radius, temperature) rather than a Barycenter entry...
Code: Select all
# convert Arcturus into a barycenter
Modify Barycenter 69673
{
}
Re: Modify and Barycenters
Posted: 19.01.2009, 17:35
by chris
ajtribick wrote:SVN 4599
Is it supposed to be possible to convert a star into a barycenter via Modify (or vice-versa)? The following .stc will result in Arcturus being turned into a sphere with uninitialised texture (seems to depend on what textures have been loaded). The information display gives it as a star with class "Bary" (complete with magnitudes, radius, temperature) rather than a Barycenter entry...
Code: Select all
# convert Arcturus into a barycenter
Modify Barycenter 69673
{
}
Yes, this is intended to work. It should be possible to override a single star definition and convert it into a multistart system, e.g. Sirius to Sirius, Sirius A, and Sirius B. I'll look into this today (as soon as I've sorted out the cmod bug you reported.)
--Chris
Re: Modify and Barycenters
Posted: 19.01.2009, 20:41
by Chuft-Captain
To: "the artist formerly known as chaos_syndrome"
You may find it helpful to download and examine my Castor addon:
http://shatters.net/forum/viewtopic.php?f=6&t=12104&st=0&sk=t&sd=aDownload here:
http://celestiamotherlode.net/catalog/show_addon_details.php?addon_id=1281Latest build I've run it in is 4585. I hope it still works in 4599.
CC
Re: Modify and Barycenters
Posted: 19.01.2009, 21:28
by ajtribick
The add-on doesn't use Modify therefore doesn't trigger the bug.
Re: Modify and Barycenters
Posted: 20.01.2009, 05:48
by chris
I've attached a small patch to stardb.cpp that fixes the bug and makes stars convertable to barycenters (and vice versa) with Modify. The patch affects two lines of code: one is the functional change, the other just fixes a typo in a comment.
...Well, phpbb doesn't want to let me attach a patch file, so here it is inline:
Code: Select all
Index: stardb.cpp
===================================================================
--- stardb.cpp (revision 4582)
+++ stardb.cpp (working copy)
@@ -823,7 +823,7 @@
{
StarDetails* existingDetails = star->getDetails();
- // If we're modifying and existing star and it already has a
+ // If we're modifying an existing star and it already has a
// customized details record, we'll just modify that.
if (!existingDetails->shared())
{
@@ -839,6 +839,7 @@
existingDetails->setTexture(details->getTexture());
if ((existingDetails->getKnowledge() & StarDetails::KnowRotation) == 0)
existingDetails->setRotationModel(details->getRotationModel());
+ existingDetails->setVisibility(details->getVisibility());
}
details = existingDetails;
--Chris
Re: Modify and Barycenters
Posted: 20.01.2009, 06:34
by Chuft-Captain
ajtribick wrote:The add-on doesn't use Modify therefore doesn't trigger the bug.
It was offered as a workaround, however I'm pretty sure that if you change the addon to use a "Modify" it still works...at least prior to build 4599 anyway.
CC
Re: Modify and Barycenters
Posted: 21.01.2009, 23:31
by chris
Andrew, have you had a chance to see if my patch works for you? I'll commit it once you've verified it.
--Chris
Re: Modify and Barycenters
Posted: 23.01.2009, 20:37
by ajtribick
Sorry, a variety of circumstances conspired to prevent me from testing it until now. As far as I can tell it works fine.
Re: Modify and Barycenters
Posted: 23.01.2009, 23:20
by chris
ajtribick wrote:Sorry, a variety of circumstances conspired to prevent me from testing it until now. As far as I can tell it works fine.
Thanks. I'll go ahead and check it in.
--Chris