mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Add config var "show-portal-debug" to allow turning off the debug lines
This commit is contained in:
parent
165fe027f0
commit
4271960b92
@ -121,6 +121,12 @@ ConfigVariableBool allow_portal_cull
|
|||||||
"renderer to cull more objects that are clipped if not in the "
|
"renderer to cull more objects that are clipped if not in the "
|
||||||
"current list of portals. This is still somewhat experimental."));
|
"current list of portals. This is still somewhat experimental."));
|
||||||
|
|
||||||
|
ConfigVariableBool show_portal_debug
|
||||||
|
("show-portal-debug", true,
|
||||||
|
PRC_DESC("Set this true to show debug lines for portals. This will draw "
|
||||||
|
"lines from the screen corners to the portal corners, this can "
|
||||||
|
"be useful when debugging."));
|
||||||
|
|
||||||
ConfigVariableBool unambiguous_graph
|
ConfigVariableBool unambiguous_graph
|
||||||
("unambiguous-graph", false,
|
("unambiguous-graph", false,
|
||||||
PRC_DESC("Set this true to make ambiguous path warning messages generate an "
|
PRC_DESC("Set this true to make ambiguous path warning messages generate an "
|
||||||
|
@ -34,6 +34,7 @@ NotifyCategoryDecl(portal, EXPCL_PANDA_PGRAPH, EXPTP_PANDA_PGRAPH);
|
|||||||
extern ConfigVariableBool fake_view_frustum_cull;
|
extern ConfigVariableBool fake_view_frustum_cull;
|
||||||
extern ConfigVariableBool clip_plane_cull;
|
extern ConfigVariableBool clip_plane_cull;
|
||||||
extern ConfigVariableBool allow_portal_cull;
|
extern ConfigVariableBool allow_portal_cull;
|
||||||
|
extern ConfigVariableBool show_portal_debug;
|
||||||
extern ConfigVariableBool unambiguous_graph;
|
extern ConfigVariableBool unambiguous_graph;
|
||||||
extern ConfigVariableBool detect_graph_cycles;
|
extern ConfigVariableBool detect_graph_cycles;
|
||||||
extern ConfigVariableBool no_unsupported_copy;
|
extern ConfigVariableBool no_unsupported_copy;
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "config_pgraph.h"
|
||||||
#include "cullTraverser.h"
|
#include "cullTraverser.h"
|
||||||
#include "cullTraverserData.h"
|
#include "cullTraverserData.h"
|
||||||
#include "transformState.h"
|
#include "transformState.h"
|
||||||
@ -132,9 +133,11 @@ traverse(const NodePath &root) {
|
|||||||
|
|
||||||
// This local_frustum is in camera space
|
// This local_frustum is in camera space
|
||||||
PortalClipper portal_viewer(local_frustum, _scene_setup);
|
PortalClipper portal_viewer(local_frustum, _scene_setup);
|
||||||
|
if (show_portal_debug) {
|
||||||
portal_viewer.draw_camera_frustum();
|
portal_viewer.draw_camera_frustum();
|
||||||
|
}
|
||||||
|
|
||||||
// store this pointer in this
|
// Store this pointer in this
|
||||||
set_portal_clipper(&portal_viewer);
|
set_portal_clipper(&portal_viewer);
|
||||||
|
|
||||||
CullTraverserData data(root, TransformState::make_identity(),
|
CullTraverserData data(root, TransformState::make_identity(),
|
||||||
@ -143,8 +146,10 @@ traverse(const NodePath &root) {
|
|||||||
|
|
||||||
traverse(data);
|
traverse(data);
|
||||||
|
|
||||||
// finally add the lines to be drawn
|
// Finally add the lines to be drawn
|
||||||
|
if (show_portal_debug) {
|
||||||
portal_viewer.draw_lines();
|
portal_viewer.draw_lines();
|
||||||
|
}
|
||||||
|
|
||||||
// Render the frustum relative to the cull center.
|
// Render the frustum relative to the cull center.
|
||||||
NodePath cull_center = _scene_setup->get_cull_center();
|
NodePath cull_center = _scene_setup->get_cull_center();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user