Exemplo n.º 1
0
    protected void SetPositions()
    {
        for (int i = 0; i < bones.Length; ++i)
        {
            if (bones[i] != null)
            {
                bones[i].transform.position = GetBoneCenter(i);
                bones[i].transform.rotation = GetBoneRotation(i);
            }
        }

        for (int i = 0; i < joints.Length; ++i)
        {
            if (joints[i] != null)
            {
                joints[i].transform.position = GetJointPosition(i + 1);
                joints[i].transform.rotation = GetBoneRotation(i + 1);
            }
        }
        if (this.fingerType == Finger.FingerType.TYPE_INDEX)
        {
            Vector3 local_point = this.finger_.TipPosition.ToUnity(this.mirror_z_axis_);
            //local_point = this.controller_.transform.TransformPoint(local_point) + (this.offset_ * 1000);
            ExtractPoint.LogPoint(local_point);
            ExtractPoint.TrackBoneFinger(this.finger_.TipPosition.ToUnityScaled(this.mirror_z_axis_));
        }
    }
Exemplo n.º 2
0
    /** Updates the bone rotations. */
    public override void UpdateFinger()
    {
        for (int i = 0; i < bones.Length; ++i)
        {
            if (bones[i] != null)
            {
                bones[i].rotation = GetBoneRotation(i) * Reorientation();
                if (deformPosition)
                {
                    bones[i].position = GetBoneCenter(i);
                }
            }
        }

        if (this.fingerType == Finger.FingerType.TYPE_INDEX)
        {
            ExtractPoint.LogPoint(this.finger_.TipPosition.ToUnityScaled(this.mirror_z_axis_));
            ExtractPoint.TrackBoneFinger(this.GetTipPosition());
        }
    }