diff --git a/build.gradle b/build.gradle index 1c4837b..824ab33 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id "org.jetbrains.kotlin.jvm" version "1.5.21" + id "org.jetbrains.kotlin.jvm" version "1.5.31" } apply plugin: 'idea' @@ -10,10 +10,10 @@ repositories { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.21" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31" - testImplementation "org.jetbrains.kotlin:kotlin-test-junit" - testImplementation 'junit:junit:4.12' + testImplementation 'org.jetbrains.kotlin:kotlin-test-junit:1.5.31' + testImplementation 'junit:junit:4.13.2' } sourceSets { diff --git a/src/main/kotlin/com/curiouscreature/kotlin/math/Matrix.kt b/src/main/kotlin/dev/romainguy/kotlin/math/Matrix.kt similarity index 95% rename from src/main/kotlin/com/curiouscreature/kotlin/math/Matrix.kt rename to src/main/kotlin/dev/romainguy/kotlin/math/Matrix.kt index af87fdf..699cad7 100644 --- a/src/main/kotlin/com/curiouscreature/kotlin/math/Matrix.kt +++ b/src/main/kotlin/dev/romainguy/kotlin/math/Matrix.kt @@ -16,7 +16,7 @@ @file:Suppress("unused") -package com.curiouscreature.kotlin.math +package dev.romainguy.kotlin.math import kotlin.math.* @@ -410,7 +410,7 @@ fun inverse(m: Mat3): Mat3 { val det = a * A + b * B + c * C return Mat3.of( - A / det, B / det, C / det, + A / det, B / det, C / det, (c * h - b * i) / det, (a * i - c * g) / det, (b * g - a * h) / det, (b * f - c * e) / det, (c * d - a * f) / det, (a * e - b * d) / det ) @@ -504,10 +504,10 @@ fun rotation(d: Float3): Mat4 { val s = transform(r) { x -> sin(x) } return Mat4.of( - c.y * c.z, -c.x * s.z + s.x * s.y * c.z, s.x * s.z + c.x * s.y * c.z, 0.0f, - c.y * s.z, c.x * c.z + s.x * s.y * s.z, -s.x * c.z + c.x * s.y * s.z, 0.0f, - -s.y , s.x * c.y , c.x * c.y , 0.0f, - 0.0f , 0.0f , 0.0f , 1.0f + c.y * c.z, -c.x * s.z + s.x * s.y * c.z, s.x * s.z + c.x * s.y * c.z, 0.0f, + c.y * s.z, c.x * c.z + s.x * s.y * s.z, -s.x * c.z + c.x * s.y * s.z, 0.0f, + -s.y, s.x * c.y, c.x * c.y, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f ) } fun rotation(axis: Float3, angle: Float): Mat4 { @@ -521,10 +521,10 @@ fun rotation(axis: Float3, angle: Float): Mat4 { val d = 1.0f - c return Mat4.of( - x * x * d + c , x * y * d - z * s, x * z * d + y * s, 0.0f, - y * x * d + z * s, y * y * d + c , y * z * d - x * s, 0.0f, - z * x * d - y * s, z * y * d + x * s, z * z * d + c , 0.0f, - 0.0f , 0.0f , 0.0f , 1.0f + x * x * d + c, x * y * d - z * s, x * z * d + y * s, 0.0f, + y * x * d + z * s, y * y * d + c, y * z * d - x * s, 0.0f, + z * x * d - y * s, z * y * d + x * s, z * z * d + c, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f ) } diff --git a/src/main/kotlin/com/curiouscreature/kotlin/math/Ray.kt b/src/main/kotlin/dev/romainguy/kotlin/math/Ray.kt similarity index 94% rename from src/main/kotlin/com/curiouscreature/kotlin/math/Ray.kt rename to src/main/kotlin/dev/romainguy/kotlin/math/Ray.kt index 501bff3..937aa8b 100644 --- a/src/main/kotlin/com/curiouscreature/kotlin/math/Ray.kt +++ b/src/main/kotlin/dev/romainguy/kotlin/math/Ray.kt @@ -16,7 +16,7 @@ @file:Suppress("unused") -package com.curiouscreature.kotlin.math +package dev.romainguy.kotlin.math data class Ray(var origin: Float3 = Float3(), var direction: Float3) diff --git a/src/main/kotlin/com/curiouscreature/kotlin/math/Scalar.kt b/src/main/kotlin/dev/romainguy/kotlin/math/Scalar.kt similarity index 97% rename from src/main/kotlin/com/curiouscreature/kotlin/math/Scalar.kt rename to src/main/kotlin/dev/romainguy/kotlin/math/Scalar.kt index 481c5d0..ce6b219 100644 --- a/src/main/kotlin/com/curiouscreature/kotlin/math/Scalar.kt +++ b/src/main/kotlin/dev/romainguy/kotlin/math/Scalar.kt @@ -16,7 +16,7 @@ @file:Suppress("NOTHING_TO_INLINE", "unused") -package com.curiouscreature.kotlin.math +package dev.romainguy.kotlin.math const val PI = 3.1415926536f const val HALF_PI = PI * 0.5f diff --git a/src/main/kotlin/com/curiouscreature/kotlin/math/Vector.kt b/src/main/kotlin/dev/romainguy/kotlin/math/Vector.kt similarity index 99% rename from src/main/kotlin/com/curiouscreature/kotlin/math/Vector.kt rename to src/main/kotlin/dev/romainguy/kotlin/math/Vector.kt index fd1faae..f20a210 100644 --- a/src/main/kotlin/com/curiouscreature/kotlin/math/Vector.kt +++ b/src/main/kotlin/dev/romainguy/kotlin/math/Vector.kt @@ -16,7 +16,7 @@ @file:Suppress("NOTHING_TO_INLINE", "unused") -package com.curiouscreature.kotlin.math +package dev.romainguy.kotlin.math import kotlin.math.abs import kotlin.math.max diff --git a/src/test/kotlin/com/curiouscreature/kotlin/math/MatrixTest.kt b/src/test/kotlin/dev/romainguy/kotlin/math/MatrixTest.kt similarity index 99% rename from src/test/kotlin/com/curiouscreature/kotlin/math/MatrixTest.kt rename to src/test/kotlin/dev/romainguy/kotlin/math/MatrixTest.kt index 6acf24e..82ee4f8 100644 --- a/src/test/kotlin/com/curiouscreature/kotlin/math/MatrixTest.kt +++ b/src/test/kotlin/dev/romainguy/kotlin/math/MatrixTest.kt @@ -14,12 +14,11 @@ * limitations under the License. */ -package com.curiouscreature.kotlin.math +package dev.romainguy.kotlin.math import org.junit.Assert import org.junit.Test import kotlin.test.assertEquals -import kotlin.test.assertNotEquals class MatrixTest { @Test