mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-09 07:20:04 -04:00
matrix handler: rename upToDate to invalid
This commit is contained in:
parent
74574b7952
commit
6f562af3bf
@ -56,10 +56,10 @@ class MatrixHandler(
|
|||||||
var zoom = 0.0f
|
var zoom = 0.0f
|
||||||
set(value) {
|
set(value) {
|
||||||
field = value
|
field = value
|
||||||
upToDate = false
|
invalidate()
|
||||||
}
|
}
|
||||||
|
|
||||||
private var upToDate = false
|
private var invalid = false
|
||||||
|
|
||||||
var viewMatrix = Mat4()
|
var viewMatrix = Mat4()
|
||||||
private set
|
private set
|
||||||
@ -105,7 +105,7 @@ class MatrixHandler(
|
|||||||
fun init() {
|
fun init() {
|
||||||
connection.events.listen<ResizeWindowEvent> {
|
connection.events.listen<ResizeWindowEvent> {
|
||||||
calculateProjectionMatrix(calculateFOV(), Vec2(it.size))
|
calculateProjectionMatrix(calculateFOV(), Vec2(it.size))
|
||||||
upToDate = false
|
invalidate()
|
||||||
}
|
}
|
||||||
draw() // set initial values
|
draw() // set initial values
|
||||||
}
|
}
|
||||||
@ -120,7 +120,7 @@ class MatrixHandler(
|
|||||||
context.camera.offset.draw()
|
context.camera.offset.draw()
|
||||||
val matrixPosition = Vec3(eyePosition - context.camera.offset.offset)
|
val matrixPosition = Vec3(eyePosition - context.camera.offset.offset)
|
||||||
val front = view.front
|
val front = view.front
|
||||||
if (upToDate && matrixPosition == this.matrixPosition && front == this.front && fov == previousFOV && shaking.isEmpty) {
|
if (!invalid && matrixPosition == this.matrixPosition && front == this.front && fov == previousFOV && shaking.isEmpty) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.matrixPosition = matrixPosition
|
this.matrixPosition = matrixPosition
|
||||||
@ -153,7 +153,7 @@ class MatrixHandler(
|
|||||||
)
|
)
|
||||||
|
|
||||||
updateShaders(useMatrixPosition)
|
updateShaders(useMatrixPosition)
|
||||||
upToDate = true
|
invalid = false
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateViewProjectionMatrix() {
|
private fun updateViewProjectionMatrix() {
|
||||||
@ -178,6 +178,6 @@ class MatrixHandler(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun invalidate() {
|
fun invalidate() {
|
||||||
upToDate = false
|
invalid = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user