mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
collide: protect info print with is_info() check
This prevents an unnecessary sqrt
This commit is contained in:
parent
880e956429
commit
b549133b3e
@ -440,10 +440,12 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
|
|||||||
LVector3 normal = (has_effective_normal() && sphere->get_respect_effective_normal()) ? get_effective_normal() : get_normal();
|
LVector3 normal = (has_effective_normal() && sphere->get_respect_effective_normal()) ? get_effective_normal() : get_normal();
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (!IS_THRESHOLD_EQUAL(normal.length_squared(), 1.0f, 0.001)) {
|
if (!IS_THRESHOLD_EQUAL(normal.length_squared(), 1.0f, 0.001)) {
|
||||||
|
if (collide_cat.is_info()) {
|
||||||
collide_cat.info()
|
collide_cat.info()
|
||||||
<< "polygon within " << entry.get_into_node_path()
|
<< "polygon within " << entry.get_into_node_path()
|
||||||
<< " has normal " << normal << " of length " << normal.length()
|
<< " has normal " << normal << " of length " << normal.length()
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
}
|
||||||
normal.normalize();
|
normal.normalize();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user