Ejemplo n.º 1
0
 private bool IsActive(CrossfadeFBBIK fbbik)
 {
     foreach (IKEffector eff in fbbik.solver.effectors)
     {
         if (eff.positionWeight > 0.05f || eff.rotationWeight > 0.05f)
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
        private void Swap()
        {
            CrossfadeFBBIK ikTemp = this.ikPrimary;

            this.ikPrimary   = this.ikSecondary;
            this.ikSecondary = ikTemp;

            CrossfadeInteractionHandler handlerTemp = this.handlerPrimary;

            this.handlerPrimary   = this.handlerSecondary;
            this.handlerSecondary = handlerTemp;

            Dictionary <FullBodyBipedEffector, InteractionObject> temp =
                this.primaryEffectors;

            this.primaryEffectors   = this.secondaryEffectors;
            this.secondaryEffectors = temp;
        }
Ejemplo n.º 3
0
        public BodyIKController(CrossfadeFBBIK[] iks, float swapTime)
        {
            this.primaryEffectors =
                new Dictionary <FullBodyBipedEffector, InteractionObject>();
            this.secondaryEffectors =
                new Dictionary <FullBodyBipedEffector, InteractionObject>();

            this.ikPrimary   = iks[0];
            this.ikSecondary = iks[1];
            this.SwapTime    = swapTime;

            this.handlerPrimary   = new CrossfadeInteractionHandler(ikPrimary);
            this.handlerSecondary = new CrossfadeInteractionHandler(ikSecondary);

            this.RegisterWithHandler(this.handlerPrimary);
            this.RegisterWithHandler(this.handlerSecondary);

            this.state = BodyIKState.Offline;
        }
    public CrossfadeInteractionHandler(CrossfadeFBBIK fullBody)
    {
        this.fullBody = fullBody;

        // Add to the FBBIK OnPostUpdate delegate to get a call when it
        // has finished updating
        fullBody.solver.OnPostUpdate += OnPostFBBIK;

        foreach (InteractionEffector e in interactionEffectors)
        {
            e.OnStart   = this.OnEffectorStart;
            e.OnTrigger = OnEffectorTrigger;
            e.OnRelease = OnEffectorRelease;
            e.OnPause   = OnEffectorPause;
            e.OnPickUp  = OnEffectorPickUp;
            e.OnResume  = OnEffectorResume;
            e.OnStop    = OnEffectorStop;

            e.Initiate(fullBody.solver);
        }
    }
    public CrossfadeInteractionHandler(CrossfadeFBBIK fullBody)
    {
        this.fullBody = fullBody;

        // Add to the FBBIK OnPostUpdate delegate to get a call when it
        // has finished updating
        fullBody.solver.OnPostUpdate += OnPostFBBIK;

        foreach (InteractionEffector e in interactionEffectors)
        {
            e.OnStart = this.OnEffectorStart;
            e.OnTrigger = OnEffectorTrigger;
            e.OnRelease = OnEffectorRelease;
            e.OnPause = OnEffectorPause;
            e.OnPickUp = OnEffectorPickUp;
            e.OnResume = OnEffectorResume;
            e.OnStop = OnEffectorStop;

            e.Initiate(fullBody.solver);
        }
    }
Ejemplo n.º 6
0
 void Awake()
 {
     CrossfadeFBBIK[] iks = this.GetComponents<CrossfadeFBBIK>();
     this.ik1 = iks[0];
     this.ik2 = iks[1];
 }
 public PointIKController(CrossfadeFBBIK[] iks)
 {
     this.ikSecondary = iks[1];
     this.state = PointingState.INACTIVE;
     this.currAnimTime = 0.0f;
     this.maxTime = 0.6f;
     this.holdTime = 0.0f;
     this.maxHoldTime = 1.0f;
 }
 public DeathIKController(CrossfadeFBBIK[] iks)
 {
     this.ikSecondary = iks[1];
     state = LifeState.ALIVE;
     currAnimTime = 0f;
     maxTime = 1.2f;
 }
 public ButtonIKController(CrossfadeFBBIK[] iks)
 {
     this.ikSecondary = iks[1];
     this.state = ButtonPressState.INACTIVE;
     this.currAnimTime = 0.0f;
     this.maxTime = 0.6f;
 }
Ejemplo n.º 10
0
        private void Swap()
        {
            CrossfadeFBBIK ikTemp = this.ikPrimary;
            this.ikPrimary = this.ikSecondary;
            this.ikSecondary = ikTemp;

            CrossfadeInteractionHandler handlerTemp = this.handlerPrimary;
            this.handlerPrimary = this.handlerSecondary;
            this.handlerSecondary = handlerTemp;

            Dictionary<FullBodyBipedEffector, InteractionObject> temp =
                this.primaryEffectors;
            this.primaryEffectors = this.secondaryEffectors;
            this.secondaryEffectors = temp;
        }
Ejemplo n.º 11
0
 private bool IsActive(CrossfadeFBBIK fbbik)
 {
     foreach (IKEffector eff in fbbik.solver.effectors)
         if (eff.positionWeight > 0.05f || eff.rotationWeight > 0.05f)
             return true;
     return false;
 }
Ejemplo n.º 12
0
        public BodyIKController(CrossfadeFBBIK[] iks, float swapTime)
        {
            this.primaryEffectors =
                new Dictionary<FullBodyBipedEffector, InteractionObject>();
            this.secondaryEffectors =
                new Dictionary<FullBodyBipedEffector, InteractionObject>();

            this.ikPrimary = iks[0];
            this.ikSecondary = iks[1];
            this.SwapTime = swapTime;

            this.handlerPrimary = new CrossfadeInteractionHandler(ikPrimary);
            this.handlerSecondary = new CrossfadeInteractionHandler(ikSecondary);

            this.RegisterWithHandler(this.handlerPrimary);
            this.RegisterWithHandler(this.handlerSecondary);

            this.state = BodyIKState.Offline;
        }
Ejemplo n.º 13
0
 public PrayingIKController(CrossfadeFBBIK[] iks)
 {
     ikSecondary = iks[1];
     state = PrayingIKState.INACTIVE;
     maxTime = 0.4f;
 }
Ejemplo n.º 14
0
    public bool bodyEffectChildNodes = true;          // If true, the body effector will also drag the thigh effectors

    void Awake()
    {
        CrossfadeFBBIK[] iks = this.GetComponents <CrossfadeFBBIK>();
        this.ik1 = iks[0];
        this.ik2 = iks[1];
    }
Ejemplo n.º 15
0
 public PunchIKController(CrossfadeFBBIK[] iks)
 {
     ikPrimary = iks[0];
     ikSecondary = iks[1];
     weightInterp = new Interpolator<float>(
         0.0f, .75f, Mathf.Lerp);
 }