public DynamicFollowPath(KinematicData character, Path path)
 {
     this.Target = new KinematicData();
     this.Character = character;
     this.Path = path;
     this.EmptyMovementOutput = new MovementOutput();
 }
        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 override MovementOutput GetSteering(Path path)
        {
            var target = path.GetPosition(1.0f);

            this.Seek.Character = this.Pipeline.Character;
            this.Seek.Target = new KinematicData(new StaticData(target));
            this.Seek.MaxAcceleration = this.Pipeline.MaxAcceleration;

            return this.Seek.GetMovement();
        }
        public override MovementOutput GetSteering(Path path)
        {
            if (this.PreviousPath == null || this.PreviousPath != path)
            {
                this.FollowPathMovement.Path = path;
                this.FollowPathMovement.CurrentParam = 0;
                this.PreviousPath = path;
            }

            return this.FollowPathMovement.GetMovement();
        }
Esempio n. 5
0
        public DynamicFollowPath(KinematicData character, Path path)
        {
            //arrive properties
            this.SlowRadius = 5.0f;
            this.TimeToTarget = 0.5f;
            this.TargetRadius = 1.0f;

            this.MaxAcceleration = 40.0f;

            this.Target = new KinematicData();
            this.Character = character;
            this.Path = path;
            this.CurrentParam = 0.0f;
            this.PathOffset = 0.5f;
            this.EmptyMovementOutput = new MovementOutput();
        }
 public override Path GetPath(Path path)
 {
     return path;
 }
 public abstract MovementOutput GetSteering(Path path);
 public abstract Path GetPath(Path path);
 public DynamicFollowPath(KinematicData character, Path path)
     : this()
 {
     this.Character = character;
     this.Path = path;
 }
 public abstract float WillViolate(Path path, float maxPriority);
 public abstract SteeringGoal Suggest(Path path);