mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
Fix some issues with verify-lods
This commit is contained in:
parent
a5f3e3f539
commit
169a946914
@ -220,7 +220,7 @@ ConfigVariableDouble lod_fade_time
|
|||||||
"transitions between its different levels."));
|
"transitions between its different levels."));
|
||||||
|
|
||||||
ConfigVariableBool verify_lods
|
ConfigVariableBool verify_lods
|
||||||
("verify-lods", false,
|
("verify-lods", true,
|
||||||
PRC_DESC("When this is true, LODNodes will test when they are rendered to "
|
PRC_DESC("When this is true, LODNodes will test when they are rendered to "
|
||||||
"ensure that each child's geometry fits entirely within the radius "
|
"ensure that each child's geometry fits entirely within the radius "
|
||||||
"defined by its switch-out distance. When it is false, LODNodes "
|
"defined by its switch-out distance. When it is false, LODNodes "
|
||||||
|
@ -586,6 +586,7 @@ do_verify_child_bounds(const LODNode::CData *cdata, int index,
|
|||||||
if (flags == 0) {
|
if (flags == 0) {
|
||||||
// This child's radius doesn't even come close to containing
|
// This child's radius doesn't even come close to containing
|
||||||
// its volume.
|
// its volume.
|
||||||
|
nassertr(!gbv->is_infinite(), false);
|
||||||
sphere.extend_by(gbv);
|
sphere.extend_by(gbv);
|
||||||
suggested_radius = sphere.get_radius();
|
suggested_radius = sphere.get_radius();
|
||||||
return false;
|
return false;
|
||||||
@ -621,9 +622,13 @@ do_verify_child_bounds(const LODNode::CData *cdata, int index,
|
|||||||
// So if any part of this inscribed sphere is outside of the
|
// So if any part of this inscribed sphere is outside of the
|
||||||
// radius, then the radius is bad.
|
// radius, then the radius is bad.
|
||||||
flags = sphere.contains(&box_sphere);
|
flags = sphere.contains(&box_sphere);
|
||||||
if (flags != BoundingVolume::IF_all) {
|
if ((flags & BoundingVolume::IF_all) == 0) {
|
||||||
// No good.
|
// No good.
|
||||||
|
if (gbv->is_infinite()) {
|
||||||
|
sphere.extend_by(&box_sphere);
|
||||||
|
} else {
|
||||||
sphere.extend_by(gbv);
|
sphere.extend_by(gbv);
|
||||||
|
}
|
||||||
suggested_radius = sphere.get_radius();
|
suggested_radius = sphere.get_radius();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user