rhodonite
    Preparing search index...

    Function detectBoneDataTypeForSkin

    • Chooses the bone data type for a skin of a glTF model.

      The skinning result depends on the transforms of the joints, the skinned node and their ancestors, and on the inverse bind matrices. If all of their scales (static values and animations) are uniform, or no scale is specified, Vec4x1 (the most compact format, which supports only uniform scale) is chosen. Otherwise Vec4x2 (which supports non-uniform scale) is chosen. If a non-uniform scale still appears at runtime (e.g. an animation assigned later), SkeletalComponent switches the automatically selected Vec4x1 to Vec4x2.

      Note: _setupAnimation must have been called before this function so that animation output data is available.

      Parameters

      • gltfModel: RnM2

        The glTF model

      • skin: RnM2Skin

        The skin to check

      • skinnedNodeIndex: number

        The index of the node which has the skin

      • OptionalinverseBindMatrices: ArrayLike<number>

        The inverse bind matrices of the skin (column-major, 16 elements per joint)

      Returns EnumIO

      Vec4x1 if all scales are uniform, otherwise Vec4x2