Beispiel #1
0
        private void _InitInitInfos()
        {
            m_initInfos.Clear();

            Transform[] joints = m_solver.GetJoints();
            for (int i = joints.Length - 2; i >= 0; --i)
            {
                Transform  tr          = joints[i];
                TrInitInfo newInitInfo = new TrInitInfo(tr);
                newInitInfo.ResetInitInfo();
                m_initInfos.Add(newInitInfo);
            }

            //_InitSolver();
        }
Beispiel #2
0
        public void _RenewInitInfoAndSolver()
        {
            _ResetSolver();

            for (int i = m_initInfos.Count - 1; i >= 0; --i)
            {
                m_initInfos[i].RevertToInitInfo();
            }
            m_initInfos.Clear();

            for (int i = m_jointList.Count - 2; i >= 0; i--)
            {
                Transform  tr          = m_jointList[i];
                TrInitInfo newInitInfo = new TrInitInfo(tr);
                newInitInfo.ResetInitInfo();
                m_initInfos.Add(newInitInfo);
            }
        }
        // unity event handlers

        void Awake()
        {
            m_tr = transform;
            if (m_initInfo == null)
            {
                m_initInfo = new TrInitInfo(m_tr);
            }
            m_initInfo.TentativeResetInitInfo();

            for (int i = 0; i < m_constraints.Count; ++i)
            {
                var c = m_constraints[i];
                if (c)
                {
                    c.DoAwake();
                }
            }
        }