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] }; }
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);
public MouseClickTargeter(SteeringPipeline pipeline, Camera camera) : base(pipeline) { this.Camera = camera; this.Goal = new SteeringGoal(); }
public void UpdateGoal(SteeringGoal goal) { this.Target = goal; }
public abstract GlobalPath DecomposeGoalIntoPath(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; }
public FixedTargeter(SteeringPipeline pipeline) : base(pipeline) { this.Target = new SteeringGoal(); }
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); }
public MouseClickTargeter(Camera camera) { this.Camera = camera; this.Goal = new SteeringGoal(); }