All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.ru.casperix.spine.Bone.kt Maven / Gradle / Ivy

The newest version!
package ru.casperix.spine

import ru.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()
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy