info-inventor-dev
[Top] [All Lists]

Re: Do SoViewingMatrixElement and SoViewVolumeElement break bounding box

To: Gavin Andresen <gavin@xxxxxxx>
Subject: Re: Do SoViewingMatrixElement and SoViewVolumeElement break bounding box cache?
From: Paul Strauss <pss@xxxxxxxxx>
Date: Thu, 16 Nov 2000 16:17:51 -0800
Cc: Chester Liu <cht@xxxxxxxxxxx>, info-inventor-dev@xxxxxxxxxxx
Sender: owner-info-inventor-dev@xxxxxxxxxxx
Gavin Andresen wrote:

> 
> >      const SbViewVolume & viewVol =
> >              SoViewVolumeElement::get(action->getState());
> >
> >      const SbMatrix & viewMat =
> >SoViewingMatrixElement::get(action->getState());
> >
> >
> >The separator reports that the bounding box cache (used for
> >render culling) is being invalidated.  If I comment out these
> >lines of code, it's fine.
> >
> >Why?
> 
> The ViewingMatrix and ViewVolume change whenever the camera moves, so if 
> your GetBoundingBox method relies on them, then the bbox cache SHOULD be 
> invalidated.

One of the keys to answering Chester's question is that calling the
"get()" methods on the elements results in a cache dependency being
created on those elements. So, yes, just looking at the values of the
elements (during cache construction) will change the behavior of the
cache.

----
Paul S. Strauss           pss@xxxxxxxxx        Pixar

<Prev in Thread] Current Thread [Next in Thread>