add minimum LOD num option
This commit is contained in:
parent
572cc7b166
commit
05c496770f
|
|
@ -85,6 +85,9 @@ xform(const LMatrix4f &mat) {
|
|||
}
|
||||
}
|
||||
|
||||
//const int minimum_LOD_number = config_gobj.GetInt("minimum-LOD-number", 0);
|
||||
//extern EXPCL_PANDA const int minimum_LOD_number;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: LOD::compute_child
|
||||
// Access: Public
|
||||
|
|
@ -94,6 +97,7 @@ xform(const LMatrix4f &mat) {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
int LOD::
|
||||
compute_child(const LPoint3f &cam_pos, const LPoint3f ¢er) const {
|
||||
|
||||
LVector3f v = cam_pos - center;
|
||||
float dist = dot(v, v);
|
||||
LODSwitchVector::const_iterator i;
|
||||
|
|
@ -103,6 +107,15 @@ compute_child(const LPoint3f &cam_pos, const LPoint3f ¢er) const {
|
|||
if ((*i).in_range(dist))
|
||||
break;
|
||||
}
|
||||
|
||||
// since lowest level LOD is lev 0, must invert the meaning of
|
||||
// so minimum_LOD_number 0 will screen out no LODs, and increasing it
|
||||
// will screen out successively higher levels
|
||||
int max_allowed_LOD_number = (_switch_vector.size()-1) - minimum_LOD_number;
|
||||
if(child > max_allowed_LOD_number) {
|
||||
child = max_allowed_LOD_number;
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,6 +93,11 @@ BamTextureMode bam_texture_mode;
|
|||
// texture file, which will presumably only be loaded once.
|
||||
const string fake_texture_image = config_gobj.GetString("fake-texture-image", "");
|
||||
|
||||
// this controls the LOD child number returned by compute_child
|
||||
// use it to force the LOD alg to not select the highest level(s) of LOD
|
||||
// minimum_LOD_number=0 will screen out no LODs, and increasing it
|
||||
// will screen out successively higher levels
|
||||
const int minimum_LOD_number = config_gobj.GetInt("minimum-LOD-number", 0);
|
||||
|
||||
static BamTextureMode
|
||||
parse_texture_mode(const string &mode) {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ enum BamTextureMode {
|
|||
extern EXPCL_PANDA BamTextureMode bam_texture_mode;
|
||||
extern EXPCL_PANDA const string fake_texture_image;
|
||||
|
||||
extern EXPCL_PANDA const int minimum_LOD_number;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
#include "LOD.cxx"
|
||||
#include "geom.cxx"
|
||||
#include "geomLine.cxx"
|
||||
#include "geomLinestrip.cxx"
|
||||
|
|
@ -11,4 +10,5 @@
|
|||
#include "geomTri.cxx"
|
||||
#include "geomTrifan.cxx"
|
||||
#include "geomTristrip.cxx"
|
||||
#include "fog.cxx"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#include "config_gobj.cxx"
|
||||
#include "LOD.cxx"
|
||||
#include "drawable.cxx"
|
||||
#include "fog.cxx"
|
||||
#include "imageBuffer.cxx"
|
||||
#include "material.cxx"
|
||||
#include "materialPool.cxx"
|
||||
|
|
|
|||
Loading…
Reference in New Issue