const getFovFromFocal in shot.h

This commit is contained in:
alemuntoni 2021-07-13 12:36:04 +02:00
parent fdabe1aead
commit cfe0511f35
1 changed files with 2 additions and 2 deletions

View File

@ -127,7 +127,7 @@ public:
void SetViewPoint(const vcg::Point3<S> & viewpoint);
/// GET fov from focal
float GetFovFromFocal();
float GetFovFromFocal() const;
/// look at (point+up)
void LookAt(const vcg::Point3<S> & point,const vcg::Point3<S> & up);
@ -256,7 +256,7 @@ void Shot<S,RotationType>::SetViewPoint(const vcg::Point3<S> & viewpoint)
/// GET fov from focal
template <class S, class RotationType>
float Shot<S,RotationType>::GetFovFromFocal()
float Shot<S,RotationType>::GetFovFromFocal() const
{
double viewportYMm= Intrinsics.PixelSizeMm[1]* Intrinsics.ViewportPx[1];
return 2*(vcg::math::ToDeg(atanf(viewportYMm/(2*Intrinsics.FocalMm))));