Page 2 of 2

Re: Rigebi (G3) stations issue

Posted: Thu Aug 09, 2012 2:45 pm
by Eric Walch
Wildeblood wrote:
The quickest, simplest fix for this until either Taxi Galactica or Galactic Navy are updated, is to add the Sensible Sun micro-OXP. The two stations should then be spawned well apart.
That would work. It also reveals a bug in the way Taxi defines its position. It should be a station in planet orbit. But the location depends on the planet-sun distance. A distance based on planes radii seems better for an orbiting station.
Probably it should use the positioning of the secCom station but a bit out of the centre:

Code: Select all

Vector3D(0, 0.15, 2).fromCoordinateSystem("psp")
That will still position it at the sunny side of the planet and roughly at 2 planet radii hight, but now a bit aside from the direct line.

(For geeks: To keep it exactly at 2 radii, the 3th parameter should be Math.sqrt(2*2 - 0.15*0.15) = 1.9943)

Re: Rigebi (G3) stations issue

Posted: Thu Aug 09, 2012 11:41 pm
by ilNibbio
The good people make the good game.
Chapeau

Re: Rigebi (G3) stations issue

Posted: Sat Aug 11, 2012 10:34 am
by JensAyton
Incidentally, if you want to position a station randomly around a planet instead of at a fixed position, here’s how:

Code: Select all

let azimuth = Math.random() * 2 * Math.PI;
let elevation = 0.1 * (Math.random() - 0.5);  // .05 planetary radii of the equator either way
let altitude = 0.1 * (Math.random() - 0.5) + 2.2;  // 2.15 to 2.25 planetary radii

elevation *= planet.radius;
altitude *= planet.radius;

let position = new Vector3D(Math.sin(azimuth) * altitude, Math.cos(azimuth) * altitude, elevation);
station.position = position.add(planet);
Vary the altitude range slightly to avoid collisions.

Re: Rigebi (G3) stations issue

Posted: Sun Aug 12, 2012 8:55 am
by Pleb
Ah the code that Ahruman has posted above seems to be a good idea. I will try this out and if it does not conflict with any other OXP I will implement it into the next release of Taxi Galactica. Thanks for that, Ahruman!