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