Example #1
0
            // Initiating the pelvis
            public void Initiate(Grounding grounding)
            {
                this.grounding = grounding;

                initiated = true;
                OnEnable();
            }
Example #2
0
		// Gets the direction from the root to the foot (ortho-normalized to root.up)
		private Vector3 GetLegSpineTangent(Grounding.Leg leg) {
			Vector3 tangent = leg.transform.position - solver.root.position;
			
			if (!solver.rotateSolver || solver.root.up == Vector3.up) return new Vector3(tangent.x, 0f, tangent.z);
			
			Vector3 normal = solver.root.up;
			Vector3.OrthoNormalize(ref normal, ref tangent);
			return tangent;
		}
Example #3
0
			// Initiates the Leg
			public void Initiate(Grounding grounding, Transform transform) {
				initiated = false;
				this.grounding = grounding;
				this.transform = transform;
				up = Vector3.up;
				
				initiated = true;
				OnEnable();
			}
Example #4
0
            // Initiates the Leg
            public void Initiate(Grounding grounding, Transform transform)
            {
                initiated      = false;
                this.grounding = grounding;
                this.transform = transform;

                initiated = true;
                OnEnable();
            }
Example #5
0
 public void Initiate(Grounding grounding, Transform transform)
 {
     this.initiated = false;
     this.grounding = grounding;
     this.transform = transform;
     this.up        = Vector3.up;
     this.initiated = true;
     this.OnEnable();
 }
Example #6
0
 public void Initiate(Grounding grounding, Transform transform)
 {
     this.initiated      = false;
     this.grounding      = grounding;
     this.transform      = transform;
     this.up             = Vector3.up;
     this.IKPosition     = transform.position;
     this.rotationOffset = Quaternion.identity;
     this.initiated      = true;
     this.OnEnable();
 }
Example #7
0
            // Initiates the Leg
            public void Initiate(Grounding grounding, Transform transform)
            {
                initiated      = false;
                this.grounding = grounding;
                this.transform = transform;
                up             = Vector3.up;
                IKPosition     = transform.position;

                initiated = true;
                OnEnable();
            }
Example #8
0
		// Gets the bend direction for a foot
		private Vector3 GetLegSpineBendVector(Grounding.Leg leg) {
			Vector3 spineTangent = GetLegSpineTangent(leg);
			float dotF = (Vector3.Dot(solver.root.forward, spineTangent.normalized) + 1) * 0.5f;
			float w = (leg.IKPosition - leg.transform.position).magnitude;
			return spineTangent * w * dotF;
		}
Example #9
0
		// Set the effector positionOffset for the foot
		private void SetLegIK(IKEffector effector, Grounding.Leg leg) {
			effector.positionOffset += (leg.IKPosition - effector.bone.position) * weight;

			effector.bone.rotation = Quaternion.Slerp(Quaternion.identity, leg.rotationOffset, weight) * effector.bone.rotation;
		}
Example #10
0
			// Initiating the pelvis
			public void Initiate(Grounding grounding) {
				this.grounding = grounding;
				
				initiated = true;
				OnEnable();
			}
 public static void Visualize(Grounding grounding, Transform root, Transform foot)
 {
     Handles.SphereCap(0, foot.position + root.forward * grounding.footCenterOffset, root.rotation, grounding.footRadius * 2f);
 }
Example #12
0
            }                              // 0x00000001802466A0-0x00000001802466B0

            // Methods
            public void Initiate(Grounding grounding)
            {
            }                                                        // 0x00000001809C3120-0x00000001809C31A0
Example #13
0
            }                           // 0x00000001809C2990-0x00000001809C2A40

            // Methods
            public void Initiate(Grounding grounding, Transform transform)
            {
            }                                                                             // 0x00000001809C1010-0x00000001809C1150