Esempio n. 1
0
        public Path(double maximumAcceleration, IMotion startingMotion)
        {
            m_Acceleration = maximumAcceleration;

            m_Motion = new CombinedMotion(new List<IMotion>
               {
               startingMotion
               });
        }
Esempio n. 2
0
        public Path(double maximumAcceleration, IMotion startingMotion)
        {
            m_Acceleration = maximumAcceleration;

            m_Motion = new CombinedMotion(new List <IMotion>
            {
                startingMotion
            });
        }
        public NodeWithPosition(SceneNode sceneNode, string pathid, CombinedMotion startingMotion, SceneManager manager)
        {
            m_SceneNode = sceneNode;
            m_PathId = pathid;
            m_Motion = startingMotion;

            m_Manager = manager;

            m_SelectedNodes = new List<SceneNode>();
            m_SelectedNodes.Add(sceneNode);
        }
Esempio n. 4
0
        public void MoveToDestination(Vector destination, ulong currentTime)
        {
            var currentMotion   = m_Motion.GetCurrentMotion(currentTime);
            var initialPosition = currentMotion.GetCurrentPosition(currentTime);
            var initialVelocity = currentMotion.GetVelocity(currentTime);

            var newPath = CreatePathTo(destination, initialVelocity, initialPosition, currentTime);

            if (newPath[0].GetCurrentPosition(currentTime) != initialPosition)
            {
                throw new InvalidOperationException("The positions do not match up");
            }

            m_Motion = new CombinedMotion(new List <IMotion>(newPath));
        }
Esempio n. 5
0
        public void MoveToDestination(Vector destination, ulong currentTime)
        {
            var currentMotion = m_Motion.GetCurrentMotion(currentTime);
            var initialPosition = currentMotion.GetCurrentPosition(currentTime);
            var initialVelocity = currentMotion.GetVelocity(currentTime);

            var newPath = CreatePathTo(destination, initialVelocity, initialPosition, currentTime);

            if (newPath[0].GetCurrentPosition(currentTime) != initialPosition)
            {
                throw new InvalidOperationException("The positions do not match up");
            }

            m_Motion = new CombinedMotion( new List<IMotion>(newPath));
        }