commonMain.ru.casperix.spine.Bone.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
import casperix.math.quad_matrix.float32.Matrix3f
import ru.casperix.math.Transform
class Bone(
val skeleton: Skeleton,
val data: BoneData,
val parent: Bone?,
) {
var isActive = true
val children = mutableListOf()
var inherit: Inherit = Inherit.normal
var local = data.local
var applied = Transform()
var world = Matrix3f.IDENTITY
fun updateTransform() {
if (parent != null) {
world = local.toLHSMatrix() * parent.world
} else {
world = local.toLHSMatrix()
}
}
}