Re: [Celestia-developers] Star orbits
Real-time 3D visualization of space
Status: Beta
Brought to you by:
cjlaurel
From: Chris L. <cl...@ww...> - 2004-10-02 09:48:08
|
In my latest checkin, I changed the function astrocentricPosition to=20 accept a const position argument. I think that this should fix the=20 problem. If it doesn't, let me know and I'll switch to using a temporary= =20 variable. --Chris On Sat, 2 Oct 2004, Christophe Teyssier wrote: > Le Mardi 28 Septembre 2004 09:24, Chris Laurel a =E9crit=A0: > > Another day, another big change to the star code . . . > > > > I've finally enabled star orbits. However, more work remains . . . >=20 > Chris, there's a small problem when compiling the latest star code with= gcc=20 > 3.4.1.=20 >=20 > gcc won't let you pass an implicit temporary variable by reference as i= n=20 > render.cpp:5372: > Point3d observerPos =3D solarSystemPosition(observer.getPosition(), > sun, now); >=20 > You either need to use an explicit variable, or pass by value. >=20 > Here is a full diff using temporary variables : >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvsroot/celestia/celestia/src/celengine/render.cpp,v > retrieving revision 1.167 > diff -u -r1.167 render.cpp > --- render.cpp 29 Sep 2004 15:20:20 -0000 1.167 > +++ render.cpp 2 Oct 2004 08:57:50 -0000 > @@ -1381,7 +1381,8 @@ > enableSmoothLines(); >=20 > const Star* sun =3D solarSystem->getStar(); > - Point3d obsPos =3D solarSystemPosition(observer.getPosition(), > + UniversalCoord observerPosition =3D observer.getPosition(); > + Point3d obsPos =3D solarSystemPosition(observerPosition, > *sun, observer.getTime())= ; > glPushMatrix(); > glTranslatef((float) astro::kilometersToAU(-obsPos.x), > @@ -5369,7 +5370,8 @@ > bool showLabels) > { > Point3f starPos =3D sun.getPosition(); > - Point3d observerPos =3D solarSystemPosition(observer.getPosition()= , > + UniversalCoord observerPosition =3D observer.getPosition(); > + Point3d observerPos =3D solarSystemPosition(observerPosition, > sun, now); >=20 > int nBodies =3D solSystem.getSystemSize(); > @@ -5594,7 +5596,8 @@ > // This is a much more accurate (and expensive) distance > // calculation than the previous one which used the observ= er's > // position rounded off to floats. > - Point3d hPos =3D astrocentricPosition(observer->getPositio= n(), > + UniversalCoord observerPosition =3D observer->getPosition(= ); > + Point3d hPos =3D astrocentricPosition(observerPosition, > star, > observer->getTime()); > relPos =3D Vec3f((float) hPos.x, (float) hPos.y, (float) h= Pos.z) * >=20 >=20 |