commonMain.ru.casperix.spine.animation.RotateTimeline.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spine-jvm Show documentation
Show all versions of spine-jvm Show documentation
Signals for all occasions
package ru.casperix.spine.animation
class RotateTimeline(
override val boneIndex: Int,
override val frames: List,
) : AbstractTimeline(frames), CurveTimeline1, BoneTimeline {
private val rotationController = BoneTransformChannel(frames, false, 0, { it.angle }, { it.rotation })
override fun apply(context: AnimationContext) = context.getBoneContext(boneIndex)?.run {
bone.local = bone.local.copy(rotation = rotationController.getCurrentValue(this))
} ?: Unit
}