*** empty log message ***

This commit is contained in:
David Rose 2001-03-06 23:55:39 +00:00
parent 50d8cb9244
commit c60ab78e2e
3 changed files with 43 additions and 32 deletions

View File

@ -10,8 +10,9 @@
#define SOURCES \
appTraverser.I appTraverser.cxx appTraverser.h \
config_sgraphutil.cxx config_sgraphutil.h directRenderTraverser.I \
directRenderTraverser.cxx directRenderTraverser.h get_rel_pos.I \
get_rel_pos.cxx get_rel_pos.h sceneGraphAnalyzer.cxx \
directRenderTraverser.cxx directRenderTraverser.h \
frustumCullTraverser.I frustumCullTraverser.h \
get_rel_pos.I get_rel_pos.cxx get_rel_pos.h sceneGraphAnalyzer.cxx \
sceneGraphAnalyzer.h sceneGraphReducer.I sceneGraphReducer.cxx \
sceneGraphReducer.h

View File

@ -3,13 +3,6 @@
//
////////////////////////////////////////////////////////////////////
#include "frustumCullTraverser.h"
#include "config_sgraphutil.h"
#include <notify.h>
#include <nodeTransitionWrapper.h>
#include <transformTransition.h>
#include <wrt.h>
////////////////////////////////////////////////////////////////////
// Function: FrustumCullTraverser::Constructor
@ -148,32 +141,42 @@ traverse(NodeRelation *arc, AttributeWrapper render_state,
}
}
if (carry_on &&
arc->has_transition(TransformTransition::get_class_type())) {
// Now apply the transform associated with this arc. We do
// this after the bounding volume test, because the bounding
// volume has already been transformed.
if (carry_on) {
if (arc->has_transition(BillboardTransition::get_class_type())) {
// We can't reliably cull within a billboard, because the
// geometry might get rotated out of its bounding volume.
// So once we get within a billboard, we consider it all
// visible.
all_in = true;
}
local_frustum =
DCAST(GeometricBoundingVolume, _view_frustum->make_copy());
if (!all_in &&
arc->has_transition(TransformTransition::get_class_type())) {
// Now apply the transform associated with this arc. We do
// this after the bounding volume test, because the bounding
// volume has already been transformed.
NodeTransitionWrapper ntw(TransformTransition::get_class_type());
wrt(_gsg->get_current_projection_node(),
arc->get_child(), _arc_chain.begin(), _arc_chain.end(),
ntw, _graph_type);
const TransformTransition *tt;
if (get_transition_into(tt, ntw)) {
// This frustum is transformed from the camera. Most will
// be.
nassertv(local_frustum != (GeometricBoundingVolume *)NULL);
local_frustum->xform(tt->get_matrix());
local_frustum =
DCAST(GeometricBoundingVolume, _view_frustum->make_copy());
if (sgraphutil_cat.is_spam()) {
sgraphutil_cat.spam()
<< "Transforming frustum into local space of " << *arc << ": " << *local_frustum << "\n"
<< "Transform is:\n";
tt->get_matrix().write(sgraphutil_cat.spam(false), 2);
NodeTransitionWrapper ntw(TransformTransition::get_class_type());
wrt(_gsg->get_current_projection_node(),
arc->get_child(), _arc_chain.begin(), _arc_chain.end(),
ntw, _graph_type);
const TransformTransition *tt;
if (get_transition_into(tt, ntw)) {
// This frustum is transformed from the camera. Most will
// be.
nassertv(local_frustum != (GeometricBoundingVolume *)NULL);
local_frustum->xform(tt->get_matrix());
if (sgraphutil_cat.is_spam()) {
sgraphutil_cat.spam()
<< "Transforming frustum into local space of " << *arc << ": " << *local_frustum << "\n"
<< "Transform is:\n";
tt->get_matrix().write(sgraphutil_cat.spam(false), 2);
}
}
}
}

View File

@ -14,6 +14,13 @@
#include <geometricBoundingVolume.h>
#include <graphicsStateGuardian.h>
#include <arcChain.h>
#include <nodeTransitionWrapper.h>
#include <transformTransition.h>
#include <billboardTransition.h>
#include <wrt.h>
#include "config_sgraphutil.h"
///////////////////////////////////////////////////////////////////