forked from mirror/openmw-tes3mp
Closes #841: Correct activation distance in third person mode
This commit is contained in:
parent
24aa743573
commit
c6421276bd
5 changed files with 14 additions and 0 deletions
|
@ -278,6 +278,11 @@ namespace MWRender
|
|||
}
|
||||
}
|
||||
|
||||
float Camera::getCameraDistance() const
|
||||
{
|
||||
return mCamera->getPosition().z;
|
||||
}
|
||||
|
||||
void Camera::setCameraDistance(float dist, bool adjust, bool override)
|
||||
{
|
||||
if(mFirstPersonView && !mPreviewMode && !mVanity.enabled)
|
||||
|
|
|
@ -105,6 +105,8 @@ namespace MWRender
|
|||
/// Restore default camera distance for current mode.
|
||||
void setCameraDistance();
|
||||
|
||||
float getCameraDistance() const;
|
||||
|
||||
void setAnimation(NpcAnimation *anim);
|
||||
|
||||
/// Stores focal and camera world positions in passed arguments
|
||||
|
|
|
@ -1026,4 +1026,9 @@ void RenderingManager::enableTerrain(bool enable)
|
|||
mTerrain->setVisible(false);
|
||||
}
|
||||
|
||||
float RenderingManager::getCameraDistance() const
|
||||
{
|
||||
return mCamera->getCameraDistance();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -90,6 +90,7 @@ public:
|
|||
|
||||
bool vanityRotateCamera(const float *rot);
|
||||
void setCameraDistance(float dist, bool adjust = false, bool override = true);
|
||||
float getCameraDistance() const;
|
||||
|
||||
void setupPlayer(const MWWorld::Ptr &ptr);
|
||||
void renderPlayer(const MWWorld::Ptr &ptr);
|
||||
|
|
|
@ -1329,6 +1329,7 @@ namespace MWWorld
|
|||
telekinesisRangeBonus = feetToGameUnits(telekinesisRangeBonus);
|
||||
|
||||
float activationDistance = getMaxActivationDistance() + telekinesisRangeBonus;
|
||||
activationDistance += mRendering->getCameraDistance();
|
||||
|
||||
// send new query
|
||||
// figure out which object we want to test against
|
||||
|
|
Loading…
Reference in a new issue