コード例 #1
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;
                    this.CurrentPath.CalculateLocalPathsFromPathPositions(this.Pipeline.Character.position);
                }
            }

            return this.CurrentPath;
        }
コード例 #2
0
ファイル: PathFindingDecomposer.cs プロジェクト: IAJ-g04/Lab8
        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);
        }
コード例 #3
0
 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
ファイル: PathFindingDecomposer.cs プロジェクト: IAJ-g04/Lab8
        public override SteeringGoal DecomposeGoal(SteeringGoal goal)
        {
            var path = this.DecomposeGoalIntoPath(goal);

            return(new SteeringGoal
            {
                Position = path.PathPositions[0]
            });
        }
コード例 #6
0
ファイル: DecomposerComponent.cs プロジェクト: hlferreira/IAJ
 public abstract SteeringGoal DecomposeGoal(SteeringGoal goal);
 public override Path GetPath(SteeringGoal goal)
 {
     return(new LineSegmentPath(this.Pipeline.Character.position, goal.Position));
 }
コード例 #8
0
 public abstract Path GetPath(SteeringGoal goal);
コード例 #9
0
ファイル: MouseClickTargeter.cs プロジェクト: IAJ-g04/Lab8
 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;
 }
コード例 #11
0
 public abstract GlobalPath DecomposeGoalIntoPath(SteeringGoal goal);
コード例 #12
0
 public abstract SteeringGoal DecomposeGoal(SteeringGoal goal);
コード例 #13
0
 public abstract Path GetPath(SteeringGoal goal);
コード例 #14
0
        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
ファイル: DecomposerComponent.cs プロジェクト: IAJ-g04/Lab8
 public abstract GlobalPath DecomposeGoalIntoPath(SteeringGoal goal);
コード例 #16
0
ファイル: FixedTargeter.cs プロジェクト: IAJ-g04/Lab9
 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;
 }
コード例 #19
0
 public override Path GetPath(SteeringGoal goal)
 {
     return new LineSegmentPath(this.Pipeline.Character.position,goal.Position);
 }
コード例 #20
0
ファイル: MouseClickTargeter.cs プロジェクト: hlferreira/IAJ
 public MouseClickTargeter(Camera camera)
 {
     this.Camera = camera;
     this.Goal   = new SteeringGoal();
 }