Moved ephemeris files (subclasses of Orbit and RotationModel) into new celephem folder.

sensor-dev
Chris Laurel 2009-11-02 20:30:18 +00:00
parent debc9f3965
commit 4a03b52617
44 changed files with 253 additions and 160 deletions

View File

@ -430,14 +430,6 @@
RelativePath=".\src\celengine\constellation.cpp"
>
</File>
<File
RelativePath=".\src\celengine\customorbit.cpp"
>
</File>
<File
RelativePath=".\src\celengine\customrotation.cpp"
>
</File>
<File
RelativePath=".\src\celengine\dds.cpp"
>
@ -494,10 +486,6 @@
RelativePath=".\src\celengine\image.cpp"
>
</File>
<File
RelativePath=".\src\celengine\jpleph.cpp"
>
</File>
<File
RelativePath=".\src\celengine\location.cpp"
>
@ -534,10 +522,6 @@
RelativePath=".\src\celengine\nebula.cpp"
>
</File>
<File
RelativePath=".\src\celengine\nutation.cpp"
>
</File>
<File
RelativePath=".\src\celengine\observer.cpp"
>
@ -546,10 +530,6 @@
RelativePath=".\src\celengine\opencluster.cpp"
>
</File>
<File
RelativePath=".\src\celengine\orbit.cpp"
>
</File>
<File
RelativePath=".\src\celengine\overlay.cpp"
>
@ -566,10 +546,6 @@
RelativePath=".\src\celengine\planetgrid.cpp"
>
</File>
<File
RelativePath=".\src\celengine\precession.cpp"
>
</File>
<File
RelativePath=".\src\celengine\regcombine.cpp"
>
@ -586,34 +562,10 @@
RelativePath=".\src\celengine\renderglsl.cpp"
>
</File>
<File
RelativePath=".\src\celengine\rotation.cpp"
>
</File>
<File
RelativePath=".\src\celengine\rotationmanager.cpp"
>
</File>
<File
RelativePath=".\src\celengine\samporbit.cpp"
>
</File>
<File
RelativePath=".\src\celengine\samporient.cpp"
>
</File>
<File
RelativePath=".\src\celengine\scriptobject.cpp"
>
</File>
<File
RelativePath=".\src\celengine\scriptorbit.cpp"
>
</File>
<File
RelativePath=".\src\celengine\scriptrotation.cpp"
>
</File>
<File
RelativePath=".\src\celengine\selection.cpp"
>
@ -638,18 +590,6 @@
RelativePath=".\src\celengine\spheremesh.cpp"
>
</File>
<File
RelativePath=".\src\celengine\spiceinterface.cpp"
>
</File>
<File
RelativePath=".\src\celengine\spiceorbit.cpp"
>
</File>
<File
RelativePath=".\src\celengine\spicerotation.cpp"
>
</File>
<File
RelativePath=".\src\celengine\star.cpp"
>
@ -726,10 +666,6 @@
RelativePath=".\src\celengine\visibleregion.cpp"
>
</File>
<File
RelativePath=".\src\celengine\vsop87.cpp"
>
</File>
</Filter>
<Filter
Name="glew"
@ -747,6 +683,74 @@
>
</File>
</Filter>
<Filter
Name="celephem"
>
<File
RelativePath=".\src\celephem\customorbit.cpp"
>
</File>
<File
RelativePath=".\src\celephem\customrotation.cpp"
>
</File>
<File
RelativePath=".\src\celephem\jpleph.cpp"
>
</File>
<File
RelativePath=".\src\celephem\nutation.cpp"
>
</File>
<File
RelativePath=".\src\celephem\orbit.cpp"
>
</File>
<File
RelativePath=".\src\celephem\precession.cpp"
>
</File>
<File
RelativePath=".\src\celephem\rotation.cpp"
>
</File>
<File
RelativePath=".\src\celephem\samporbit.cpp"
>
</File>
<File
RelativePath=".\src\celephem\samporient.cpp"
>
</File>
<File
RelativePath=".\src\celephem\scriptobject.cpp"
>
</File>
<File
RelativePath=".\src\celephem\scriptorbit.cpp"
>
</File>
<File
RelativePath=".\src\celephem\scriptrotation.cpp"
>
</File>
<File
RelativePath=".\src\celephem\spiceinterface.cpp"
>
</File>
<File
RelativePath=".\src\celephem\spiceorbit.cpp"
>
</File>
<File
RelativePath=".\src\celephem\spicerotation.cpp"
>
</File>
<File
RelativePath=".\src\celephem\vsop87.cpp"
>
</File>
</Filter>
</Filter>
<Filter
Name="Header Files"
@ -1425,6 +1429,74 @@
>
</File>
</Filter>
<Filter
Name="celephem"
>
<File
RelativePath=".\src\celephem\customorbit.h"
>
</File>
<File
RelativePath=".\src\celephem\customrotation.h"
>
</File>
<File
RelativePath=".\src\celephem\jpleph.h"
>
</File>
<File
RelativePath=".\src\celephem\nutation.h"
>
</File>
<File
RelativePath=".\src\celephem\orbit.h"
>
</File>
<File
RelativePath=".\src\celephem\precession.h"
>
</File>
<File
RelativePath=".\src\celephem\rotation.h"
>
</File>
<File
RelativePath=".\src\celephem\samporbit.h"
>
</File>
<File
RelativePath=".\src\celephem\samporient.h"
>
</File>
<File
RelativePath=".\src\celephem\scriptobject.h"
>
</File>
<File
RelativePath=".\src\celephem\scriptorbit.h"
>
</File>
<File
RelativePath=".\src\celephem\scriptrotation.h"
>
</File>
<File
RelativePath=".\src\celephem\spiceinterface.h"
>
</File>
<File
RelativePath=".\src\celephem\spiceorbit.h"
>
</File>
<File
RelativePath=".\src\celephem\spicerotation.h"
>
</File>
<File
RelativePath=".\src\celephem\vsop87.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="Resource Files"

View File

@ -10,19 +10,19 @@
#ifndef _CELENGINE_BODY_H_
#define _CELENGINE_BODY_H_
#include <celengine/surface.h>
#include <celengine/star.h>
#include <celengine/location.h>
#include <celengine/timeline.h>
#include <celephem/rotation.h>
#include <celephem/orbit.h>
#include <celutil/utf8.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <celutil/utf8.h>
#include <celengine/surface.h>
#include <celengine/orbit.h>
#include <celengine/star.h>
#include <celengine/location.h>
#include <celengine/rotation.h>
#include <celengine/timeline.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
class ReferenceFrame;
class Body;

View File

@ -10,21 +10,21 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
#include <cassert>
#include <celutil/debug.h>
#include "parseobject.h"
#include "customorbit.h"
#include "customrotation.h"
#include "spiceorbit.h"
#include "spicerotation.h"
#include "scriptorbit.h"
#include "scriptrotation.h"
#include "frame.h"
#include "trajmanager.h"
#include "rotationmanager.h"
#include "universe.h"
#include "eigenport.h"
#include <celephem/customorbit.h>
#include <celephem/customrotation.h>
#include <celephem/spiceorbit.h>
#include <celephem/spicerotation.h>
#include <celephem/scriptorbit.h>
#include <celephem/scriptrotation.h>
#include <celmath/geomutil.h>
#include <celutil/debug.h>
#include <cassert>
using namespace Eigen;
using namespace std;

View File

@ -7,14 +7,13 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
#include "rotationmanager.h"
#include "celestia.h"
#include <celephem/samporient.h>
#include <celutil/debug.h>
#include <iostream>
#include <fstream>
#include "celestia.h"
#include <celutil/debug.h>
#include "samporient.h"
#include "rotationmanager.h"
using namespace std;

View File

@ -10,10 +10,10 @@
#ifndef CELENGINE_ROTATIONMANAGER_H_
#define CELENGINE_ROTATIONMANAGER_H_
#include <celephem/rotation.h>
#include <celutil/resmanager.h>
#include <string>
#include <map>
#include <celutil/resmanager.h>
#include <celengine/rotation.h>
class RotationModelInfo : public ResourceInfo<RotationModel>

View File

@ -13,9 +13,9 @@
#include <cstdio>
#include "celestia.h"
#include "astro.h"
#include "orbit.h"
#include "star.h"
#include "texmanager.h"
#include "celephem/orbit.h"
using namespace Eigen;
using namespace std;

View File

@ -17,8 +17,8 @@
#include <celengine/univcoord.h>
#include <celengine/celestia.h>
#include <celengine/stellarclass.h>
#include <celengine/rotation.h>
#include <celengine/multitexture.h>
#include <celephem/rotation.h>
#include <Eigen/Core>
#include <vector>

View File

@ -10,13 +10,13 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
#include <cassert>
#include "celengine/timelinephase.h"
#include "celengine/frame.h"
#include "celengine/orbit.h"
#include "celengine/rotation.h"
#include "celengine/universe.h"
#include "celengine/frametree.h"
#include "celephem/orbit.h"
#include "celephem/rotation.h"
#include <cassert>
TimelinePhase::TimelinePhase(Body* _body,

View File

@ -7,16 +7,15 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
#include "celestia.h"
#include "trajmanager.h"
#include <celephem/samporbit.h>
#include <celutil/debug.h>
#include <celutil/filetype.h>
#include <iostream>
#include <fstream>
#include <cassert>
#include "celestia.h"
#include <celutil/debug.h>
#include <celutil/filetype.h>
#include "samporbit.h"
#include "trajmanager.h"
using namespace std;

View File

@ -10,11 +10,11 @@
#ifndef CELENGINE_TRAJMANAGER_H_
#define CELENGINE_TRAJMANAGER_H_
#include <celephem/orbit.h>
#include <celephem/samporbit.h>
#include <string>
#include <map>
#include <celutil/resmanager.h>
#include <celengine/orbit.h>
#include <celengine/samporbit.h>
class TrajectoryInfo : public ResourceInfo<Orbit>

View File

@ -90,6 +90,7 @@ inline void glScale(const Vec3f& v)
glScalef(v.x, v.y, v.z);
}
#if 0
inline void glLightDirection(GLenum light, const Vec3f& dir)
{
glLightfv(light, GL_POSITION, &(Vec4f(dir.x, dir.y, dir.z, 0.0f).x));
@ -109,18 +110,18 @@ inline void glLightColor(GLenum light, GLenum which, const Vec4f& color)
{
glLightfv(light, which, &color.x);
}
#endif
inline void glLightColor(GLenum light, GLenum which, const Color& color)
{
glLightfv(light, which,
&(Vec4f(color.red(), color.green(), color.blue(), color.alpha()).x));
Eigen::Vector4f v(color.red(), color.green(), color.blue(), color.alpha());
glLightfv(light, which, v.data());
}
inline void glAmbientLightColor(const Color& color)
{
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,
&(Vec4f(color.red(), color.green(), color.blue(),
color.alpha()).x));
Eigen::Vector4f v(color.red(), color.green(), color.blue(), color.alpha());
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, v.data());
}

View File

@ -7,16 +7,16 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
#include "customorbit.h"
#include "vsop87.h"
#include "jpleph.h"
#include <celengine/astro.h>
#include <celmath/mathlib.h>
#include <celmath/geomutil.h>
#include <cassert>
#include <vector>
#include <fstream>
#include <iomanip>
#include <celmath/mathlib.h>
#include <celmath/geomutil.h>
#include "astro.h"
#include "customorbit.h"
#include "vsop87.h"
#include "jpleph.h"
using namespace Eigen;
using namespace std;

View File

@ -10,8 +10,8 @@
#ifndef _CUSTOMORBIT_H_
#define _CUSTOMORBIT_H_
#include "orbit.h"
#include <string>
#include <celengine/orbit.h>
Orbit* GetCustomOrbit(const std::string& name);

View File

@ -2,7 +2,7 @@
//
// Custom rotation models for Solar System bodies.
//
// Copyright (C) 2008, the Celestia Development Team
// Copyright (C) 2008-2009, the Celestia Development Team
// Initial version by Chris Laurel, claurel@gmail.com
//
// This program is free software; you can redistribute it and/or
@ -10,13 +10,13 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
#include "customrotation.h"
#include "rotation.h"
#include "precession.h"
#include <celengine/astro.h>
#include <celmath/geomutil.h>
#include <map>
#include <string>
#include <celengine/customrotation.h>
#include <celengine/rotation.h>
#include <celengine/astro.h>
#include <celengine/precession.h>
#include <celmath/geomutil.h>
using namespace Eigen;
using namespace std;

View File

@ -1,22 +1,22 @@
// orbit.cpp
//
// Copyright (C) 2001, Chris Laurel <claurel@shatters.net>
// Copyright (C) 2001-2009, the Celestia Development Team
// Original version by Chris Laurel <claurel@gmail.com>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
#include "orbit.h"
#include <celengine/body.h>
#include <celmath/mathlib.h>
#include <celmath/solve.h>
#include <celmath/geomutil.h>
#include <functional>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <celmath/mathlib.h>
#include <celmath/solve.h>
#include <celmath/geomutil.h>
#include "astro.h"
#include "orbit.h"
#include "body.h"
using namespace Eigen;
using namespace std;
@ -220,16 +220,15 @@ Vector3d EllipticalOrbit::velocityAtE(double E) const
if (eccentricity < 1.0)
{
double a = pericenterDistance / (1.0 - eccentricity);
double b = a * sqrt(1 - square(eccentricity));
double sinE = sin(E);
double cosE = cos(E);
x = -a * sinE;
y = a * sqrt(1 - square(eccentricity)) * cosE;
double meanMotion = 2.0 * PI / period;
double edot = meanMotion / (1 - eccentricity * cosE);
x *= edot;
y *= edot;
x = -a * sinE * edot;
y = b * cosE * edot;
}
else if (eccentricity > 1.0)
{
@ -287,14 +286,36 @@ double EllipticalOrbit::getBoundingRadius() const
}
void EllipticalOrbit::sample(double, double t, int nSamples,
void EllipticalOrbit::sample(double startTime, double duration, int nSamples,
OrbitSampleProc& proc) const
{
if (eccentricity >= 1.0)
#if 0
{
// Sample uniformly in time
for (int i = 0; i < nSamples; i++)
{
double tsamp = startTime + duration / nSamples;
proc.sample(tsamp, positionAtTime(tsamp), velocityAtTime(tsamp));
}
}
#endif
if (eccentricity >= 1.0 || 1)
{
double dE = 1 * PI / (double) nSamples;
// Sample uniformly in eccentric anomaly
double t = startTime - epoch;
double meanMotion = 2.0 * PI / period;
double M0 = meanAnomalyAtEpoch + t * meanMotion;
double E0 = eccentricAnomaly(M0);
double dE = 2 * PI / (double) nSamples;
for (int i = 0; i < nSamples; i++)
proc.sample(t, positionAtE(dE * i), velocityAtE(dE * i));
{
// Compute the time tag for this sample
double E = E0 + dE * i;
double M = E - eccentricity * sin(E); // Mean anomaly from ecc anomaly
double tsamp = startTime + (M - M0) * period / (2 * PI); // Time from mean anomaly
proc.sample(tsamp, positionAtE(E), velocityAtE(E));
}
}
else
{
@ -311,7 +332,7 @@ void EllipticalOrbit::sample(double, double t, int nSamples,
{
// Compute the time tag for this sample
double M = E - eccentricity * sin(E); // Mean anomaly from ecc anomaly
double tsamp = t + (M - M0) * period / (2 * PI); // Time from mean anomaly
double tsamp = startTime + (M - M0) * period / (2 * PI); // Time from mean anomaly
proc.sample(tsamp, positionAtE(E), velocityAtE(E));

View File

@ -13,6 +13,7 @@
#include "rotation.h"
#include <celmath/geomutil.h>
#include <celmath/mathlib.h>
#include <cmath>
using namespace Eigen;

View File

@ -11,7 +11,6 @@
#ifndef _CELENGINE_ROTATION_H_
#define _CELENGINE_ROTATION_H_
#include <celengine/astro.h>
#include <Eigen/Geometry>

View File

@ -1,6 +1,6 @@
// samporbit.cpp
//
// Copyright (C) 2002-2008, Celestia Development Team
// Copyright (C) 2002-2009, Celestia Development Team
// Original version by Chris Laurel <claurel@gmail.com>
//
// Trajectories based on unevenly spaced cartesian positions.
@ -10,6 +10,10 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
#include "orbit.h"
#include "samporbit.h"
#include <celengine/astro.h>
#include <celmath/mathlib.h>
#include <cmath>
#include <string>
#include <algorithm>
@ -17,10 +21,6 @@
#include <iostream>
#include <fstream>
#include <limits>
#include <celmath/mathlib.h>
#include <celengine/astro.h>
#include <celengine/orbit.h>
#include <celengine/samporbit.h>
using namespace Eigen;
using namespace std;

View File

@ -10,8 +10,8 @@
#ifndef _CELENGINE_SAMPORBIT_H_
#define _CELENGINE_SAMPORBIT_H_
#include "orbit.h"
#include <string>
#include <celengine/orbit.h>
enum TrajectoryInterpolation
{

View File

@ -11,8 +11,8 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
#include "samporient.h"
#include <Eigen/NewStdVector>
#include <celengine/samporient.h>
#include <celmath/mathlib.h>
#include <celmath/geomutil.h>
#include <cmath>

View File

@ -10,8 +10,8 @@
#ifndef _CELENGINE_SAMPORIENT_H_
#define _CELENGINE_SAMPORIENT_H_
#include "rotation.h"
#include <string>
#include <celengine/rotation.h>
extern RotationModel* LoadSampledOrientation(const std::string& name);

View File

@ -13,7 +13,7 @@
#define _CELENGINE_SCRIPTORBIT_H_
#include <celengine/parser.h>
#include <celengine/orbit.h>
#include "orbit.h"
struct lua_State;

View File

@ -13,7 +13,7 @@
#define _CELENGINE_SCRIPTROTATION_H_
#include <celengine/parser.h>
#include <celengine/rotation.h>
#include "rotation.h"
struct lua_State;

View File

@ -12,7 +12,7 @@
#include <iostream>
#include <cstdio>
#include "SpiceUsr.h"
#include "astro.h"
#include <celengine/astro.h>
#include "spiceorbit.h"
#include "spiceinterface.h"

View File

@ -12,9 +12,10 @@
#ifndef _CELENGINE_SPICEORBIT_H_
#define _CELENGINE_SPICEORBIT_H_
#include "orbit.h"
#include <string>
#include <list>
#include <celengine/orbit.h>
class SpiceOrbit : public CachingOrbit
{

View File

@ -10,14 +10,14 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
#include "spicerotation.h"
#include "spiceinterface.h"
#include <celengine/astro.h>
#include <celmath/geomutil.h>
#include "SpiceUsr.h"
#include <iostream>
#include <cstdio>
#include <limits>
#include "SpiceUsr.h"
#include "astro.h"
#include "spicerotation.h"
#include "spiceinterface.h"
#include <celmath/geomutil.h>
using namespace Eigen;
using namespace std;

View File

@ -13,10 +13,10 @@
#ifndef _CELENGINE_SPICEROTATION_H_
#define _CELENGINE_SPICEROTATION_H_
#include "rotation.h"
#include <celmath/quaternion.h>
#include <string>
#include <list>
#include <celmath/quaternion.h>
#include <celengine/rotation.h>
class SpiceRotation : public CachingRotationModel
{

View File

@ -15,7 +15,7 @@
#include <cmath>
#include <celmath/mathlib.h>
#include <celengine/astro.h>
#include <celengine/vsop87.h>
#include "vsop87.h"
using namespace Eigen;
using namespace std;

View File

@ -11,7 +11,7 @@
#define _CELENGINE_VSOP87_H_
#include <string>
#include <celengine/orbit.h>
#include "orbit.h"
extern Orbit* CreateVSOP87Orbit(const std::string& name);

View File

@ -36,7 +36,7 @@
#include <celengine/execution.h>
#include <celengine/cmdparser.h>
#include <celengine/multitexture.h>
#include <celengine/spiceinterface.h>
#include <celephem/spiceinterface.h>
#include <celengine/axisarrow.h>
#include <celengine/planetgrid.h>
#include <celengine/visibleregion.h>
@ -49,7 +49,7 @@
#include <celengine/eigenport.h>
#ifdef CELX
#include <celengine/scriptobject.h>
#include <celephem/scriptobject.h>
#endif
#ifdef _WIN32