Ejemplo n.º 1
0
    // close muscle wherever it is
    // if amount is negative, use extend.
    void ContractMuscle(DogLeg leg, Muscles muscle, float amount = 1f)
    {
        float tempBonus = 0;
        if (leg.name.Contains("bl") || leg.name.Contains("br"))
            tempBonus += backLegBonus;
        else
            tempBonus += frontLegBonus;

        if (amount < 0) {
            ExtendMuscle(leg, muscle, -amount);
        } else {
            switch (muscle) {
            case Muscles.Biceps:
                DogLeg.Contract(leg.biceps, leg.GetMuscleLength(leg.biceps) * (bicepsFullContractForce + tempBonus) * amount);

                break;
            case Muscles.Triceps:
                DogLeg.Contract(leg.triceps, leg.GetMuscleLength(leg.triceps) * (tricepsFullContractForce + tempBonus) * amount);

                break;
            case Muscles.Chest:
                DogLeg.Contract(leg.chest, leg.GetMuscleLength(leg.chest) * (chestFullContractForce + tempBonus) * amount);

                break;

            }
        }
    }
Ejemplo n.º 2
0
    // get leg close to body slowly like a nannypussy
    void ContractLeg(DogLeg leg, float amount)
    {
        float tempBonus = 0;
        if (leg.name.Contains("bl") || leg.name.Contains("br"))
            tempBonus += backLegBonus;
        else
            tempBonus += frontLegBonus;

        // previously I tested here if the triceps was longer or shorter than the biceps, to have a async kind of contraction
        DogLeg.Contract(leg.biceps, leg.GetMuscleLength(leg.biceps) * amount * (bicepsFullContractForce + tempBonus));

        DogLeg.Contract(leg.triceps, leg.GetMuscleLength(leg.triceps) * amount * (tricepsFullContractForce + tempBonus));
    }
Ejemplo n.º 3
0
 IEnumerator Step(DogLeg leg, float phase)
 {
     while (true) {
         DogLeg.Contract(leg.biceps, Mathf.Sin (phase) * amountEachLeg);
         DogLeg.Contract(leg.triceps, Mathf.Sin (phase + phaseShift*Mathf.Deg2Rad) * amountEachLeg);
         phase += speed * Mathf.Deg2Rad;
         yield return new WaitForFixedUpdate();
     }
 }
Ejemplo n.º 4
0
 // put leg close to body
 void ContractFullLeg(DogLeg leg)
 {
     ContractLeg(leg, 1);
 }
Ejemplo n.º 5
0
    void ExtendLeg(DogLeg leg, float amount)
    {
        float tempBonus = 0;
        if (leg.name.Contains("bl") || leg.name.Contains("br"))
            tempBonus += backLegBonus;
        else
            tempBonus += frontLegBonus;

        DogLeg.Contract(leg.biceps, (1 - leg.GetMuscleLength(leg.biceps)) * amount * (bicepsFullContractForce + tempBonus));

        DogLeg.Contract(leg.triceps, leg.GetMuscleLength(leg.triceps) * amount * (tricepsFullContractForce + tempBonus));
    }
Ejemplo n.º 6
0
 // put leg forward in pointing position
 void ExtendFullLeg(DogLeg leg)
 {
     ExtendLeg(leg, 1);
 }