Panda3D
 All Classes Functions Variables Enumerations
orthographicLens.h
1 // Filename: orthographicLens.h
2 // Created by: mike (18Feb99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef ORTHOGRAPHICLENS_H
16 #define ORTHOGRAPHICLENS_H
17 
18 #include "pandabase.h"
19 
20 #include "lens.h"
21 
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : OrthographicLens
25 // Description : An orthographic lens. Although this kind of lens is
26 // linear, like a PerspectiveLens, it doesn't respect
27 // field-of-view or focal length parameters, and
28 // adjusting these will have no effect. Instead, its
29 // field of view is controlled by adjusting the
30 // film_size; the orthographic lens represents a planar
31 // projection onto its imaginary film of the specified
32 // size, hanging in space.
33 ////////////////////////////////////////////////////////////////////
34 class EXPCL_PANDA_GOBJ OrthographicLens : public Lens {
35 PUBLISHED:
36  INLINE OrthographicLens();
37 
38 public:
39  INLINE OrthographicLens(const OrthographicLens &copy);
40  INLINE void operator = (const OrthographicLens &copy);
41 
42 public:
43  virtual PT(Lens) make_copy() const;
44  virtual bool is_linear() const;
45  virtual bool is_orthographic() const;
46 
47  virtual void write(ostream &out, int indent_level = 0) const;
48 
49 protected:
50  virtual bool do_extrude_depth(const CData *cdata, const LPoint3 &point2d,
51  LPoint3 &point3d) const;
52  virtual void do_compute_projection_mat(Lens::CData *lens_cdata);
53 
54 public:
55  static void register_with_read_factory();
56 
57 protected:
58  static TypedWritable *make_from_bam(const FactoryParams &params);
59 
60 public:
61  virtual TypeHandle get_type() const {
62  return get_class_type();
63  }
64  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
65  static TypeHandle get_class_type() {
66  return _type_handle;
67  }
68  static void init_type() {
69  Lens::init_type();
70  register_type(_type_handle, "OrthographicLens",
71  Lens::get_class_type());
72  }
73 
74 private:
75  static TypeHandle _type_handle;
76 };
77 
78 #include "orthographicLens.I"
79 
80 #endif
virtual bool is_orthographic() const
Returns true if the lens represents a orthographic projection (i.e.
Definition: lens.cxx:639
A base class for any number of different kinds of lenses, linear and otherwise.
Definition: lens.h:45
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
virtual bool is_linear() const
Returns true if the lens represents a linear projection (e.g.
Definition: lens.cxx:615
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
An orthographic lens.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85