Skip to content

Commit

Permalink
Rename package from com.curiouscreature to dev.romainguy
Browse files Browse the repository at this point in the history
  • Loading branch information
romainguy committed Nov 12, 2021
1 parent db86d8e commit e9e9b8d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@file:Suppress("unused")

package com.curiouscreature.kotlin.math
package dev.romainguy.kotlin.math

import kotlin.math.*

Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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 {
Expand All @@ -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
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9e9b8d

Please sign in to comment.