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

LOD Class Reference

Computes whether a level-of-detail should be rendered or not based on distance from the rendering camera. More...

#include <LOD.h>

List of all members.

Public Member Functions

 LOD ()
 LOD (const LOD &copy)
 ~LOD ()
void xform (const LMatrix4f &mat)
 Transforms the LOD specification by the indicated matrix.

int compute_child (const LPoint3f &cam_pos, const LPoint3f &center) const
 Computes the distance between two points and returns the index for the child of the LOD by testing against the corresponding list of switching distances.

void write_datagram (Datagram &destination) const
 Writes the contents of the LOD out to the datagram, presumably in preparation to writing to a Bam file.

void read_datagram (DatagramIterator &source)
 Reads the contents of the LOD from the datagram, presumably in response to reading a Bam file.

void output (ostream &out) const
void write (ostream &out, int indent_level=0) const

Static Public Member Functions

void set_stress_factor (float stress_factor)
 Sets the factor that globally scales all LOD's.

float get_stress_factor ()
 Returns the factor that globally scales all LOD's.


Public Attributes

LPoint3f _center
LODSwitchVector _switch_vector

Static Private Attributes

float _stress_factor = lod_stress_factor


Detailed Description

Computes whether a level-of-detail should be rendered or not based on distance from the rendering camera.

Definition at line 101 of file LOD.h.


Constructor & Destructor Documentation

LOD::LOD void   ) 
 

Definition at line 45 of file LOD.cxx.

LOD::LOD const LOD &  copy  ) 
 

Definition at line 57 of file LOD.cxx.

LOD::~LOD void   ) 
 

Definition at line 71 of file LOD.cxx.

References _center, _switch_vector, and y.


Member Function Documentation

int LOD::compute_child const LPoint3f &  cam_pos,
const LPoint3f &  center
const
 

Computes the distance between two points and returns the index for the child of the LOD by testing against the corresponding list of switching distances.

Definition at line 112 of file LOD.cxx.

References _switch_vector, and minimum_LOD_number.

float LOD::get_stress_factor  )  [static]
 

Returns the factor that globally scales all LOD's.

See get_stress_factor().

Definition at line 266 of file LOD.cxx.

void LOD::output ostream &  out  )  const
 

Definition at line 198 of file LOD.cxx.

References indent().

void LOD::read_datagram DatagramIterator source  ) 
 

Reads the contents of the LOD from the datagram, presumably in response to reading a Bam file.

Definition at line 177 of file LOD.cxx.

References _switch_vector.

Referenced by LODNode::CData::write_datagram().

void LOD::set_stress_factor float  stress_factor  )  [static]
 

Sets the factor that globally scales all LOD's.

This factor is applied to the square of the LOD distance, so the larger the number, the lower the detail that is presented. The normal value is 1.0.

Definition at line 251 of file LOD.cxx.

void LOD::write ostream &  out,
int  indent_level = 0
const
 

Definition at line 221 of file LOD.cxx.

References _stress_factor.

void LOD::write_datagram Datagram destination  )  const
 

Writes the contents of the LOD out to the datagram, presumably in preparation to writing to a Bam file.

Definition at line 153 of file LOD.cxx.

References _switch_vector.

Referenced by LODNode::CData::make_copy().

void LOD::xform const LMatrix4f &  mat  ) 
 

Transforms the LOD specification by the indicated matrix.

Definition at line 85 of file LOD.cxx.

References _stress_factor, _switch_vector, dot(), and select_LOD_number.


Member Data Documentation

LPoint3f LOD::_center
 

Definition at line 123 of file LOD.h.

Referenced by ~LOD().

float LOD::_stress_factor = lod_stress_factor [static, private]
 

Definition at line 35 of file LOD.cxx.

Referenced by write(), and xform().

LODSwitchVector LOD::_switch_vector
 

Definition at line 124 of file LOD.h.

Referenced by compute_child(), read_datagram(), write_datagram(), xform(), and ~LOD().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:52:04 2003 for Panda by doxygen1.3