14#ifndef PERSPECTIVELENS_H
15#define PERSPECTIVELENS_H
25class EXPCL_PANDA_GOBJ PerspectiveLens :
public Lens {
27 INLINE PerspectiveLens();
28 INLINE
explicit PerspectiveLens(PN_stdfloat hfov, PN_stdfloat vfov);
31 INLINE PerspectiveLens(
const PerspectiveLens ©);
32 INLINE
void operator = (
const PerspectiveLens ©);
40 virtual bool do_extrude_depth(
const CData *cdata,
const LPoint3 &point2d,
41 LPoint3 &point3d)
const;
42 virtual void do_compute_projection_mat(Lens::CData *lens_cdata);
44 virtual PN_stdfloat fov_to_film(PN_stdfloat fov, PN_stdfloat focal_length,
bool horiz)
const;
45 virtual PN_stdfloat fov_to_focal_length(PN_stdfloat fov, PN_stdfloat film_size,
bool horiz)
const;
46 virtual PN_stdfloat film_to_fov(PN_stdfloat film_size, PN_stdfloat focal_length,
bool horiz)
const;
52 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
56 return get_class_type();
58 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
62 static void init_type() {
65 Lens::get_class_type());
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual bool is_linear() const
Returns true if the lens represents a linear projection (e.g.
virtual bool is_perspective() const
Returns true if the lens represents a perspective projection (i.e.
virtual PointerTo< Lens > make_copy() const
Allocates a new Lens just like this one.
static void register_with_read_factory()
Tells the BamReader how to create objects of type Lens.
TypeHandle is the identifier used to differentiate C++ class types.
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(),...