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); }
public void CopySnapshot(ref IKSnapshot to, IKSnapshot from) { to.lh = from.lh; to.rh = from.rh; to.lf = from.lf; to.rf = from.rf; }
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); }
public void Init(ClimbingLogic c, Transform helper) { animator = c.anim; ikBase = c.baseIKsnapshot; h = helper; }