Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ kotlin.mpp.stability.nowarn=true
kotlin.mpp.enableCInteropCommonization=true

#Versions
kotlin.version=2.1.20
kotlin.version=2.3.10

#Dokka
org.jetbrains.dokka.experimental.gradle.pluginMode=V2EnabledWithHelpers

#Phosphor
phosphorVersion=0.2.2
phosphorVersion=0.2.3
13 changes: 13 additions & 0 deletions kotlin-js-store/wasm/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@js-joda/core@3.2.0":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-3.2.0.tgz#3e61e21b7b2b8a6be746df1335cf91d70db2a273"
integrity sha512-PMqgJ0sw5B7FKb2d5bWYIoxjri+QlW/Pys7+Rw82jSH0QN3rB05jZ/VrrsUdh1w4+i2kw9JOejXGq/KhDOX7Kg==

format-util@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271"
integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg==
969 changes: 625 additions & 344 deletions kotlin-js-store/yarn.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions phosphor-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinMultiplatform
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework

Expand Down Expand Up @@ -30,6 +31,7 @@ kotlin {
binaries.executable()
}

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser()
binaries.executable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ class AgentLayer(
val phi = acos(1f - 2f * (i + 0.5f) / count)

Vector3(
(sin(phi) * cos(theta) * radius).toFloat(),
(cos(phi) * radius).toFloat(),
(sin(phi) * sin(theta) * radius).toFloat(),
sin(phi) * cos(theta) * radius,
cos(phi) * radius,
sin(phi) * sin(theta) * radius,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class FlowConnectionTest {
assertEquals(FlowState.ACTIVATING, started.state)
assertEquals(0f, started.progress)
assertNotNull(started.taskToken)
assertEquals(Vector2(10f, 5f), started.taskToken?.position)
assertEquals(Vector2(10f, 5f), started.taskToken.position)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import kotlin.test.assertTrue
import link.socket.phosphor.math.Point
import link.socket.phosphor.math.Vector2

private const val FLOAT_TOLERANCE = 1e-6f

class SubstrateAnimatorTest {
@Test
fun `updateAmbient advances time`() {
Expand Down Expand Up @@ -182,7 +184,7 @@ class SubstrateAnimatorTest {
assertEquals(
0.4f,
clearedState.getDensity(x, y),
"Density at ($x, $y) should be base density",
FLOAT_TOLERANCE,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import kotlin.test.assertNotEquals
import link.socket.phosphor.math.Point
import link.socket.phosphor.math.Vector2

private const val FLOAT_TOLERANCE = 1e-6f

class SubstrateStateTest {
@Test
fun `create substrate with correct dimensions`() {
Expand All @@ -22,7 +24,7 @@ class SubstrateStateTest {
val state = SubstrateState.create(5, 5, baseDensity = 0.7f)
for (y in 0 until 5) {
for (x in 0 until 5) {
assertEquals(0.7f, state.getDensity(x, y))
assertEquals(0.7f, state.getDensity(x, y), FLOAT_TOLERANCE)
}
}
}
Expand All @@ -31,7 +33,7 @@ class SubstrateStateTest {
fun `get and set density`() {
val state = SubstrateState.create(5, 5)
state.setDensity(2, 3, 0.8f)
assertEquals(0.8f, state.getDensity(2, 3))
assertEquals(0.8f, state.getDensity(2, 3), FLOAT_TOLERANCE)
}

@Test
Expand Down Expand Up @@ -143,9 +145,9 @@ class SubstrateGlyphsTest {
fun `getThresholds returns copy of thresholds`() {
val thresholds = SubstrateGlyphs.getThresholds()
assertEquals(4, thresholds.size)
assertEquals(0.2f, thresholds[0])
assertEquals(0.4f, thresholds[1])
assertEquals(0.6f, thresholds[2])
assertEquals(0.8f, thresholds[3])
assertEquals(0.2f, thresholds[0], FLOAT_TOLERANCE)
assertEquals(0.4f, thresholds[1], FLOAT_TOLERANCE)
assertEquals(0.6f, thresholds[2], FLOAT_TOLERANCE)
assertEquals(0.8f, thresholds[3], FLOAT_TOLERANCE)
}
}