Ejemplo n.º 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());
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 3
0
 public void updateChannels(Goal goal)
 {
     if (goal.hasPosition) this.position = goal.position;
 }
Ejemplo n.º 4
0
 public Targeter(Goal endPosition)
 {
     this.goal = endPosition;
     this.goal.hasPosition = true;
 }