mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 14:09:39 +00:00
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)
|
void Camera::setCameraDistance(float dist, bool adjust, bool override)
|
||||||
{
|
{
|
||||||
if(mFirstPersonView && !mPreviewMode && !mVanity.enabled)
|
if(mFirstPersonView && !mPreviewMode && !mVanity.enabled)
|
||||||
|
|
|
@ -105,6 +105,8 @@ namespace MWRender
|
||||||
/// Restore default camera distance for current mode.
|
/// Restore default camera distance for current mode.
|
||||||
void setCameraDistance();
|
void setCameraDistance();
|
||||||
|
|
||||||
|
float getCameraDistance() const;
|
||||||
|
|
||||||
void setAnimation(NpcAnimation *anim);
|
void setAnimation(NpcAnimation *anim);
|
||||||
|
|
||||||
/// Stores focal and camera world positions in passed arguments
|
/// Stores focal and camera world positions in passed arguments
|
||||||
|
|
|
@ -1026,4 +1026,9 @@ void RenderingManager::enableTerrain(bool enable)
|
||||||
mTerrain->setVisible(false);
|
mTerrain->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float RenderingManager::getCameraDistance() const
|
||||||
|
{
|
||||||
|
return mCamera->getCameraDistance();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -90,6 +90,7 @@ public:
|
||||||
|
|
||||||
bool vanityRotateCamera(const float *rot);
|
bool vanityRotateCamera(const float *rot);
|
||||||
void setCameraDistance(float dist, bool adjust = false, bool override = true);
|
void setCameraDistance(float dist, bool adjust = false, bool override = true);
|
||||||
|
float getCameraDistance() const;
|
||||||
|
|
||||||
void setupPlayer(const MWWorld::Ptr &ptr);
|
void setupPlayer(const MWWorld::Ptr &ptr);
|
||||||
void renderPlayer(const MWWorld::Ptr &ptr);
|
void renderPlayer(const MWWorld::Ptr &ptr);
|
||||||
|
|
|
@ -1329,6 +1329,7 @@ namespace MWWorld
|
||||||
telekinesisRangeBonus = feetToGameUnits(telekinesisRangeBonus);
|
telekinesisRangeBonus = feetToGameUnits(telekinesisRangeBonus);
|
||||||
|
|
||||||
float activationDistance = getMaxActivationDistance() + telekinesisRangeBonus;
|
float activationDistance = getMaxActivationDistance() + telekinesisRangeBonus;
|
||||||
|
activationDistance += mRendering->getCameraDistance();
|
||||||
|
|
||||||
// send new query
|
// send new query
|
||||||
// figure out which object we want to test against
|
// figure out which object we want to test against
|
||||||
|
|
Loading…
Reference in a new issue