Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Lens Class Reference

#include <lens.h>

Inheritance diagram for Lens:

TypedReferenceCount TypedObject ReferenceCount CylindricalLens FisheyeLens MatrixLens OrthographicLens PerspectiveLens PSphereLens List of all members.

Public Types

enum  FromCorners {
  FC_roll = 0x0001, FC_camera_plane = 0x0002, FC_off_axis = 0x0004, FC_aspect_ratio = 0x0008,
  FC_shear = 0x0010
}

Public Member Functions

 Lens ()
 Lens (const Lens &copy)
void operator= (const Lens &copy)
INLINE bool extrude (const LPoint2f &point2d, LPoint3f &near_point, LPoint3f &far_point) const
INLINE bool extrude (const LPoint3f &point2d, LPoint3f &near_point, LPoint3f &far_point) const
INLINE bool project (const LPoint3f &point3d, LPoint3f &point2d) const
INLINE bool project (const LPoint3f &point3d, LPoint2f &point2d) const
INLINE void set_change_event (const string &event)
INLINE const string & get_change_event () const
void set_coordinate_system (CoordinateSystem cs)
INLINE CoordinateSystem get_coordinate_system () const
void clear ()
void set_film_size (float width)
INLINE void set_film_size (float width, float height)
void set_film_size (const LVecBase2f &film_size)
const LVecBase2f & get_film_size () const
INLINE void set_film_offset (float x, float y)
INLINE void set_film_offset (const LVecBase2f &film_offset)
INLINE const LVector2f & get_film_offset () const
void set_focal_length (float focal_length)
float get_focal_length () const
void set_fov (float fov)
INLINE void set_fov (float hfov, float vfov)
void set_fov (const LVecBase2f &fov)
const LVecBase2f & get_fov () const
INLINE float get_hfov () const
INLINE float get_vfov () const
void set_aspect_ratio (float aspect_ratio)
float get_aspect_ratio () const
INLINE void set_near (float near_distance)
INLINE float get_near () const
INLINE void set_far (float far_distance)
INLINE float get_far () const
INLINE void set_near_far (float near_distance, float far_distance)
INLINE void set_view_hpr (float h, float p, float r)
void set_view_hpr (const LVecBase3f &view_hpr)
const LVecBase3f & get_view_hpr () const
INLINE void set_view_vector (float x, float y, float z, float i, float j, float k)
void set_view_vector (const LVector3f &view_vector, const LVector3f &up_vector)
const LVector3f & get_view_vector () const
const LVector3f & get_up_vector () const
LPoint3f get_nodal_point () const
void set_iod_offset (float offset)
float get_iod_offset () const
void set_view_mat (const LMatrix4f &view_mat)
const LMatrix4f & get_view_mat () const
void set_frustum_from_corners (const LVecBase3f &ul, const LVecBase3f &ur, const LVecBase3f &ll, const LVecBase3f &lr, int flags)
void recompute_all ()
virtual bool is_linear () const
virtual PT (Geom) make_geometry()
virtual PT (BoundingVolume) make_bounds() const
const LMatrix4f & get_projection_mat () const
const LMatrix4f & get_projection_mat_inv () const
virtual void output (ostream &out) const
virtual void write (ostream &out, int indent_level=0) const
INLINE const UpdateSeqget_last_change () const
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()

Static Public Member Functions

float get_default_near ()
float get_default_far ()
TypeHandle get_class_type ()
void init_type ()

Public Attributes

PUBLISHED __pad0__: virtual PT(Lens) make_copy() const=0

Protected Types

enum  UserFlags {
  UF_film_width = 0x0001, UF_film_height = 0x0002, UF_focal_length = 0x0004, UF_hfov = 0x0008,
  UF_vfov = 0x0010, UF_aspect_ratio = 0x0020, UF_view_hpr = 0x0040, UF_view_vector = 0x0080,
  UF_iod_offset = 0x0100, UF_view_mat = 0x0200
}
enum  CompFlags {
  CF_film_mat = 0x0001, CF_film_mat_inv = 0x0002, CF_lens_mat = 0x0004, CF_lens_mat_inv = 0x0008,
  CF_projection_mat = 0x0010, CF_projection_mat_inv = 0x0020, CF_mat = 0x003f, CF_focal_length = 0x0040,
  CF_fov = 0x0080, CF_film_size = 0x0100, CF_aspect_ratio = 0x0200, CF_view_hpr = 0x0400,
  CF_view_vector = 0x0800, CF_iod_offset = 0x1000
}

Protected Member Functions

INLINE void adjust_user_flags (int clear_flags, int set_flags)
INLINE void adjust_comp_flags (int clear_flags, int set_flags)
void throw_change_event ()
const LMatrix4f & get_film_mat () const
const LMatrix4f & get_film_mat_inv () const
const LMatrix4f & get_lens_mat () const
const LMatrix4f & get_lens_mat_inv () const
virtual bool extrude_impl (const LPoint3f &point2d, LPoint3f &near_point, LPoint3f &far_point) const
virtual bool project_impl (const LPoint3f &point3d, LPoint3f &point2d) const
virtual void compute_film_size ()
virtual void compute_focal_length ()
virtual void compute_fov ()
virtual void compute_aspect_ratio ()
virtual void compute_view_hpr ()
virtual void compute_view_vector ()
virtual void compute_iod_offset ()
virtual void compute_projection_mat ()
virtual void compute_film_mat ()
virtual void compute_lens_mat ()
virtual float fov_to_film (float fov, float focal_length, bool horiz) const
virtual float fov_to_focal_length (float fov, float film_size, bool horiz) const
virtual float film_to_fov (float film_size, float focal_length, bool horiz) const

Protected Attributes

string _change_event
UpdateSeq _last_change
CoordinateSystem _cs
LVecBase2f _film_size
LVector2f _film_offset
float _focal_length
LVecBase2f _fov
float _aspect_ratio
float _near_distance
float _far_distance
LVecBase3f _view_hpr
LVector3f _view_vector
LVector3f _up_vector
float _iod_offset
LMatrix4f _film_mat
LMatrix4f _film_mat_inv
LMatrix4f _lens_mat
LMatrix4f _lens_mat_inv
LMatrix4f _projection_mat
LMatrix4f _projection_mat_inv
short _user_flags
short _comp_flags
char _focal_length_seq
char _fov_seq
char _film_size_seq
PTA_Vertexf _geom_coords

Static Protected Attributes

const float _default_fov = 40.0f

Private Member Functions

int define_geom_coords ()

Static Private Member Functions

void resequence_fov_triad (char &newest, char &older_a, char &older_b)
void build_shear_mat (LMatrix4f &shear_mat, const LPoint3f &cul, const LPoint3f &cur, const LPoint3f &cll, const LPoint3f &clr)
float sqr_dist_to_line (const LPoint3f &point, const LPoint3f &origin, const LVector3f &vec)

Static Private Attributes

TypeHandle _type_handle

Member Enumeration Documentation

enum Lens::CompFlags [protected]
 

Enumeration values:
CF_film_mat 
CF_film_mat_inv 
CF_lens_mat 
CF_lens_mat_inv 
CF_projection_mat 
CF_projection_mat_inv 
CF_mat 
CF_focal_length 
CF_fov 
CF_film_size 
CF_aspect_ratio 
CF_view_hpr 
CF_view_vector 
CF_iod_offset 

Definition at line 216 of file lens.h.

enum Lens::FromCorners
 

Enumeration values:
FC_roll 
FC_camera_plane 
FC_off_axis 
FC_aspect_ratio 
FC_shear 

Definition at line 115 of file lens.h.

enum Lens::UserFlags [protected]
 

Enumeration values:
UF_film_width 
UF_film_height 
UF_focal_length 
UF_hfov 
UF_vfov 
UF_aspect_ratio 
UF_view_hpr 
UF_view_vector 
UF_iod_offset 
UF_view_mat 

Definition at line 202 of file lens.h.


Constructor & Destructor Documentation

Lens::Lens  ) 
 

Definition at line 39 of file lens.cxx.

References clear().

Lens::Lens const Lens &  copy  ) 
 

Definition at line 49 of file lens.cxx.


Member Function Documentation

INLINE void Lens::adjust_comp_flags int  clear_flags,
int  set_flags
[protected]
 

Referenced by compute_aspect_ratio(), compute_film_mat(), compute_film_size(), compute_focal_length(), compute_fov(), compute_iod_offset(), compute_lens_mat(), PerspectiveLens::compute_projection_mat(), OrthographicLens::compute_projection_mat(), MatrixLens::compute_projection_mat(), compute_projection_mat(), compute_view_hpr(), compute_view_vector(), get_film_mat_inv(), get_lens_mat_inv(), get_projection_mat_inv(), set_aspect_ratio(), set_coordinate_system(), set_film_size(), set_focal_length(), set_fov(), set_iod_offset(), set_view_hpr(), set_view_mat(), and set_view_vector().

INLINE void Lens::adjust_user_flags int  clear_flags,
int  set_flags
[protected]
 

Referenced by set_aspect_ratio(), set_film_size(), set_focal_length(), set_fov(), set_iod_offset(), set_view_hpr(), set_view_mat(), and set_view_vector().

void Lens::build_shear_mat LMatrix4f &  shear_mat,
const LPoint3f &  cul,
const LPoint3f &  cur,
const LPoint3f &  cll,
const LPoint3f &  clr
[static, private]
 

Definition at line 1571 of file lens.cxx.

References a, b, csqrt(), length, points, sqr_dist_to_line(), t, and v.

Referenced by set_frustum_from_corners().

void Lens::clear  ) 
 

Definition at line 96 of file lens.cxx.

References _aspect_ratio, _change_event, _comp_flags, _cs, _default_fov, _far_distance, _film_offset, _film_size, _film_size_seq, _focal_length, _focal_length_seq, _fov, _fov_seq, _iod_offset, _near_distance, _up_vector, _user_flags, _view_hpr, _view_vector, CF_fov, CS_default, default_far, and default_near.

Referenced by Lens().

void Lens::compute_aspect_ratio  )  [protected, virtual]
 

Definition at line 1256 of file lens.cxx.

References _aspect_ratio, _user_flags, adjust_comp_flags(), CF_aspect_ratio, get_film_size(), and UF_aspect_ratio.

Referenced by set_film_size(), and set_fov().

void Lens::compute_film_mat  )  [protected, virtual]
 

Definition at line 1336 of file lens.cxx.

References _film_mat, adjust_comp_flags(), CF_film_mat, CF_film_mat_inv, get_film_offset(), and get_film_size().

void Lens::compute_film_size  )  [protected, virtual]
 

Definition at line 1164 of file lens.cxx.

References _aspect_ratio, _comp_flags, _film_size, _focal_length, _fov, _user_flags, adjust_comp_flags(), CF_film_size, CF_focal_length, fov_to_film(), fov_to_focal_length(), UF_aspect_ratio, UF_film_height, UF_film_width, UF_focal_length, UF_hfov, and UF_vfov.

void Lens::compute_focal_length  )  [protected, virtual]
 

Definition at line 1207 of file lens.cxx.

References _focal_length, _user_flags, adjust_comp_flags(), CF_focal_length, fov_to_focal_length(), get_film_size(), get_fov(), and UF_focal_length.

void Lens::compute_fov  )  [protected, virtual]
 

Definition at line 1224 of file lens.cxx.

References _comp_flags, _default_fov, _focal_length, _fov, _user_flags, adjust_comp_flags(), CF_focal_length, CF_fov, film_to_fov(), fov_to_focal_length(), get_film_size(), UF_focal_length, UF_hfov, and UF_vfov.

void Lens::compute_iod_offset  )  [protected, virtual]
 

Definition at line 1306 of file lens.cxx.

References _cs, _iod_offset, _user_flags, adjust_comp_flags(), CF_iod_offset, get_lens_mat_inv(), and UF_iod_offset.

void Lens::compute_lens_mat  )  [protected, virtual]
 

Definition at line 1370 of file lens.cxx.

References _cs, _iod_offset, _lens_mat, _up_vector, _user_flags, _view_hpr, _view_vector, adjust_comp_flags(), CF_lens_mat, CF_lens_mat_inv, compose_matrix(), look_at(), UF_iod_offset, UF_view_hpr, UF_view_mat, and UF_view_vector.

void Lens::compute_projection_mat  )  [protected, virtual]
 

Reimplemented in MatrixLens, OrthographicLens, and PerspectiveLens.

Definition at line 1323 of file lens.cxx.

References _projection_mat, _projection_mat_inv, adjust_comp_flags(), CF_projection_mat, and CF_projection_mat_inv.

void Lens::compute_view_hpr  )  [protected, virtual]
 

Definition at line 1275 of file lens.cxx.

References _cs, _user_flags, _view_hpr, adjust_comp_flags(), CF_view_hpr, decompose_matrix(), get_view_mat(), scale, and UF_view_hpr.

void Lens::compute_view_vector  )  [protected, virtual]
 

Definition at line 1290 of file lens.cxx.

References _cs, _up_vector, _user_flags, _view_vector, adjust_comp_flags(), CF_view_vector, get_view_mat(), and UF_view_vector.

int Lens::define_geom_coords  )  [private]
 

Definition at line 1494 of file lens.cxx.

References _cs, _far_distance, _geom_coords, _near_distance, extrude(), get_lens_mat(), is_linear(), PointerToArray< Vertexf >::push_back(), t, and PointerToArray< Vertexf >::v().

Referenced by throw_change_event().

INLINE bool Lens::extrude const LPoint3f &  point2d,
LPoint3f &  near_point,
LPoint3f &  far_point
const
 

INLINE bool Lens::extrude const LPoint2f &  point2d,
LPoint3f &  near_point,
LPoint3f &  far_point
const
 

Referenced by define_geom_coords(), PT(), CollisionSegment::set_from_lens(), and CollisionRay::set_from_lens().

bool Lens::extrude_impl const LPoint3f &  point2d,
LPoint3f &  near_point,
LPoint3f &  far_point
const [protected, virtual]
 

Reimplemented in CylindricalLens, FisheyeLens, and PSphereLens.

Definition at line 1098 of file lens.cxx.

References get_projection_mat_inv().

float Lens::film_to_fov float  film_size,
float  focal_length,
bool  horiz
const [protected, virtual]
 

Reimplemented in CylindricalLens, FisheyeLens, PSphereLens, and PerspectiveLens.

Definition at line 1431 of file lens.cxx.

References _default_fov.

Referenced by compute_fov().

virtual TypeHandle Lens::force_init_type void   )  [inline, virtual]
 

Reimplemented from TypedReferenceCount.

Reimplemented in CylindricalLens, FisheyeLens, PSphereLens, MatrixLens, OrthographicLens, and PerspectiveLens.

Definition at line 251 of file lens.h.

References ReferenceCount::get_class_type(), and TypedReferenceCount::init_type().

float Lens::fov_to_film float  fov,
float  focal_length,
bool  horiz
const [protected, virtual]
 

Reimplemented in CylindricalLens, FisheyeLens, PSphereLens, and PerspectiveLens.

Definition at line 1403 of file lens.cxx.

Referenced by compute_film_size().

float Lens::fov_to_focal_length float  fov,
float  film_size,
bool  horiz
const [protected, virtual]
 

Reimplemented in CylindricalLens, FisheyeLens, PSphereLens, and PerspectiveLens.

Definition at line 1417 of file lens.cxx.

Referenced by compute_film_size(), compute_focal_length(), and compute_fov().

float Lens::get_aspect_ratio  )  const
 

Definition at line 383 of file lens.cxx.

References _aspect_ratio, _comp_flags, and CF_aspect_ratio.

Referenced by set_film_size(), and set_frustum_from_corners().

INLINE const string& Lens::get_change_event  )  const
 

TypeHandle Lens::get_class_type void   )  [inline, static]
 

Reimplemented from ReferenceCount.

Reimplemented in CylindricalLens, FisheyeLens, PSphereLens, MatrixLens, OrthographicLens, and PerspectiveLens.

Definition at line 252 of file lens.h.

Referenced by PSphereLens::force_init_type(), PerspectiveLens::force_init_type(), OrthographicLens::force_init_type(), MatrixLens::force_init_type(), FisheyeLens::force_init_type(), CylindricalLens::force_init_type(), PSphereLens::get_type(), PerspectiveLens::get_type(), OrthographicLens::get_type(), MatrixLens::get_type(), FisheyeLens::get_type(), CylindricalLens::get_type(), PSphereLens::init_type(), PerspectiveLens::init_type(), OrthographicLens::init_type(), MatrixLens::init_type(), FisheyeLens::init_type(), and CylindricalLens::init_type().

INLINE CoordinateSystem Lens::get_coordinate_system  )  const
 

float Lens::get_default_far  )  [static]
 

Definition at line 410 of file lens.cxx.

References default_far.

Referenced by WindowFramework::center_trackball().

float Lens::get_default_near  )  [static]
 

Definition at line 398 of file lens.cxx.

References default_near.

Referenced by WindowFramework::center_trackball().

INLINE float Lens::get_far  )  const
 

Referenced by PerspectiveLens::compute_projection_mat(), PSphereLens::extrude_impl(), FisheyeLens::extrude_impl(), CylindricalLens::extrude_impl(), PSphereLens::project_impl(), FisheyeLens::project_impl(), CylindricalLens::project_impl(), and PT().

const LMatrix4f & Lens::get_film_mat  )  const [protected]
 

Definition at line 1025 of file lens.cxx.

References _comp_flags, _film_mat, and CF_film_mat.

Referenced by PerspectiveLens::compute_projection_mat(), OrthographicLens::compute_projection_mat(), MatrixLens::compute_projection_mat(), get_film_mat_inv(), PSphereLens::project_impl(), FisheyeLens::project_impl(), and CylindricalLens::project_impl().

const LMatrix4f & Lens::get_film_mat_inv  )  const [protected]
 

Definition at line 1039 of file lens.cxx.

References _comp_flags, _film_mat_inv, adjust_comp_flags(), CF_film_mat_inv, and get_film_mat().

Referenced by PSphereLens::extrude_impl(), FisheyeLens::extrude_impl(), and CylindricalLens::extrude_impl().

INLINE const LVector2f& Lens::get_film_offset  )  const
 

Referenced by compute_film_mat().

const LVecBase2f & Lens::get_film_size  )  const
 

Definition at line 207 of file lens.cxx.

References _comp_flags, _film_size, and CF_film_size.

Referenced by compute_aspect_ratio(), compute_film_mat(), compute_focal_length(), compute_fov(), set_frustum_from_corners(), and OrthographicLens::write().

float Lens::get_focal_length  )  const
 

Definition at line 261 of file lens.cxx.

References _comp_flags, _focal_length, and CF_focal_length.

Referenced by PerspectiveLens::compute_projection_mat(), PSphereLens::extrude_impl(), FisheyeLens::extrude_impl(), CylindricalLens::extrude_impl(), PSphereLens::project_impl(), FisheyeLens::project_impl(), and CylindricalLens::project_impl().

const LVecBase2f & Lens::get_fov  )  const
 

Definition at line 349 of file lens.cxx.

References _comp_flags, _fov, and CF_fov.

Referenced by WindowFramework::center_trackball(), compute_focal_length(), and write().

INLINE float Lens::get_hfov  )  const
 

Referenced by GLGraphicsStateGuardian::bind_light(), DXGraphicsStateGuardian8::bind_light(), CRGraphicsStateGuardian::bind_light(), and DXGraphicsStateGuardian7::prepare_texture().

float Lens::get_iod_offset  )  const
 

Definition at line 534 of file lens.cxx.

References _comp_flags, _iod_offset, and CF_iod_offset.

INLINE const UpdateSeq& Lens::get_last_change  )  const
 

const LMatrix4f & Lens::get_lens_mat  )  const [protected]
 

Definition at line 1056 of file lens.cxx.

References _comp_flags, _lens_mat, and CF_lens_mat.

Referenced by define_geom_coords(), PSphereLens::extrude_impl(), FisheyeLens::extrude_impl(), CylindricalLens::extrude_impl(), and get_lens_mat_inv().

const LMatrix4f & Lens::get_lens_mat_inv  )  const [protected]
 

Definition at line 1070 of file lens.cxx.

References _comp_flags, _lens_mat_inv, adjust_comp_flags(), CF_lens_mat_inv, and get_lens_mat().

Referenced by compute_iod_offset(), PerspectiveLens::compute_projection_mat(), OrthographicLens::compute_projection_mat(), MatrixLens::compute_projection_mat(), PSphereLens::project_impl(), FisheyeLens::project_impl(), CylindricalLens::project_impl(), and set_frustum_from_corners().

INLINE float Lens::get_near  )  const
 

Referenced by PerspectiveLens::compute_projection_mat(), PSphereLens::extrude_impl(), FisheyeLens::extrude_impl(), CylindricalLens::extrude_impl(), PSphereLens::project_impl(), FisheyeLens::project_impl(), CylindricalLens::project_impl(), and PT().

LPoint3f Lens::get_nodal_point  )  const
 

Definition at line 501 of file lens.cxx.

References get_view_mat().

Referenced by GLGraphicsStateGuardian::bind_light(), DXGraphicsStateGuardian8::bind_light(), CRGraphicsStateGuardian::bind_light(), and DXGraphicsStateGuardian7::prepare_texture().

const LMatrix4f & Lens::get_projection_mat  )  const
 

Definition at line 945 of file lens.cxx.

References _comp_flags, _projection_mat, and CF_projection_mat.

Referenced by get_projection_mat_inv(), and project_impl().

const LMatrix4f & Lens::get_projection_mat_inv  )  const
 

Definition at line 960 of file lens.cxx.

References _comp_flags, _projection_mat_inv, adjust_comp_flags(), CF_projection_mat_inv, and get_projection_mat().

Referenced by extrude_impl().

virtual TypeHandle Lens::get_type void   )  const [inline, virtual]
 

Reimplemented from TypedReferenceCount.

Reimplemented in CylindricalLens, FisheyeLens, PSphereLens, MatrixLens, OrthographicLens, and PerspectiveLens.

Definition at line 248 of file lens.h.

References ReferenceCount::get_class_type().

Referenced by output(), GraphicsEngine::setup_gsg(), and write().

const LVector3f & Lens::get_up_vector  )  const
 

Definition at line 487 of file lens.cxx.

References _comp_flags, _up_vector, and CF_view_vector.

INLINE float Lens::get_vfov  )  const
 

const LVecBase3f & Lens::get_view_hpr  )  const
 

Definition at line 440 of file lens.cxx.

References _comp_flags, _view_hpr, and CF_view_hpr.

const LMatrix4f & Lens::get_view_mat  )  const
 

Definition at line 572 of file lens.cxx.

References _comp_flags, _lens_mat, and CF_lens_mat.

Referenced by compute_view_hpr(), compute_view_vector(), and get_nodal_point().

const LVector3f & Lens::get_view_vector  )  const
 

Definition at line 473 of file lens.cxx.

References _comp_flags, _view_vector, and CF_view_vector.

Referenced by GLGraphicsStateGuardian::bind_light(), DXGraphicsStateGuardian8::bind_light(), CRGraphicsStateGuardian::bind_light(), and DXGraphicsStateGuardian7::prepare_texture().

void Lens::init_type void   )  [inline, static]
 

Reimplemented from TypedReferenceCount.

Reimplemented in CylindricalLens, FisheyeLens, PSphereLens, MatrixLens, OrthographicLens, and PerspectiveLens.

Definition at line 255 of file lens.h.

References TypedObject::get_class_type(), TypedReferenceCount::init_type(), and register_type().

Referenced by ConfigureFn(), PSphereLens::force_init_type(), PerspectiveLens::force_init_type(), OrthographicLens::force_init_type(), MatrixLens::force_init_type(), FisheyeLens::force_init_type(), CylindricalLens::force_init_type(), PSphereLens::init_type(), PerspectiveLens::init_type(), OrthographicLens::init_type(), MatrixLens::init_type(), FisheyeLens::init_type(), and CylindricalLens::init_type().

bool Lens::is_linear  )  const [virtual]
 

Reimplemented in MatrixLens, OrthographicLens, and PerspectiveLens.

Definition at line 802 of file lens.cxx.

Referenced by define_geom_coords().

void Lens::operator= const Lens &  copy  ) 
 

Definition at line 59 of file lens.cxx.

References _aspect_ratio, _change_event, _comp_flags, _cs, _far_distance, _film_offset, _film_size, _focal_length, _fov, _near_distance, and _user_flags.

void Lens::output ostream &  out  )  const [virtual]
 

Definition at line 976 of file lens.cxx.

References get_type().

INLINE bool Lens::project const LPoint3f &  point3d,
LPoint2f &  point2d
const
 

INLINE bool Lens::project const LPoint3f &  point3d,
LPoint3f &  point2d
const
 

Referenced by ProjectionScreen::recompute_geom().

bool Lens::project_impl const LPoint3f &  point3d,
LPoint3f &  point2d
const [protected, virtual]
 

Reimplemented in CylindricalLens, FisheyeLens, and PSphereLens.

Definition at line 1141 of file lens.cxx.

References get_projection_mat().

virtual Lens::PT BoundingVolume   )  const [virtual]
 

virtual Lens::PT Geom   )  [virtual]
 

void Lens::recompute_all  ) 
 

Definition at line 789 of file lens.cxx.

References _comp_flags.

void Lens::resequence_fov_triad char &  newest,
char &  older_a,
char &  older_b
[static, private]
 

Definition at line 1450 of file lens.cxx.

Referenced by set_film_size(), set_focal_length(), and set_fov().

void Lens::set_aspect_ratio float  aspect_ratio  ) 
 

Definition at line 366 of file lens.cxx.

References _aspect_ratio, adjust_comp_flags(), adjust_user_flags(), aspect_ratio, CF_aspect_ratio, CF_film_size, CF_fov, CF_mat, throw_change_event(), UF_aspect_ratio, UF_film_height, and UF_vfov.

Referenced by set_frustum_from_corners().

INLINE void Lens::set_change_event const string &  event  ) 
 

void Lens::set_coordinate_system CoordinateSystem  cs  ) 
 

Definition at line 84 of file lens.cxx.

References _cs, adjust_comp_flags(), CF_mat, CF_view_hpr, CF_view_vector, and cs.

INLINE void Lens::set_far float  far_distance  ) 
 

Referenced by WindowFramework::center_trackball().

INLINE void Lens::set_film_offset const LVecBase2f &  film_offset  ) 
 

INLINE void Lens::set_film_offset float  x,
float  y
 

Referenced by set_frustum_from_corners().

void Lens::set_film_size const LVecBase2f &  film_size  ) 
 

Definition at line 172 of file lens.cxx.

References _film_size, _film_size_seq, _focal_length_seq, _fov_seq, adjust_comp_flags(), adjust_user_flags(), CF_aspect_ratio, CF_film_size, CF_focal_length, CF_fov, CF_mat, compute_aspect_ratio(), resequence_fov_triad(), throw_change_event(), UF_aspect_ratio, UF_film_height, UF_film_width, UF_focal_length, UF_hfov, and UF_vfov.

INLINE void Lens::set_film_size float  width,
float  height
 

void Lens::set_film_size float  width  ) 
 

Definition at line 128 of file lens.cxx.

References _film_size, _film_size_seq, _focal_length_seq, _fov_seq, adjust_comp_flags(), adjust_user_flags(), CF_film_size, CF_focal_length, CF_fov, CF_mat, get_aspect_ratio(), resequence_fov_triad(), throw_change_event(), UF_film_height, UF_film_width, UF_focal_length, UF_hfov, UF_vfov, and width.

void Lens::set_focal_length float  focal_length  ) 
 

Definition at line 228 of file lens.cxx.

References _film_size_seq, _focal_length, _focal_length_seq, _fov_seq, adjust_comp_flags(), adjust_user_flags(), CF_film_size, CF_focal_length, CF_fov, CF_mat, resequence_fov_triad(), throw_change_event(), UF_film_height, UF_film_width, UF_focal_length, UF_hfov, and UF_vfov.

void Lens::set_fov const LVecBase2f &  fov  ) 
 

Definition at line 314 of file lens.cxx.

References _film_size_seq, _focal_length_seq, _fov, _fov_seq, adjust_comp_flags(), adjust_user_flags(), CF_aspect_ratio, CF_film_size, CF_focal_length, CF_fov, CF_mat, compute_aspect_ratio(), resequence_fov_triad(), throw_change_event(), UF_aspect_ratio, UF_film_height, UF_film_width, UF_focal_length, UF_hfov, and UF_vfov.

INLINE void Lens::set_fov float  hfov,
float  vfov
 

void Lens::set_fov float  fov  ) 
 

Definition at line 276 of file lens.cxx.

References _film_size_seq, _focal_length_seq, _fov, _fov_seq, adjust_comp_flags(), adjust_user_flags(), CF_film_size, CF_focal_length, CF_fov, CF_mat, resequence_fov_triad(), throw_change_event(), UF_film_height, UF_film_width, UF_focal_length, UF_hfov, and UF_vfov.

Referenced by set_frustum_from_corners().

void Lens::set_frustum_from_corners const LVecBase3f &  ul,
const LVecBase3f &  ur,
const LVecBase3f &  ll,
const LVecBase3f &  lr,
int  flags
 

Definition at line 639 of file lens.cxx.

References _cs, aspect_ratio, build_shear_mat(), cabs(), catan(), CS_zup_right, FC_aspect_ratio, FC_camera_plane, FC_off_axis, FC_roll, FC_shear, get_aspect_ratio(), get_film_size(), get_lens_mat_inv(), look_at(), rad_2_deg(), set_aspect_ratio(), set_film_offset(), set_fov(), and set_view_mat().

void Lens::set_iod_offset float  offset  ) 
 

Definition at line 517 of file lens.cxx.

References _iod_offset, adjust_comp_flags(), adjust_user_flags(), CF_iod_offset, CF_mat, CF_view_hpr, CF_view_vector, throw_change_event(), UF_iod_offset, and UF_view_mat.

INLINE void Lens::set_near float  near_distance  ) 
 

Referenced by WindowFramework::center_trackball().

INLINE void Lens::set_near_far float  near_distance,
float  far_distance
 

void Lens::set_view_hpr const LVecBase3f &  view_hpr  ) 
 

Definition at line 425 of file lens.cxx.

References _view_hpr, adjust_comp_flags(), adjust_user_flags(), CF_iod_offset, CF_mat, CF_view_hpr, CF_view_vector, throw_change_event(), UF_view_hpr, UF_view_mat, and UF_view_vector.

INLINE void Lens::set_view_hpr float  h,
float  p,
float  r
 

void Lens::set_view_mat const LMatrix4f &  view_mat  ) 
 

Definition at line 557 of file lens.cxx.

References _lens_mat, adjust_comp_flags(), adjust_user_flags(), CF_iod_offset, CF_lens_mat, CF_lens_mat_inv, CF_view_hpr, CF_view_vector, throw_change_event(), UF_iod_offset, UF_view_hpr, UF_view_mat, and UF_view_vector.

Referenced by set_frustum_from_corners().

void Lens::set_view_vector const LVector3f &  view_vector,
const LVector3f &  up_vector
 

Definition at line 457 of file lens.cxx.

References _up_vector, _view_vector, adjust_comp_flags(), adjust_user_flags(), CF_iod_offset, CF_mat, CF_view_hpr, CF_view_vector, throw_change_event(), UF_view_hpr, UF_view_mat, and UF_view_vector.

INLINE void Lens::set_view_vector float  x,
float  y,
float  z,
float  i,
float  j,
float  k
 

float Lens::sqr_dist_to_line const LPoint3f &  point,
const LPoint3f &  origin,
const LVector3f &  vec
[static, private]
 

Definition at line 1726 of file lens.cxx.

Referenced by build_shear_mat().

void Lens::throw_change_event  )  [protected]
 

Definition at line 997 of file lens.cxx.

References _change_event, _geom_coords, _last_change, PointerToArray< Vertexf >::clear(), define_geom_coords(), PointerToArray< Vertexf >::get_ref_count(), and throw_event().

Referenced by set_aspect_ratio(), set_film_size(), set_focal_length(), set_fov(), set_iod_offset(), set_view_hpr(), set_view_mat(), and set_view_vector().

void Lens::write ostream &  out,
int  indent_level = 0
const [virtual]
 

Reimplemented in MatrixLens, and OrthographicLens.

Definition at line 986 of file lens.cxx.

References get_fov(), get_type(), and indent().

Referenced by Spotlight::write().


Member Data Documentation

PUBLISHED Lens::__pad0__
 

Reimplemented from TypedReferenceCount.

Reimplemented in CylindricalLens, FisheyeLens, PSphereLens, MatrixLens, OrthographicLens, and PerspectiveLens.

Definition at line 50 of file lens.h.

float Lens::_aspect_ratio [protected]
 

Definition at line 191 of file lens.h.

Referenced by clear(), compute_aspect_ratio(), compute_film_size(), get_aspect_ratio(), operator=(), and set_aspect_ratio().

string Lens::_change_event [protected]
 

Definition at line 183 of file lens.h.

Referenced by clear(), operator=(), and throw_change_event().

short Lens::_comp_flags [protected]
 

Definition at line 235 of file lens.h.

Referenced by clear(), compute_film_size(), compute_fov(), get_aspect_ratio(), get_film_mat(), get_film_mat_inv(), get_film_size(), get_focal_length(), get_fov(), get_iod_offset(), get_lens_mat(), get_lens_mat_inv(), get_projection_mat(), get_projection_mat_inv(), get_up_vector(), get_view_hpr(), get_view_mat(), get_view_vector(), operator=(), and recompute_all().

CoordinateSystem Lens::_cs [protected]
 

Definition at line 185 of file lens.h.

Referenced by clear(), compute_iod_offset(), compute_lens_mat(), PerspectiveLens::compute_projection_mat(), OrthographicLens::compute_projection_mat(), compute_view_hpr(), compute_view_vector(), define_geom_coords(), operator=(), set_coordinate_system(), and set_frustum_from_corners().

const float Lens::_default_fov = 40.0f [static, protected]
 

Definition at line 31 of file lens.cxx.

Referenced by clear(), compute_fov(), and film_to_fov().

float Lens::_far_distance [protected]
 

Definition at line 192 of file lens.h.

Referenced by clear(), OrthographicLens::compute_projection_mat(), define_geom_coords(), and operator=().

LMatrix4f Lens::_film_mat [protected]
 

Definition at line 198 of file lens.h.

Referenced by compute_film_mat(), and get_film_mat().

LMatrix4f Lens::_film_mat_inv [protected]
 

Definition at line 198 of file lens.h.

Referenced by get_film_mat_inv().

LVector2f Lens::_film_offset [protected]
 

Definition at line 188 of file lens.h.

Referenced by clear(), and operator=().

LVecBase2f Lens::_film_size [protected]
 

Definition at line 187 of file lens.h.

Referenced by clear(), compute_film_size(), get_film_size(), operator=(), and set_film_size().

char Lens::_film_size_seq [protected]
 

Definition at line 241 of file lens.h.

Referenced by clear(), set_film_size(), set_focal_length(), and set_fov().

float Lens::_focal_length [protected]
 

Definition at line 189 of file lens.h.

Referenced by clear(), compute_film_size(), compute_focal_length(), compute_fov(), get_focal_length(), operator=(), and set_focal_length().

char Lens::_focal_length_seq [protected]
 

Definition at line 241 of file lens.h.

Referenced by clear(), set_film_size(), set_focal_length(), and set_fov().

LVecBase2f Lens::_fov [protected]
 

Definition at line 190 of file lens.h.

Referenced by clear(), compute_film_size(), compute_fov(), get_fov(), operator=(), and set_fov().

char Lens::_fov_seq [protected]
 

Definition at line 241 of file lens.h.

Referenced by clear(), set_film_size(), set_focal_length(), and set_fov().

PTA_Vertexf Lens::_geom_coords [protected]
 

Definition at line 243 of file lens.h.

Referenced by define_geom_coords(), and throw_change_event().

float Lens::_iod_offset [protected]
 

Definition at line 196 of file lens.h.

Referenced by clear(), compute_iod_offset(), compute_lens_mat(), get_iod_offset(), and set_iod_offset().

UpdateSeq Lens::_last_change [protected]
 

Definition at line 184 of file lens.h.

Referenced by throw_change_event().

LMatrix4f Lens::_lens_mat [protected]
 

Definition at line 199 of file lens.h.

Referenced by compute_lens_mat(), get_lens_mat(), get_view_mat(), and set_view_mat().

LMatrix4f Lens::_lens_mat_inv [protected]
 

Definition at line 199 of file lens.h.

Referenced by get_lens_mat_inv().

float Lens::_near_distance [protected]
 

Definition at line 192 of file lens.h.

Referenced by clear(), OrthographicLens::compute_projection_mat(), define_geom_coords(), and operator=().

LMatrix4f Lens::_projection_mat [protected]
 

Definition at line 200 of file lens.h.

Referenced by PerspectiveLens::compute_projection_mat(), OrthographicLens::compute_projection_mat(), MatrixLens::compute_projection_mat(), compute_projection_mat(), get_projection_mat(), and MatrixLens::write().

LMatrix4f Lens::_projection_mat_inv [protected]
 

Definition at line 200 of file lens.h.

Referenced by compute_projection_mat(), and get_projection_mat_inv().

TypeHandle Lens::_type_handle [static, private]
 

Reimplemented from TypedReferenceCount.

Reimplemented in CylindricalLens, FisheyeLens, PSphereLens, MatrixLens, OrthographicLens, and PerspectiveLens.

Definition at line 29 of file lens.cxx.

LVector3f Lens::_up_vector [protected]
 

Definition at line 195 of file lens.h.

Referenced by clear(), compute_lens_mat(), compute_view_vector(), get_up_vector(), and set_view_vector().

short Lens::_user_flags [protected]
 

Definition at line 234 of file lens.h.

Referenced by clear(), compute_aspect_ratio(), compute_film_size(), compute_focal_length(), compute_fov(), compute_iod_offset(), compute_lens_mat(), compute_view_hpr(), compute_view_vector(), and operator=().

LVecBase3f Lens::_view_hpr [protected]
 

Definition at line 194 of file lens.h.

Referenced by clear(), compute_lens_mat(), compute_view_hpr(), get_view_hpr(), and set_view_hpr().

LVector3f Lens::_view_vector [protected]
 

Definition at line 195 of file lens.h.

Referenced by clear(), compute_lens_mat(), compute_view_vector(), get_view_vector(), and set_view_vector().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:12:36 2003 for Panda by doxygen1.3