StelProjector.cpp   StelProjector.cpp 
skipping to change at line 203 skipping to change at line 203
if (!ok) if (!ok)
{ {
// Special case for handling degenerated cases, use full sky . // Special case for handling degenerated cases, use full sky .
//qDebug() << "!ok"; //qDebug() << "!ok";
return SphericalRegionP((SphericalRegion*)(new AllSkySpheric alRegion())); return SphericalRegionP((SphericalRegion*)(new AllSkySpheric alRegion()));
} }
e0.normalize(); e0.normalize();
e1.normalize(); e1.normalize();
e2.normalize(); e2.normalize();
e3.normalize(); e3.normalize();
if (needGlFrontFaceCW()) if (flipFrontBackFace())
{ {
Vec3d v = e0; Vec3d v = e0;
e0 = e3; e0 = e3;
e3 = v; e3 = v;
v = e1; v = e1;
e1 = e2; e1 = e2;
e2 = v; e2 = v;
} }
const double d = e3*((e2-e3)^(e1-e3)); const double d = e3*((e2-e3)^(e1-e3));
if (d > 0) if (d > 0)
skipping to change at line 243 skipping to change at line 243
float StelProjector::getPixelPerRadAtCenter() const float StelProjector::getPixelPerRadAtCenter() const
{ {
return pixelPerRad; return pixelPerRad;
} }
//! Get the current FOV diameter in degrees //! Get the current FOV diameter in degrees
float StelProjector::getFov() const { float StelProjector::getFov() const {
return 360.f/M_PI*viewScalingFactorToFov(0.5f*viewportFovDiameter/pi xelPerRad); return 360.f/M_PI*viewScalingFactorToFov(0.5f*viewportFovDiameter/pi xelPerRad);
} }
//! Get whether front faces need to be oriented in the clockwise direction
bool StelProjector::needGlFrontFaceCW() const
{
return (flipHorz*flipVert < 0.f);
}
bool StelProjector::checkInViewport(const Vec3d& pos) const bool StelProjector::checkInViewport(const Vec3d& pos) const
{ {
return (pos[1]>=viewportXywh[1] && pos[0]>=viewportXywh[0] && return (pos[1]>=viewportXywh[1] && pos[0]>=viewportXywh[0] &&
pos[1]<=(viewportXywh[1] + viewportXywh[3]) && pos[0]<=(view portXywh[0] + viewportXywh[2])); pos[1]<=(viewportXywh[1] + viewportXywh[3]) && pos[0]<=(view portXywh[0] + viewportXywh[2]));
} }
//! Check to see if a 2d position is inside the viewport. //! Check to see if a 2d position is inside the viewport.
//! TODO Optimize by storing viewportXywh[1] + viewportXywh[3] and viewport Xywh[0] + viewportXywh[2] already computed //! TODO Optimize by storing viewportXywh[1] + viewportXywh[3] and viewport Xywh[0] + viewportXywh[2] already computed
bool StelProjector::checkInViewport(const Vec3f& pos) const bool StelProjector::checkInViewport(const Vec3f& pos) const
{ {
skipping to change at line 458 skipping to change at line 452
{ {
return project(v1, win1) && project(v2, win2) && (checkInViewport(wi n1) || checkInViewport(win2)); return project(v1, win1) && project(v2, win2) && (checkInViewport(wi n1) || checkInViewport(win2));
} }
//! Get the current model view matrix. //! Get the current model view matrix.
StelProjector::ModelViewTranformP StelProjector::getModelViewTransform() co nst StelProjector::ModelViewTranformP StelProjector::getModelViewTransform() co nst
{ {
return modelViewTransform; return modelViewTransform;
} }
//! Get the current projection matrix.
Mat4f StelProjector::getProjectionMatrix() const
{
return Mat4f(2.f/viewportXywh[2], 0, 0, 0, 0, 2.f/viewportXywh[3], 0
, 0, 0, 0, -1., 0., -(2.f*viewportXywh[0] + viewportXywh[2])/viewportXywh[2
], -(2.f*viewportXywh[1] + viewportXywh[3])/viewportXywh[3], 0, 1);
}
StelProjector::StelProjectorMaskType StelProjector::getMaskType(void) const StelProjector::StelProjectorMaskType StelProjector::getMaskType(void) const
{ {
return maskType; return maskType;
} }
 End of changes. 3 change blocks. 
15 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/