Avatar是什么

Avatar是什么
Working with humanoid animations

The Mecanim Animation System is particularly well suited for working with animations for humanoid skeletons. Since humanoid skeletons are used extensively in games, Unity provides a specialized workflow, and an extended tool set for humanoid animations.Because of the similarity in bone structure, it is possible to map animations from one humanoid skeleton to another, allowing retargeting and inverse kinematics. With rare exceptions, humanoid models can be expected to have the same basic structure, representing the major articulate parts of the body, head and limbs. The Mecanim system makes good use of this idea to simplify the rigging and control of animations. A fundamental step in creating a animation is to set up a mapping between the simplified humanoid bone structure understood by Mecanim and the actual bones present in the skeleton; in Mecanim terminology, this mapping is called an Avatar. The pages in this section explain how to create an Avatar for your model.


Avatar其实就是一个映射表,记录着动画骨骼与真实骨骼的映射信息
在这里插入图片描述


public class Avatar : Object
{
    private Avatar()
    {
    }
    // Return true if this avatar is a valid mecanim avatar. It can be a generic avatar or a human avatar.
    extern public bool isValid
    {
        [NativeMethod("IsValid")]
        get;
    }
    // Return true if this avatar is a valid human avatar.
    extern public bool isHuman
    {
        [NativeMethod("IsHuman")]
        get;
    }
    extern public HumanDescription humanDescription
    {
        get;
    }
    .......
}
 public struct HumanDescription
    {
        [NativeName("m_Human")]
        public HumanBone[]      human;
        [NativeName("m_Skeleton")]
        public SkeletonBone[]   skeleton;

        internal float  m_ArmTwist;
        internal float  m_ForeArmTwist;
        internal float  m_UpperLegTwist;
        internal float  m_LegTwist;
        internal float  m_ArmStretch;
        internal float  m_LegStretch;
        internal float  m_FeetSpacing;
        internal float  m_GlobalScale;

        internal string  m_RootMotionBoneName;

        internal bool   m_HasTranslationDoF;

        internal bool   m_HasExtraRoot;
        internal bool   m_SkeletonHasParents;

        public float    upperArmTwist { get { return m_ArmTwist; } set { m_ArmTwist = value; }   }
        public float    lowerArmTwist { get { return m_ForeArmTwist; } set { m_ForeArmTwist = value; }   }
        public float    upperLegTwist { get { return m_UpperLegTwist; } set { m_UpperLegTwist = value; }     }
        public float    lowerLegTwist { get { return m_LegTwist; } set { m_LegTwist = value; }   }
        public float    armStretch { get { return m_ArmStretch; } set { m_ArmStretch = value; }  }
        public float    legStretch { get { return m_LegStretch; } set { m_LegStretch = value; }  }
        public float    feetSpacing { get { return m_FeetSpacing; } set { m_FeetSpacing = value; }   }
        public bool     hasTranslationDoF { get { return m_HasTranslationDoF; } set { m_HasTranslationDoF = value; }}
    }

HumanDescription中的HumanBone应是映射保存的地方。

Avatar的意义
Retargeting of Humanoid animations

One of the most powerful features of Mecanim is retargeting of humanoid animations. This means that with relative ease, you can apply the same set of animations to various character models. Retargeting is only possible for humanoid models, where an Avatar has been configured, because this gives us a correspondence between the models’ bone structure.

也就是说Avatar是在动画重定向中构造出来的。Avatar用于动画重定向技术。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值