Added new Node/Drawable::s/getInitialBound and Node/Drawable::s/getComputeBoundCallback

methods and reimplement computeBound so that it passes back a bounding volume rather
than modifying the local one.
This commit is contained in:
Robert Osfield
2005-05-12 14:03:22 +00:00
parent ad2bd31ac8
commit bf4d63f6ea
52 changed files with 337 additions and 377 deletions

View File

@@ -69,10 +69,10 @@ void DrawPixels::getSubImageDimensions(unsigned int& offsetX,unsigned int& offse
}
bool DrawPixels::computeBound() const
BoundingBox DrawPixels::computeBound() const
{
// really needs to be dependant of view poistion and projection... will implement simple version right now.
_bbox.init();
BoundingBox bbox;
float diagonal = 0.0f;
if (_useSubImage)
{
@@ -83,10 +83,9 @@ bool DrawPixels::computeBound() const
diagonal = sqrtf(_image->s()*_image->s()+_image->t()*_image->t());
}
_bbox.expandBy(_position-osg::Vec3(diagonal,diagonal,diagonal));
_bbox.expandBy(_position+osg::Vec3(diagonal,diagonal,diagonal));
_bbox_computed = true;
return true;
bbox.expandBy(_position-osg::Vec3(diagonal,diagonal,diagonal));
bbox.expandBy(_position+osg::Vec3(diagonal,diagonal,diagonal));
return bbox;
}
void DrawPixels::drawImplementation(State&) const