mirror of
https://github.com/OpenMW/openmw.git
synced 2025-07-05 13:11:38 +00:00
Use nodeMask... lets ignore the previous attempt
This commit is contained in:
parent
de4d97826a
commit
ae0660db0a
1 changed files with 3 additions and 3 deletions
|
@ -1051,6 +1051,7 @@ namespace MWRender
|
||||||
RenderingManager::RayResult getIntersectionResult(osgUtil::LineSegmentIntersector* intersector,
|
RenderingManager::RayResult getIntersectionResult(osgUtil::LineSegmentIntersector* intersector,
|
||||||
const osg::ref_ptr<osgUtil::IntersectionVisitor>& visitor, std::span<const MWWorld::Ptr> ignoreList = {})
|
const osg::ref_ptr<osgUtil::IntersectionVisitor>& visitor, std::span<const MWWorld::Ptr> ignoreList = {})
|
||||||
{
|
{
|
||||||
|
constexpr auto nonObjectWorldMask = Mask_Terrain | Mask_Water;
|
||||||
RenderingManager::RayResult result;
|
RenderingManager::RayResult result;
|
||||||
result.mHit = false;
|
result.mHit = false;
|
||||||
result.mRatio = 0;
|
result.mRatio = 0;
|
||||||
|
@ -1065,10 +1066,9 @@ namespace MWRender
|
||||||
for (osg::NodePath::const_iterator it = intersection.nodePath.begin(); it != intersection.nodePath.end();
|
for (osg::NodePath::const_iterator it = intersection.nodePath.begin(); it != intersection.nodePath.end();
|
||||||
++it)
|
++it)
|
||||||
{
|
{
|
||||||
// Terrain doesnt contain any user data ptrs or flags, so we have to check the name
|
const auto& nodeMask = (*it)->getNodeMask();
|
||||||
// TODO: better solution for this that could also be used for water and other world pieces with flags
|
|
||||||
if (!hitNonObjectWorld)
|
if (!hitNonObjectWorld)
|
||||||
hitNonObjectWorld = (*it)->getName() == std::string_view("Terrain Root");
|
hitNonObjectWorld = nodeMask & nonObjectWorldMask;
|
||||||
|
|
||||||
osg::UserDataContainer* userDataContainer = (*it)->getUserDataContainer();
|
osg::UserDataContainer* userDataContainer = (*it)->getUserDataContainer();
|
||||||
if (!userDataContainer)
|
if (!userDataContainer)
|
||||||
|
|
Loading…
Reference in a new issue