mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add setting for near plane distance. (#6395)
* Allow setting the near plane * - Add near_plane limit of 0.5 to prevent x-ray. - Add more details to near_plane setting.
This commit is contained in:
parent
f547452685
commit
3c93a56e16
3 changed files with 9 additions and 0 deletions
|
@ -549,7 +549,9 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, f32 tool_r
|
|||
void Camera::updateViewingRange()
|
||||
{
|
||||
f32 viewing_range = g_settings->getFloat("viewing_range");
|
||||
f32 near_plane = g_settings->getFloat("near_plane");
|
||||
m_draw_control.wanted_range = viewing_range;
|
||||
m_cameranode->setNearValue(rangelim(near_plane, 0.0f, 0.5f) * BS);
|
||||
if (m_draw_control.range_all) {
|
||||
m_cameranode->setFarValue(100000.0);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue