コード例 #1
0
        public IKSnapshot CreateSnapshot(Vector3 o)
        {
            IKSnapshot r = new IKSnapshot();


            Vector3 _lh = LocalToWorld(ikBase.lh);

            r.lh = GetPosActual(_lh);


            Vector3 _rh = LocalToWorld(ikBase.rh);

            r.rh = GetPosActual(_rh);


            Vector3 _lf = LocalToWorld(ikBase.lf);

            r.lf = GetPosActual(_lf);


            Vector3 _rf = LocalToWorld(ikBase.rf);

            r.rh = GetPosActual(_rf);

            return(r);
        }
コード例 #2
0
 public void CopySnapshot(ref IKSnapshot to, IKSnapshot from)
 {
     to.lh = from.lh;
     to.rh = from.rh;
     to.lf = from.lf;
     to.rf = from.rf;
 }
コード例 #3
0
        public void CreatePositions(Vector3 origin)
        {
            IKSnapshot ik = CreateSnapshot(origin);

            CopySnapshot(ref current, ik);

            UpdateIKPosition(AvatarIKGoal.LeftFoot, current.lf);
            UpdateIKPosition(AvatarIKGoal.RightFoot, current.rf);
            UpdateIKPosition(AvatarIKGoal.LeftHand, current.lh);
            UpdateIKPosition(AvatarIKGoal.RightHand, current.rh);

            UpdateIKWeight(AvatarIKGoal.RightHand, 1);
            UpdateIKWeight(AvatarIKGoal.LeftHand, 1);
            UpdateIKWeight(AvatarIKGoal.RightFoot, 1);
            UpdateIKWeight(AvatarIKGoal.LeftFoot, 1);
        }
コード例 #4
0
 public void Init(ClimbingLogic c, Transform helper)
 {
     animator = c.anim;
     ikBase   = c.baseIKsnapshot;
     h        = helper;
 }