Пример #1
0
        public Pose UpdateProxyMotion(ProxyForceFieldId id, ProxyForceFieldMotion askedMotion)
        {
            var def     = m_ProxyDef[id];
            var oldPose = m_ProxyMotions[id];

            var newPose = def.allowedMotion.TrimMotionUpdate(oldPose, askedMotion);

            m_ProxyMotions[id] = newPose;

            return(newPose.location);
        }
Пример #2
0
        public void UpdateFieldPoseOnly(ProxyForceFieldId id, Pose worldPose)
        {
            ProxyForceFieldMotion motion;

            if (m_ProxyMotions.ContainsKey(id))
            {
                motion          = m_ProxyMotions[id];
                motion.location = worldPose;
            }
            else
            {
                motion = new ProxyForceFieldMotion(worldPose, Pose.identity);
            }
            m_ProxyMotions[id] = motion;
        }
Пример #3
0
        internal SolverFieldErrorScore ScorePose(ProxyForceFieldId id, Pose pose)
        {
            var state  = new SolverFieldState();
            var motion = new ProxyForceFieldMotion(pose, Pose.identity);

            state.FrameReset(motion);

            var oldPose = m_ProxyMotions[id];

            m_ProxyMotions[id] = motion;

            var def = m_ProxyDef[id];

            def.isActive = true;
            CalculateForces(ref state, def, id);

            m_ProxyMotions[id] = oldPose;

            state.errorScore.UpdateFinalScore();
            return(state.errorScore);
        }
Пример #4
0
        internal static ProxyForceFieldMotion TrimMotionUpdate(this ProxyForceMotionType mt, ProxyForceFieldMotion oldMotion, ProxyForceFieldMotion newMotion)
        {
            var newPose = mt.TrimPoseUpdate(oldMotion.location, newMotion.location);
            var ans     = newMotion;

            ans.location = newPose;
            return(ans);
        }