Upgrade to JDK 17. Add @JvmRecord annotations
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user