00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef FISHEYELENS_H
00020 #define FISHEYELENS_H
00021
00022 #include "pandabase.h"
00023
00024 #include "lens.h"
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class EXPCL_PANDAFX FisheyeLens : public Lens {
00035 PUBLISHED:
00036 INLINE FisheyeLens();
00037
00038 public:
00039 INLINE FisheyeLens(const FisheyeLens ©);
00040 INLINE void operator = (const FisheyeLens ©);
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