Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/distort/fisheyeLens.h

Go to the documentation of this file.
00001 // Filename: fisheyeLens.h
00002 // Created by:  drose (12Dec01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef FISHEYELENS_H
00020 #define FISHEYELENS_H
00021 
00022 #include "pandabase.h"
00023 
00024 #include "lens.h"
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //       Class : FisheyeLens
00028 // Description : A fisheye lens.  This nonlinear lens introduces a
00029 //               spherical distortion to the image, which is minimal
00030 //               at small angles from the lens, and increases at
00031 //               larger angles from the lens.  The field of view may
00032 //               extend to 360 degrees.
00033 ////////////////////////////////////////////////////////////////////
00034 class EXPCL_PANDAFX FisheyeLens : public Lens {
00035 PUBLISHED:
00036   INLINE FisheyeLens();
00037 
00038 public:
00039   INLINE FisheyeLens(const FisheyeLens &copy);
00040   INLINE void operator = (const FisheyeLens &copy);
00041 
00042 public:
00043   virtual PT(Lens) make_copy() const;
00044 
00045 protected:
00046   virtual bool extrude_impl(const LPoint3f &point2d,
00047                             LPoint3f &near_point, LPoint3f &far_point) const;
00048   virtual bool project_impl(const LPoint3f &point3d, LPoint3f &point2d) const;
00049 
00050   virtual float fov_to_film(float fov, float focal_length, bool horiz) const;
00051   virtual float fov_to_focal_length(float fov, float film_size, bool horiz) const;
00052   virtual float film_to_fov(float film_size, float focal_length, bool horiz) const;
00053 
00054 public:
00055   virtual TypeHandle get_type() const {
00056     return get_class_type();
00057   }
00058   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00059   static TypeHandle get_class_type() {
00060     return _type_handle;
00061   }
00062   static void init_type() {
00063     Lens::init_type();
00064     register_type(_type_handle, "FisheyeLens",
00065                   Lens::get_class_type());
00066   }
00067 
00068 private:
00069   static TypeHandle _type_handle;
00070 };
00071 
00072 #include "fisheyeLens.I"
00073 
00074 #endif

Generated on Fri May 2 00:36:39 2003 for Panda by doxygen1.3