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