Example #1
0
            public void RemoveLocalTransforms()
            {
                if (ChaControl == null)
                {
                    return;
                }
                currentConfig = null;

                DisableHover();
                transformVectors.Clear();
                parentDerivation.Clear();

                IKSolverFullBodyBiped ik = ChaControl.fullBodyIK.solver;

                ik.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(ik.OnPostUpdate, new IKSolver.UpdateDelegate(this.IKArray));
            }
Example #2
0
            public void LocalTransforms(HeelConfig heelConfig)
            {
                if (ChaControl == null)
                {
                    return;
                }
                currentConfig = heelConfig;

                foreach (KeyValuePair <string, string> pair in pathMaps)
                {
                    Dictionary <string, Vector3> partVectors;
                    heelConfig.heelVectors.TryGetValue(pair.Value, out partVectors);

                    if (partVectors != null)
                    {
                        Vector3   roll, move, scale, rollMin, rollMax;
                        Transform boneTransform = ChaControl.gameObject?.transform?.Find(pair.Key);

                        if (boneTransform != null &&
                            partVectors.TryGetValue("roll", out roll) &&
                            partVectors.TryGetValue("move", out move) &&
                            partVectors.TryGetValue("scale", out scale))
                        {
                            partVectors.TryGetValue("rollmin", out rollMin);
                            partVectors.TryGetValue("rollmax", out rollMax);

                            transformVectors.Add(boneTransform, new Vector3[5] {
                                move, roll, scale, rollMin, rollMax
                            });
                        }

                        bool parentDerive;
                        if (heelConfig.isFixed.TryGetValue(pair.Value, out parentDerive))
                        {
                            parentDerivation.Add(boneTransform, parentDerive);
                        }
                    }
                }

                IKSolverFullBodyBiped ik = ChaControl.fullBodyIK.solver;

                ik.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(ik.OnPostUpdate, new IKSolver.UpdateDelegate(this.IKArray));
            }