camera: clip at max render distance

This commit is contained in:
Moritz Zwerger 2023-10-30 17:50:17 +01:00
parent 4a2d325490
commit adb5879db6
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -1,6 +1,6 @@
/* /*
* Minosoft * Minosoft
* Copyright (C) 2020-2022 Moritz Zwerger * Copyright (C) 2020-2023 Moritz Zwerger
* *
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* *
@ -14,10 +14,12 @@
package de.bixilon.minosoft.gui.rendering.camera package de.bixilon.minosoft.gui.rendering.camera
import de.bixilon.kotlinglm.vec3.Vec3 import de.bixilon.kotlinglm.vec3.Vec3
import de.bixilon.minosoft.data.world.World
import de.bixilon.minosoft.protocol.protocol.ProtocolDefinition
object CameraDefinition { object CameraDefinition {
const val NEAR_PLANE = 0.01f const val NEAR_PLANE = 0.01f
const val FAR_PLANE = 10000.0f const val FAR_PLANE = World.MAX_RENDER_DISTANCE * ProtocolDefinition.SECTION_LENGTH.toFloat()
val CAMERA_UP_VEC3 = Vec3(0.0, 1.0, 0.0) val CAMERA_UP_VEC3 = Vec3(0.0f, 1.0f, 0.0f)
} }