Upgrade to JDK 17. Add @JvmRecord annotations

This commit is contained in:
Edwin Jakobs
2024-06-01 07:31:44 +02:00
parent 06f593053b
commit 78fbff54c5
38 changed files with 94 additions and 33 deletions

View File

@@ -1,7 +1,9 @@
package org.openrndr.extra.hashgrid
import org.openrndr.math.Vector3
import kotlin.jvm.JvmRecord
@JvmRecord
data class Box3D(val corner: Vector3, val width: Double, val height: Double, val depth: Double) {
companion object {
val EMPTY = Box3D(Vector3.ZERO, 0.0, 0.0, 0.0)

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.hashgrid
import org.openrndr.math.Vector2
import org.openrndr.shape.Rectangle
import kotlin.jvm.JvmRecord
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min
@@ -12,6 +13,7 @@ private fun Double.fastFloor(): Int {
return if (this >= 0) this.toInt() else this.toInt() - 1
}
@JvmRecord
private data class GridCoords(val x: Int, val y: Int) {
fun offset(i: Int, j: Int): GridCoords = copy(x = x + i, y = y + j)
}

View File

@@ -1,5 +1,6 @@
package org.openrndr.extra.hashgrid
import org.openrndr.math.Vector3
import kotlin.jvm.JvmRecord
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min
@@ -10,6 +11,7 @@ private fun Double.fastFloor(): Int {
return if (this >= 0) this.toInt() else this.toInt() - 1
}
@JvmRecord
private data class GridCoords3D(val x: Int, val y: Int, val z: Int) {
fun offset(i: Int, j: Int, k : Int): GridCoords3D = copy(x = x + i, y = y + j, z = z + k)
}