public override GlobalPath DecomposeGoalIntoPath(SteeringGoal goal)
        {
            GlobalPath path;

            if (goal.PositionSet && !this.CurrentGoalPosition.Equals(goal.Position))
            {
                this.CurrentGoalPosition = goal.Position;
                this.PathfindingAlgorithm.InitializePathfindingSearch(this.Pipeline.Character.position,goal.Position);
            }

            if (this.PathfindingAlgorithm.InProgress)
            {
                if (this.PathfindingAlgorithm.Search(out path, true))
                {
                    this.UnsmoothedPath = path;
                    this.CurrentPath = StringPullingPathSmoothing.SmoothPath(this.Pipeline.Character, path);
                    this.CurrentPath.CalculateLocalPathsFromPathPositions(this.Pipeline.Character.position);
                }
                else
                {
                    this.UnsmoothedPath = path;
                    this.CurrentPath = path;
                    this.CurrentPath.CalculateLocalPathsFromPathPositions(this.Pipeline.Character.position);
                }
            }

            return this.CurrentPath;
        }
示例#2
0
        public override GlobalPath DecomposeGoalIntoPath(SteeringGoal goal)
        {
            GlobalPath path;

            if (goal.PositionSet && !this.CurrentGoalPosition.Equals(goal.Position))
            {
                this.CurrentGoalPosition = goal.Position;
                this.PathfindingAlgorithm.InitializePathfindingSearch(this.Pipeline.Character.position, goal.Position);
            }

            if (this.PathfindingAlgorithm.InProgress)
            {
                if (this.PathfindingAlgorithm.Search(out path, true))
                {
                    this.UnsmoothedPath = path;
                    this.CurrentPath    = StringPullingPathSmoothing.SmoothPath(this.Pipeline.Character, path);
                    this.CurrentPath.CalculateLocalPathsFromPathPositions(this.Pipeline.Character.position);
                }
                else
                {
                    this.UnsmoothedPath = path;
                    this.CurrentPath    = path;
                }
            }

            return(this.CurrentPath);
        }
 public override SteeringGoal DecomposeGoal(SteeringGoal goal)
 {
     var path = this.DecomposeGoalIntoPath(goal);
     return new SteeringGoal
     {
         Position = path.PathPositions[0]
     };
 }
示例#4
0
 public override Path GetPath(SteeringGoal goal)
 {
     return(new Path
     {
         Goal = goal,
         KinematicData = this.Pipeline.Character
     });
 }
示例#5
0
        public override SteeringGoal DecomposeGoal(SteeringGoal goal)
        {
            var path = this.DecomposeGoalIntoPath(goal);

            return(new SteeringGoal
            {
                Position = path.PathPositions[0]
            });
        }
示例#6
0
 public abstract SteeringGoal DecomposeGoal(SteeringGoal goal);
 public override Path GetPath(SteeringGoal goal)
 {
     return(new LineSegmentPath(this.Pipeline.Character.position, goal.Position));
 }
 public abstract Path GetPath(SteeringGoal goal);
示例#9
0
 public MouseClickTargeter(SteeringPipeline pipeline, Camera camera) : base(pipeline)
 {
     this.Camera = camera;
     this.Goal   = new SteeringGoal();
 }
示例#10
0
 public void UpdateGoal(SteeringGoal goal)
 {
     this.Target = goal;
 }
 public abstract GlobalPath DecomposeGoalIntoPath(SteeringGoal goal);
 public abstract SteeringGoal DecomposeGoal(SteeringGoal goal);
示例#13
0
 public abstract Path GetPath(SteeringGoal goal);
        public override SteeringGoal Suggest(Path path)
        {
            //Vector3 characterPoint = NavigationManager.Instance.NavMeshGraphs[0].ClosestPointOnGraph(this.Pipeline.Character.position, aMaxYOffset);
            //NavigationGraphNode characterNodeInGraph = NavigationManager.Instance.NavMeshGraphs[0].QuantizeToNode(characterPoint, 1.0f);

            Vector3 suggestedPoint = NavigationManager.Instance.NavMeshGraphs[0].ClosestPointOnGraph(suggestedPosition, aMaxYOffset);
            //NavigationGraphNode nodeInGraph = NavigationManager.Instance.NavMeshGraphs[0].QuantizeToNode(suggestedPoint, 1.0f);

            //Debug.DrawRay(characterPoint, (suggestedPoint - characterPoint), Color.cyan);

            SteeringGoal suggestedGoal = new SteeringGoal()
            {
                Position = suggestedPoint
            };

            //GlobalPath suggestedPath = new GlobalPath();
            //suggestedPath.PathPositions.Add(characterPoint);
            //suggestedPath.PathPositions.Add(suggestedPoint);
            //suggestedPath.PathNodes.Add(characterNodeInGraph);
            //suggestedPath.PathNodes.Add(nodeInGraph);

            //suggestedPath.CalculateLocalPathsFromPathPositions(characterPoint);

            //suggestedGoal.Path = suggestedPath;

            this.SuggestionUsed = true;

            return suggestedGoal;
        }
示例#15
0
 public abstract GlobalPath DecomposeGoalIntoPath(SteeringGoal goal);
示例#16
0
 public void UpdateGoal(SteeringGoal goal)
 {
     this.Target = goal;
 }
示例#17
0
 public FixedTargeter(SteeringPipeline pipeline) : base(pipeline)
 {
     this.Target = new SteeringGoal();
 }
示例#18
0
 public AvoidSpheresConstraint(SteeringGoal suggestion, float avoidMargin)
 {
     this.Suggestion  = suggestion;
     this.Obstacles   = new List <Transform>();
     this.AvoidMargin = avoidMargin;
 }
 public override Path GetPath(SteeringGoal goal)
 {
     return new LineSegmentPath(this.Pipeline.Character.position,goal.Position);
 }
示例#20
0
 public MouseClickTargeter(Camera camera)
 {
     this.Camera = camera;
     this.Goal   = new SteeringGoal();
 }