Panda3D
|
00001 // Filename: orthographicLens.h 00002 // Created by: mike (18Feb99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef ORTHOGRAPHICLENS_H 00016 #define ORTHOGRAPHICLENS_H 00017 00018 #include "pandabase.h" 00019 00020 #include "lens.h" 00021 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Class : OrthographicLens 00025 // Description : An orthographic lens. Although this kind of lens is 00026 // linear, like a PerspectiveLens, it doesn't respect 00027 // field-of-view or focal length parameters, and 00028 // adjusting these will have no effect. Instead, its 00029 // field of view is controlled by adjusting the 00030 // film_size; the orthographic lens represents a planar 00031 // projection onto its imaginary film of the specified 00032 // size, hanging in space. 00033 //////////////////////////////////////////////////////////////////// 00034 class EXPCL_PANDA_GOBJ OrthographicLens : public Lens { 00035 PUBLISHED: 00036 INLINE OrthographicLens(); 00037 00038 public: 00039 INLINE OrthographicLens(const OrthographicLens ©); 00040 INLINE void operator = (const OrthographicLens ©); 00041 00042 public: 00043 virtual PT(Lens) make_copy() const; 00044 virtual bool is_linear() const; 00045 virtual bool is_orthographic() const; 00046 00047 virtual void write(ostream &out, int indent_level = 0) const; 00048 00049 protected: 00050 virtual void do_compute_projection_mat(Lens::CData *lens_cdata); 00051 00052 public: 00053 static void register_with_read_factory(); 00054 00055 protected: 00056 static TypedWritable *make_from_bam(const FactoryParams ¶ms); 00057 00058 public: 00059 virtual TypeHandle get_type() const { 00060 return get_class_type(); 00061 } 00062 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00063 static TypeHandle get_class_type() { 00064 return _type_handle; 00065 } 00066 static void init_type() { 00067 Lens::init_type(); 00068 register_type(_type_handle, "OrthographicLens", 00069 Lens::get_class_type()); 00070 } 00071 00072 private: 00073 static TypeHandle _type_handle; 00074 }; 00075 00076 #include "orthographicLens.I" 00077 00078 #endif