mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 17:45:32 +00:00
Merge branch 'openxr_vr' of https://gitlab.com/madsbuvi/openmw into openxr_vr
This commit is contained in:
commit
02c7e8ed2a
1 changed files with 12 additions and 0 deletions
|
@ -3995,6 +3995,18 @@ namespace MWWorld
|
||||||
float World::getTargetObject(MWRender::RayResult& result, osg::Transform* pointer, float maxDistance, bool ignorePlayer)
|
float World::getTargetObject(MWRender::RayResult& result, osg::Transform* pointer, float maxDistance, bool ignorePlayer)
|
||||||
{
|
{
|
||||||
result = mRendering->castRay(pointer, maxDistance, ignorePlayer, false);
|
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)
|
if(result.mHit)
|
||||||
return result.mRatio * maxDistance;
|
return result.mRatio * maxDistance;
|
||||||
return -1.f;
|
return -1.f;
|
||||||
|
|
Loading…
Reference in a new issue