Added planetary distance to GsweAspectData structure
This commit is contained in:
parent
c25d078b7d
commit
dc94217a70
@ -610,18 +610,17 @@ static gboolean
|
|||||||
find_aspect(gpointer aspect_p, GsweAspectInfo *aspect_info, GsweAspectData *aspect_data)
|
find_aspect(gpointer aspect_p, GsweAspectInfo *aspect_info, GsweAspectData *aspect_data)
|
||||||
{
|
{
|
||||||
GsweAspect aspect = GPOINTER_TO_INT(aspect_p);
|
GsweAspect aspect = GPOINTER_TO_INT(aspect_p);
|
||||||
gdouble distance,
|
gdouble diff,
|
||||||
diff,
|
|
||||||
planet_orb,
|
planet_orb,
|
||||||
aspect_orb;
|
aspect_orb;
|
||||||
|
|
||||||
distance = fabs(aspect_data->planet1->position - aspect_data->planet2->position);
|
aspect_data->distance = fabs(aspect_data->planet1->position - aspect_data->planet2->position);
|
||||||
|
|
||||||
if (distance > 180.0) {
|
if (aspect_data->distance > 180.0) {
|
||||||
distance = 360.0 - distance;
|
aspect_data->distance = 360.0 - aspect_data->distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
diff = fabs(aspect_info->size - distance);
|
diff = fabs(aspect_info->size - aspect_data->distance);
|
||||||
planet_orb = fmin(aspect_data->planet1->planet_info->orb, aspect_data->planet2->planet_info->orb);
|
planet_orb = fmin(aspect_data->planet1->planet_info->orb, aspect_data->planet2->planet_info->orb);
|
||||||
aspect_orb = fmax(1.0, planet_orb - aspect_info->orb_modifier);
|
aspect_orb = fmax(1.0, planet_orb - aspect_info->orb_modifier);
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@ typedef struct {
|
|||||||
GswePlanetData *planet1;
|
GswePlanetData *planet1;
|
||||||
GswePlanetData *planet2;
|
GswePlanetData *planet2;
|
||||||
GsweAspect aspect;
|
GsweAspect aspect;
|
||||||
|
gdouble distance;
|
||||||
gdouble difference;
|
gdouble difference;
|
||||||
GsweAspectInfo *aspect_info;
|
GsweAspectInfo *aspect_info;
|
||||||
} GsweAspectData;
|
} GsweAspectData;
|
||||||
|
Loading…
Reference in New Issue
Block a user