00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef FISHEYELENS_H
00016 #define FISHEYELENS_H
00017
00018 #include "pandabase.h"
00019
00020 #include "lens.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 class EXPCL_PANDAFX FisheyeLens : public Lens {
00031 PUBLISHED:
00032 INLINE FisheyeLens();
00033
00034 public:
00035 INLINE FisheyeLens(const FisheyeLens ©);
00036 INLINE void operator = (const FisheyeLens ©);
00037
00038 public:
00039 virtual PT(Lens) make_copy() const;
00040
00041 protected:
00042 virtual bool do_extrude(const Lens::CData *lens_cdata, const LPoint3 &point2d,
00043 LPoint3 &near_point, LPoint3 &far_point) const;
00044 virtual bool do_extrude_vec(const Lens::CData *lens_cdata, const LPoint3 &point2d,
00045 LVector3 &vec) const;
00046 virtual bool do_project(const Lens::CData *lens_cdata,
00047 const LPoint3 &point3d, LPoint3 &point2d) const;
00048
00049 virtual PN_stdfloat fov_to_film(PN_stdfloat fov, PN_stdfloat focal_length, bool horiz) const;
00050 virtual PN_stdfloat fov_to_focal_length(PN_stdfloat fov, PN_stdfloat film_size, bool horiz) const;
00051 virtual PN_stdfloat film_to_fov(PN_stdfloat film_size, PN_stdfloat focal_length, bool horiz) const;
00052
00053 public:
00054 virtual TypeHandle get_type() const {
00055 return get_class_type();
00056 }
00057 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00058 static TypeHandle get_class_type() {
00059 return _type_handle;
00060 }
00061 static void init_type() {
00062 Lens::init_type();
00063 register_type(_type_handle, "FisheyeLens",
00064 Lens::get_class_type());
00065 }
00066
00067 private:
00068 static TypeHandle _type_handle;
00069 };
00070
00071 #include "fisheyeLens.I"
00072
00073 #endif