rendering: add support for noclip movement

This commit is contained in:
Lukas 2021-04-07 16:00:05 +02:00
parent 5124b7b8f2
commit ae0efeafed
3 changed files with 7 additions and 4 deletions

View File

@ -19,4 +19,5 @@ data class CameraGameConfig(
@Json(name = "render_distance") var renderDistance: Int = 10,
var fov: Float = 60f,
@Json(name = "mouse_sensitivity") var moseSensitivity: Float = 0.1f,
@Json(name = "no_clip_movement") var noCipMovement: Boolean = false,
)

View File

@ -145,8 +145,10 @@ class Camera(
fun handleInput(deltaTime: Double) {
var cameraSpeed = movementSpeed * deltaTime
val movementFront = Vec3(cameraFront)
movementFront.y = 0.0f
movementFront.normalizeAssign() // when moving forwards, do not move down
if (! Minosoft.getConfig().config.game.camera.noCipMovement) {
movementFront.y = 0.0f
movementFront.normalizeAssign() // when moving forwards, do not move down
}
if (keySprintDown) {
cameraSpeed *= 5
}

View File

@ -211,10 +211,10 @@ class FluidRenderer(
if (blockState == null) {
return false
}
if (blockState.owner.resourceLocation.full.contains(regex)) {
if (blockState.properties[BlockProperties.WATERLOGGED] == true) {
return true
}
if (blockState.properties[BlockProperties.WATERLOGGED] == true) {
if (blockState.owner.resourceLocation.full.contains(regex)) {
return true
}
return false