Exemplo n.º 1
0
            // Initiating the pelvis
            public void Initiate(Grounding grounding)
            {
                this.grounding = grounding;

                initiated = true;
                OnEnable();
            }
Exemplo n.º 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;
		}
Exemplo n.º 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();
			}
Exemplo n.º 4
0
            // Initiates the Leg
            public void Initiate(Grounding grounding, Transform transform)
            {
                initiated      = false;
                this.grounding = grounding;
                this.transform = transform;

                initiated = true;
                OnEnable();
            }
Exemplo n.º 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();
 }
Exemplo n.º 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();
 }
Exemplo n.º 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();
            }
Exemplo n.º 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;
		}
Exemplo n.º 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;
		}
Exemplo n.º 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);
 }
Exemplo n.º 12
0
            }                              // 0x00000001802466A0-0x00000001802466B0

            // Methods
            public void Initiate(Grounding grounding)
            {
            }                                                        // 0x00000001809C3120-0x00000001809C31A0
Exemplo n.º 13
0
            }                           // 0x00000001809C2990-0x00000001809C2A40

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