[orx-keyframer] Add DoubleArrayChannel
This commit is contained in:
@@ -18,7 +18,6 @@ import kotlin.reflect.KProperty1
|
|||||||
import kotlin.reflect.full.memberProperties
|
import kotlin.reflect.full.memberProperties
|
||||||
import kotlin.reflect.jvm.isAccessible
|
import kotlin.reflect.jvm.isAccessible
|
||||||
|
|
||||||
|
|
||||||
enum class KeyframerFormat {
|
enum class KeyframerFormat {
|
||||||
SIMPLE,
|
SIMPLE,
|
||||||
FULL
|
FULL
|
||||||
@@ -97,6 +96,18 @@ open class Keyframer {
|
|||||||
ColorRGBa(getValue(0), getValue(1), getValue(2))
|
ColorRGBa(getValue(0), getValue(1), getValue(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inner class DoubleArrayChannel(keys: Array<String>, defaultValue: DoubleArray = DoubleArray(keys.size)) :
|
||||||
|
CompoundChannel(keys, defaultValue.toTypedArray()) {
|
||||||
|
operator fun getValue(keyframer: Keyframer, property: KProperty<*>): DoubleArray {
|
||||||
|
val result = DoubleArray(keys.size)
|
||||||
|
for (i in keys.indices) {
|
||||||
|
result[i] = getValue(i)
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
val channels = mutableMapOf<String, KeyframerChannel>()
|
val channels = mutableMapOf<String, KeyframerChannel>()
|
||||||
|
|
||||||
fun loadFromJson(
|
fun loadFromJson(
|
||||||
|
|||||||
Reference in New Issue
Block a user