1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 01:45:33 +00:00

Merge branch 'openxr_vr' of https://gitlab.com/madsbuvi/openmw into openxr_vr

This commit is contained in:
Mads Buvik Sandvei 2020-11-27 00:36:22 +01:00
commit 02c7e8ed2a

View file

@ -3995,6 +3995,18 @@ namespace MWWorld
float World::getTargetObject(MWRender::RayResult& result, osg::Transform* pointer, float maxDistance, bool ignorePlayer)
{
result = mRendering->castRay(pointer, maxDistance, ignorePlayer, false);
MWWorld::Ptr facedObject = result.mHitObject;
if (facedObject.isEmpty() && result.mHitRefnum.hasContentFile())
{
for (CellStore* cellstore : mWorldScene->getActiveCells())
{
facedObject = cellstore->searchViaRefNum(result.mHitRefnum);
if (!facedObject.isEmpty()) break;
}
}
result.mHitObject = facedObject;
if(result.mHit)
return result.mRatio * maxDistance;
return -1.f;