コード例 #1
0
 public SteeringAlgorithm(Targeter tag)
 {
     this.targeter = tag;
     maxConstraintSteps = 10.0f; //alterar dps consoante
     validPath = false;
     goal = new Goal();
     smoothpath = new GlobalPath();
     this.goal.updateChannels(targeter.getGoal());
 }
コード例 #2
0
 public GlobalPath decompose(DynamicCharacter character, Goal goal)
 {
     this.aStarPathFinding.InitializePathfindingSearch(character.KinematicData.position, goal.position);
     if (this.aStarPathFinding.InProgress)
     {
         var finished = this.aStarPathFinding.Search(out this.currentSolution, true);
         if (finished && this.currentSolution != null)
         {
             //lets smooth out the Path
             this.currentSmoothedSolution = StringPullingPathSmoothing.SmoothPath(character.KinematicData, this.currentSolution);
             currentSmoothedSolution.CalculateLocalPathsFromPathPositions(character.KinematicData.position);
             return this.currentSmoothedSolution;
         }
     }
     return null;
 }
コード例 #3
0
ファイル: Goal.cs プロジェクト: miguelfmp/IAJ---Projectos
 public void updateChannels(Goal goal)
 {
     if (goal.hasPosition) this.position = goal.position;
 }
コード例 #4
0
ファイル: Targeter.cs プロジェクト: miguelfmp/IAJ---Projectos
 public Targeter(Goal endPosition)
 {
     this.goal = endPosition;
     this.goal.hasPosition = true;
 }