00001 // Filename: orthographicLens.h 00002 // Created by: mike (18Feb99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef ORTHOGRAPHICLENS_H 00020 #define ORTHOGRAPHICLENS_H 00021 00022 #include "pandabase.h" 00023 00024 #include "lens.h" 00025 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : OrthographicLens 00029 // Description : An orthographic lens. Although this kind of lens is 00030 // linear, like a PerspectiveLens, it doesn't respect 00031 // field-of-view or focal length parameters, and 00032 // adjusting these will have no effect. Instead, its 00033 // field of view is controlled by adjusting the 00034 // film_size; the orthographic lens represents a planar 00035 // projection onto its imaginary film of the specified 00036 // size, hanging in space. 00037 //////////////////////////////////////////////////////////////////// 00038 class EXPCL_PANDA OrthographicLens : public Lens { 00039 PUBLISHED: 00040 INLINE OrthographicLens(); 00041 00042 public: 00043 INLINE OrthographicLens(const OrthographicLens ©); 00044 INLINE void operator = (const OrthographicLens ©); 00045 00046 public: 00047 virtual PT(Lens) make_copy() const; 00048 virtual bool is_linear() const; 00049 00050 virtual void write(ostream &out, int indent_level = 0) const; 00051 00052 protected: 00053 virtual void compute_projection_mat(); 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, "OrthographicLens", 00066 Lens::get_class_type()); 00067 } 00068 00069 private: 00070 static TypeHandle _type_handle; 00071 }; 00072 00073 #include "orthographicLens.I" 00074 00075 #endif