Skip to content

Commit

Permalink
Merge pull request #58 from matejsemancik/feature/semlp-logo-render
Browse files Browse the repository at this point in the history
SEMLP Logo Render, Kotlin 1.8.0, orx-easing
  • Loading branch information
matejsemancik committed Apr 16, 2023
2 parents 8576e25 + 4b98284 commit e528629
Show file tree
Hide file tree
Showing 8 changed files with 32,319 additions and 5 deletions.
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

0 comments on commit e528629

Please sign in to comment.