forked from mirror/openmw-tes3mp
Fix intersections with Rig/MorphGeometry, was caused by an issue in the LineSegmentIntersector not respecting the cullingActive flag of a drawable.
This commit is contained in:
parent
7441f80e4c
commit
2e58024f1c
4 changed files with 14 additions and 4 deletions
|
@ -82,14 +82,17 @@ void MorphGeometry::accept(osg::NodeVisitor &nv)
|
|||
|
||||
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
|
||||
cull(&nv);
|
||||
else if (nv.getVisitorType() == osg::NodeVisitor::INTERSECTION_VISITOR)
|
||||
nv.apply(*getGeometry(mLastFrameNumber));
|
||||
else
|
||||
nv.apply(*this);
|
||||
|
||||
nv.popFromNodePath();
|
||||
}
|
||||
|
||||
void MorphGeometry::accept(osg::PrimitiveFunctor& func) const
|
||||
{
|
||||
getGeometry(mLastFrameNumber)->accept(func);
|
||||
}
|
||||
|
||||
osg::BoundingBox MorphGeometry::computeBoundingBox() const
|
||||
{
|
||||
bool anyMorphTarget = false;
|
||||
|
|
|
@ -57,6 +57,8 @@ namespace SceneUtil
|
|||
osg::ref_ptr<osg::Geometry> getSourceGeometry() const;
|
||||
|
||||
virtual void accept(osg::NodeVisitor &nv);
|
||||
virtual bool supports(const osg::PrimitiveFunctor&) const { return true; }
|
||||
virtual void accept(osg::PrimitiveFunctor&) const;
|
||||
|
||||
virtual osg::BoundingBox computeBoundingBox() const;
|
||||
|
||||
|
|
|
@ -318,14 +318,17 @@ void RigGeometry::accept(osg::NodeVisitor &nv)
|
|||
cull(&nv);
|
||||
else if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
|
||||
updateBounds(&nv);
|
||||
else if (nv.getVisitorType() == osg::NodeVisitor::INTERSECTION_VISITOR)
|
||||
nv.apply(*getGeometry(mLastFrameNumber));
|
||||
else
|
||||
nv.apply(*this);
|
||||
|
||||
nv.popFromNodePath();
|
||||
}
|
||||
|
||||
void RigGeometry::accept(osg::PrimitiveFunctor& func) const
|
||||
{
|
||||
getGeometry(mLastFrameNumber)->accept(func);
|
||||
}
|
||||
|
||||
osg::Geometry* RigGeometry::getGeometry(unsigned int frame) const
|
||||
{
|
||||
return mGeometry[frame%2].get();
|
||||
|
|
|
@ -48,6 +48,8 @@ namespace SceneUtil
|
|||
osg::ref_ptr<osg::Geometry> getSourceGeometry();
|
||||
|
||||
virtual void accept(osg::NodeVisitor &nv);
|
||||
virtual bool supports(const osg::PrimitiveFunctor&) const { return true; }
|
||||
virtual void accept(osg::PrimitiveFunctor&) const;
|
||||
|
||||
private:
|
||||
void cull(osg::NodeVisitor* nv);
|
||||
|
|
Loading…
Reference in a new issue