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