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;
        }
        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]
     };
 }
Exemple #4
0
 public override Path GetPath(SteeringGoal goal)
 {
     return(new Path
     {
         Goal = goal,
         KinematicData = this.Pipeline.Character
     });
 }
        public override SteeringGoal DecomposeGoal(SteeringGoal goal)
        {
            var path = this.DecomposeGoalIntoPath(goal);

            return(new SteeringGoal
            {
                Position = path.PathPositions[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);
Exemple #9
0
 public MouseClickTargeter(SteeringPipeline pipeline, Camera camera) : base(pipeline)
 {
     this.Camera = camera;
     this.Goal   = new SteeringGoal();
 }
Exemple #10
0
 public void UpdateGoal(SteeringGoal goal)
 {
     this.Target = goal;
 }
 public abstract GlobalPath DecomposeGoalIntoPath(SteeringGoal goal);
 public abstract SteeringGoal DecomposeGoal(SteeringGoal goal);
Exemple #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;
        }
Exemple #15
0
 public abstract GlobalPath DecomposeGoalIntoPath(SteeringGoal goal);
Exemple #16
0
 public void UpdateGoal(SteeringGoal goal)
 {
     this.Target = goal;
 }
Exemple #17
0
 public FixedTargeter(SteeringPipeline pipeline) : base(pipeline)
 {
     this.Target = new SteeringGoal();
 }
Exemple #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);
 }
Exemple #20
0
 public MouseClickTargeter(Camera camera)
 {
     this.Camera = camera;
     this.Goal   = new SteeringGoal();
 }