Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEMLP Logo Render, Kotlin 1.8.0, orx-easing #58

Merged
merged 5 commits into from
Apr 16, 2023
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
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ object Dependencies {
const val koin = "org.koin:koin-core:${Versions.koin}"
const val serializationJson = "org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.serializationJson}"
const val coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutines}"
const val orxEasing = "org.openrndr.extra:orx-easing:${Versions.orx}"

val processingLibs = listOf(
"minim",
Expand Down
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
object Versions {
const val kotlin = "1.6.10"
const val kotlin = "1.8.20"
const val serializationJson = "1.3.2"
const val coroutines = "1.6.0"
const val koin = "2.1.5"
const val orx = "0.4.3-alpha5"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal fun Project.configureCommonDependencies() {
dependencies {
add("implementation", Dependencies.koin)
add("implementation", Dependencies.coroutines)
add("implementation", Dependencies.orxEasing)
add(
"implementation",
fileTree(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.matsem.astral.core.tools.animations

import processing.core.PConstants
import processing.core.PConstants.TWO_PI

/**
* Provides access to various time-based animation functions, based on elapsed time since program run.
Expand All @@ -27,7 +28,7 @@ fun AnimationHandler.saw(fHz: Float, offset: Int = 0): Float =
* You could use the returned value to create a periodic motion, for instance by feeding
* the returned value into the sin() function, and using the result to drive the rotation of an object.
*/
fun AnimationHandler.radianSeconds(periodSeconds: Float) = provideMillis() / 1000f * PConstants.TWO_PI / periodSeconds
fun AnimationHandler.radianSeconds(periodSeconds: Float) = (provideMillis() / 1000f * PConstants.TWO_PI / periodSeconds) % PConstants.TWO_PI

/**
* Generates sweep from 0f..TWO_PI at frequency given by [hz].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ inline val Int.rgbGreen get() = this shr 8 and 0xff

inline val Int.rgbBlue get() = this and 0xff

fun Int.withAlpha(alpha: Int = 255) = this or (alpha shl 24)
fun Int.withAlpha(alpha: Int = 0xff) = this or (alpha shl 24)
Loading