Esempio n. 1
0
        public override Vector3 GetPosition(float param)
        {
            float     postionInt  = (float)Math.Truncate(param);
            int       pos         = (int)postionInt;
            LocalPath currentPath = this.LocalPaths [pos];

            return(currentPath.GetPosition(param));
        }
Esempio n. 2
0
        public override float GetParam(Vector3 position, float previousParam)
        {
            float     postion     = (float)Math.Truncate(previousParam);
            int       pos         = (int)postion;
            LocalPath currentPath = this.LocalPaths [pos];

            return(currentPath.GetParam(position, previousParam));
        }
 public static Vector3 GetShortestDistancePositionInEdge(NavigationGraphNode node, LocalPath L)
 {
     NavMeshEdge navEdge = node as NavMeshEdge;
     if (navEdge != null)
     {
         return MathHelper.ClosestPointInLineSegment2ToLineSegment1(
             L.StartPosition, L.EndPosition,
             navEdge.PointOne, navEdge.PointTwo,
             node.Position);
     }
     return Vector3.zero;
 }
Esempio n. 4
0
        public override bool PathEnd(float param)
        {
            bool result   = false;
            int  position = (int)Math.Truncate(param);
            int  count    = this.LocalPaths.Count - 1;

            if (position < count)
            {
                result = false;
            }
            else
            {
                return(true);
            }
            LocalPath path = this.LocalPaths [position];

            return(result && path.PathEnd(param));
        }