Пример #1
0
            /// <summary>
            /// Make sure the joints are initiated correctly
            /// </summary>
            public void InitiateJoints()
            {
                initLocalRot = new Quaternion[joints.Count];
                prevPos      = new Vector3[joints.Count];

                int i = 0;

                for (i = 0; i < joints.Count - 1; i++)
                {
                    joints[i].MapVirtual();
                    joints[i].localAxis =
                        GenericMath.GetLocalAxisToTarget(joints[i].joint, joints[i + 1].joint.position);
                    joints[i].length = Vector3.Distance(joints[i].joint.position, joints[i + 1].joint.position);

                    initLocalRot[i] = joints[i].joint.localRotation;
                    prevPos[i]      = joints[i].joint.position;
                }

                joints[i].MapVirtual();
                initLocalRot[i] = joints[i].joint.localRotation;
                prevPos[i]      = joints[i].joint.position;

                joints[i].localAxis = GenericMath.GetLocalAxisToTarget(joints[0].joint, joints[i].joint.position);
                initiated           = true;
            }
Пример #2
0
 // Token: 0x0600273B RID: 10043 RVA: 0x000B5BB0 File Offset: 0x000B3DB0
 public void InitiateJoints()
 {
     this.MapVirtualJoints();
     for (int i = 0; i < this.joints.Count - 1; i++)
     {
         this.joints[i].localAxis = GenericMath.GetLocalAxisToTarget(this.joints[i].joint, this.joints[i + 1].joint.position);
         this.joints[i].length    = Vector3.Distance(this.joints[i].joint.position, this.joints[i + 1].joint.position);
         this.chainLength        += this.joints[i].length;
     }
     this.joints[this.joints.Count - 1].localAxis = GenericMath.GetLocalAxisToTarget(this.joints[0].joint, this.joints[this.joints.Count - 1].joint.position);
     this.SetIKTarget(this.GetVirtualEE());
     this.initiated = true;
 }
Пример #3
0
            /// <summary>
            /// Make sure the joints are initiated correctly
            /// </summary>
            public void InitiateJoints()
            {
                MapVirtualJoints();

                for (int i = 0; i < Joints.Count - 1; i++)
                {
                    Joints[i].localAxis =
                        GenericMath.GetLocalAxisToTarget(Joints[i].joint, Joints[i + 1].joint.position);
                    Joints[i].length = Vector3.Distance(Joints[i].joint.position, Joints[i + 1].joint.position);
                    ChainLength     += Joints[i].length;
                }

                Joints[Joints.Count - 1].localAxis =
                    GenericMath.GetLocalAxisToTarget(Joints[0].joint, Joints[Joints.Count - 1].joint.position);
                SetIKTarget(GetVirtualEE());

                Initiated = true;
            }
Пример #4
0
            // Token: 0x06002749 RID: 10057 RVA: 0x000B5E94 File Offset: 0x000B4094
            public void InitiateJoints()
            {
                this.initLocalRot = new Quaternion[this.joints.Count];
                this.prevPos      = new Vector3[this.joints.Count];
                int i;

                for (i = 0; i < this.joints.Count - 1; i++)
                {
                    this.joints[i].MapVirtual();
                    this.joints[i].localAxis = GenericMath.GetLocalAxisToTarget(this.joints[i].joint, this.joints[i + 1].joint.position);
                    this.joints[i].length    = Vector3.Distance(this.joints[i].joint.position, this.joints[i + 1].joint.position);
                    this.initLocalRot[i]     = this.joints[i].joint.localRotation;
                    this.prevPos[i]          = this.joints[i].joint.position;
                }
                this.joints[i].MapVirtual();
                this.initLocalRot[i]     = this.joints[i].joint.localRotation;
                this.prevPos[i]          = this.joints[i].joint.position;
                this.joints[i].localAxis = GenericMath.GetLocalAxisToTarget(this.joints[0].joint, this.joints[i].joint.position);
                this.initiated           = true;
            }