Added check against the validity of the _inverse matrix pointer.

This commit is contained in:
Robert Osfield
2005-12-19 15:05:26 +00:00
parent 523f608ba6
commit aef81ae00d

View File

@@ -211,7 +211,7 @@ bool IntersectVisitor::hits()
osg::Vec3 IntersectVisitor::getEyePoint() const
{
const IntersectState* cis = _intersectStateStack.empty() ? 0 : _intersectStateStack.back().get();
if (cis)
if (cis && cis->_inverse.valid())
{
//osg::notify(osg::NOTICE)<<"IntersectVisitor::getEyePoint()"<<_pseudoEyePoint * (*(cis->_inverse))<<std::endl;
return _pseudoEyePoint * (*(cis->_inverse));