mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-29 04:20:29 +00:00
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
@ -82,14 +82,17 @@ void MorphGeometry::accept(osg::NodeVisitor &nv)
|
|||||||
|
|
||||||
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
|
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
|
||||||
cull(&nv);
|
cull(&nv);
|
||||||
else if (nv.getVisitorType() == osg::NodeVisitor::INTERSECTION_VISITOR)
|
|
||||||
nv.apply(*getGeometry(mLastFrameNumber));
|
|
||||||
else
|
else
|
||||||
nv.apply(*this);
|
nv.apply(*this);
|
||||||
|
|
||||||
nv.popFromNodePath();
|
nv.popFromNodePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MorphGeometry::accept(osg::PrimitiveFunctor& func) const
|
||||||
|
{
|
||||||
|
getGeometry(mLastFrameNumber)->accept(func);
|
||||||
|
}
|
||||||
|
|
||||||
osg::BoundingBox MorphGeometry::computeBoundingBox() const
|
osg::BoundingBox MorphGeometry::computeBoundingBox() const
|
||||||
{
|
{
|
||||||
bool anyMorphTarget = false;
|
bool anyMorphTarget = false;
|
||||||
|
@ -57,6 +57,8 @@ namespace SceneUtil
|
|||||||
osg::ref_ptr<osg::Geometry> getSourceGeometry() const;
|
osg::ref_ptr<osg::Geometry> getSourceGeometry() const;
|
||||||
|
|
||||||
virtual void accept(osg::NodeVisitor &nv);
|
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;
|
virtual osg::BoundingBox computeBoundingBox() const;
|
||||||
|
|
||||||
|
@ -318,14 +318,17 @@ void RigGeometry::accept(osg::NodeVisitor &nv)
|
|||||||
cull(&nv);
|
cull(&nv);
|
||||||
else if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
|
else if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
|
||||||
updateBounds(&nv);
|
updateBounds(&nv);
|
||||||
else if (nv.getVisitorType() == osg::NodeVisitor::INTERSECTION_VISITOR)
|
|
||||||
nv.apply(*getGeometry(mLastFrameNumber));
|
|
||||||
else
|
else
|
||||||
nv.apply(*this);
|
nv.apply(*this);
|
||||||
|
|
||||||
nv.popFromNodePath();
|
nv.popFromNodePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RigGeometry::accept(osg::PrimitiveFunctor& func) const
|
||||||
|
{
|
||||||
|
getGeometry(mLastFrameNumber)->accept(func);
|
||||||
|
}
|
||||||
|
|
||||||
osg::Geometry* RigGeometry::getGeometry(unsigned int frame) const
|
osg::Geometry* RigGeometry::getGeometry(unsigned int frame) const
|
||||||
{
|
{
|
||||||
return mGeometry[frame%2].get();
|
return mGeometry[frame%2].get();
|
||||||
|
@ -48,6 +48,8 @@ namespace SceneUtil
|
|||||||
osg::ref_ptr<osg::Geometry> getSourceGeometry();
|
osg::ref_ptr<osg::Geometry> getSourceGeometry();
|
||||||
|
|
||||||
virtual void accept(osg::NodeVisitor &nv);
|
virtual void accept(osg::NodeVisitor &nv);
|
||||||
|
virtual bool supports(const osg::PrimitiveFunctor&) const { return true; }
|
||||||
|
virtual void accept(osg::PrimitiveFunctor&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void cull(osg::NodeVisitor* nv);
|
void cull(osg::NodeVisitor* nv);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user