20 #ifndef _STELPROJECTIONS_HPP_ 21 #define _STELPROJECTIONS_HPP_ 23 #include "StelProjector.hpp" 71 for (
int i = 0; i < n; ++i, ++out)
74 modelViewTransform->forward(v);
75 out->set(v[0], v[1], v[2]);
77 out->set(viewportCenter[0] + flipHorz * pixelPerRad * (*out)[0],
78 viewportCenter[1] + flipVert * pixelPerRad * (*out)[1],
79 ((*out)[2] - zNear) * oneOverZNearMinusZFar);
122 for (
int i = 0; i < n; ++i)
125 modelViewTransform->forward(v);
126 out[i].set(v[0], v[1], v[2]);
128 out[i][0] = viewportCenter[0] + flipHorz * pixelPerRad * out[i][0];
129 out[i][1] = viewportCenter[1] + flipVert * pixelPerRad * out[i][1];
130 out[i][2] = (out[i][2] - zNear) * oneOverZNearMinusZFar;
147 return cap.intersects(cap1) && cap.intersects(cap2) && cap.intersects(cap3);
157 virtual float getMaxFov()
const {
return 175.f * 4.f/3.f;}
167 return p1[0]*p2[0]<0 && !(p1[2]<0 && p2[2]<0);
175 return cap.intersects(cap1) && cap.intersects(cap2) && cap.intersects(cap2);
185 virtual float getMaxFov()
const {
return 175.f * 4.f/3.f;}
195 return p1[0]*p2[0]<0 && !(p1[2]<0 && p2[2]<0);
203 return cap.intersects(cap1) && cap.intersects(cap2) && cap.intersects(cap2);
241 virtual float getMaxFov()
const {
return 175.f * 4.f/3.f;}
265 #endif // _STELPROJECTIONS_HPP_ bool project(const Vec3d &v, Vec3d &win) const
Project the vector v from the current frame into the viewport.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &capN, double capD) const
Determine whether a cap intersects with a projection discontinuity.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
float deltaZoom(float fov) const
Return the small zoom increment to use at the given FOV for nice movements.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
float viewScalingFactorToFov(float vsf) const
Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians.
A SphericalCap is defined by a direction and an aperture.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
bool forward(Vec3f &v) const
Apply the transformation in the forward direction in place.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &capN, double capD) const
Determine whether a cap intersects with a projection discontinuity.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
bool backward(Vec3d &v) const
Apply the transformation in the backward projection in place.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &p1, const Vec3d &p2) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
StelProjector(ModelViewTranformP amodelViewTransform)
Private constructor. Only StelCore can create instances of StelProjector.
bool forward(Vec3f &v) const
Apply the transformation in the forward direction in place.
virtual QString getDescriptionI18() const
Get a human-readable short description for this projection type.
Provide the main interface to all operations of projecting coordinates from sky to screen...
float fovToViewScalingFactor(float fov) const
Convert a Field Of View radius value in radians in ViewScalingFactor (used internally) ...
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &p1, const Vec3d &p2) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
bool forward(Vec3f &v) const
Apply the transformation in the forward direction in place.
QSharedPointer< ModelViewTranform > ModelViewTranformP
Shared pointer on a ModelViewTranform instance (implement reference counting)
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
virtual void computeBoundingCap()
Initialize the bounding cap.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &capN, double capD) const
Determine whether a cap intersects with a projection discontinuity.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual QString getNameI18() const
Get a human-readable name for this projection type.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &p1, const Vec3d &p2) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...