This static class implements all the Steering Behaviors actual algorithms
示例#1
0
 /// <summary>
 /// Computes the current Steering Behavior
 /// </summary>
 /// <returns></returns>
 public override void Compute()
 {
     if (_bestHidingSpot.HasValue)
         SteeringLibrary.Arrive(AutonomousAgent.Position, _bestHidingSpot.Value, (float) AutonomousAgent.Deceleration, AutonomousAgent.Velocity, AutonomousAgent.MaxSpeed, ForceInfluence, out ComputedSteeringForce);
     else
         SteeringLibrary.Evade(AutonomousAgent.Position, AutonomousAgent.Velocity, AutonomousAgent.MaxSpeed, Hunter.Position, Hunter.Velocity, Hunter.MaxSpeed, AutonomousAgent.PanicDistance, ForceInfluence, out ComputedSteeringForce);
 }
示例#2
0
        /// <summary>
        /// Computes the current Steering Behavior
        /// </summary>
        /// <returns></returns>
        public override void Compute()
        {
            Matrix leaderWorldMatrix = Matrix.Identity;
            leaderWorldMatrix.Forward = Target.EntityForward;
            leaderWorldMatrix.Right = Target.EntityRight;
            leaderWorldMatrix.Up = Target.EntityUp;
            leaderWorldMatrix.Translation = Target.Position;

            SteeringLibrary.OffsetPursuit(AutonomousAgent.Position, AutonomousAgent.Velocity, AutonomousAgent.MaxSpeed, (float) AutonomousAgent.Deceleration*AutonomousAgent.DecelerationTweaker, Target.Velocity, Target.MaxSpeed,
                                          Vector3.Transform(LocalOffset, leaderWorldMatrix), ForceInfluence, out ComputedSteeringForce);
        }
示例#3
0
        /// <summary>
        /// Computes the current Steering Behavior
        /// </summary>
        /// <returns></returns>
        public override void Compute()
        {
            //SteeringLibrary.ObstacleAvoidance(_closestObstacleLocalPosition.Value, _closestObstacle.WorldBoundingSphere.Radius, FilterDistance, ForceInfluence * Context[_closestObstacle], out ComputedSteeringForce);

            //var transposedInvertWorld = AutonomousAgent.ParentObject.World;
            //Matrix.Invert(ref transposedInvertWorld, out transposedInvertWorld);
            //Matrix.Transpose(ref transposedInvertWorld, out transposedInvertWorld);
            //Vector3.Transform(ref ComputedSteeringForce, ref transposedInvertWorld, out ComputedSteeringForce);

            SteeringLibrary.ObstacleAvoidanceNew(AutonomousAgent.Position, _closestObstacle.World.Translation, _closestObstacle.World.Forward, ForceInfluence * Context[_closestObstacle], out ComputedSteeringForce);
        }
示例#4
0
文件: Flee.cs 项目: rc183/igf
 /// <summary>
 /// Computes the current Steering Behavior
 /// </summary>
 /// <returns></returns>
 public override void Compute()
 {
     SteeringLibrary.Flee(AutonomousAgent.Position, DangerPosition.Value, AutonomousAgent.PanicDistance, AutonomousAgent.Velocity, AutonomousAgent.MaxSpeed, ForceInfluence, out ComputedSteeringForce);
 }
示例#5
0
 /// <summary>
 /// Computes the current Steering Behavior
 /// </summary>
 /// <returns></returns>
 public override void Compute()
 {
     SteeringLibrary.Alignment(AutonomousAgent.EntityForward, _agentForwards, ForceInfluence, out ComputedSteeringForce);
 }
示例#6
0
文件: Wander.cs 项目: Indiefreaks/igf
 /// <summary>
 /// Computes the current Steering Behavior
 /// </summary>
 /// <returns></returns>
 public override void Compute()
 {
     SteeringLibrary.Wander(AutonomousAgent.Dice, AutonomousAgent.Position, AutonomousAgent.Velocity, AutonomousAgent.EntityForward, ref _wanderTarget, Radius, Distance, Jitter, AutonomousAgent.MaxSpeed, ForceInfluence,
                            out ComputedSteeringForce);
 }
示例#7
0
 /// <summary>
 /// Computes the current Steering Behavior
 /// </summary>
 /// <returns></returns>
 public override void Compute()
 {
     SteeringLibrary.Separation(AutonomousAgent.Position, _agentPositions, ForceInfluence, out ComputedSteeringForce);
 }
示例#8
0
 /// <summary>
 /// Computes the current Steering Behavior
 /// </summary>
 /// <returns></returns>
 public override void Compute()
 {
     SteeringLibrary.Arrive(AutonomousAgent.Position, Destination.Value, (float)AutonomousAgent.Deceleration * AutonomousAgent.DecelerationTweaker, AutonomousAgent.Velocity, AutonomousAgent.MaxSpeed, ForceInfluence, out ComputedSteeringForce);
 }
示例#9
0
 /// <summary>
 /// Computes the current Steering Behavior
 /// </summary>
 /// <returns></returns>
 public override void Compute()
 {
     SteeringLibrary.Cohesion(AutonomousAgent.Position, AutonomousAgent.Velocity, AutonomousAgent.MaxSpeed, _agentPositions, ForceInfluence, out ComputedSteeringForce);
 }
示例#10
0
 /// <summary>
 /// Computes the current Steering Behavior
 /// </summary>
 /// <returns></returns>
 public override void Compute()
 {
     SteeringLibrary.Seek(AutonomousAgent.Position, Destination.Value, AutonomousAgent.Velocity, AutonomousAgent.MaxSpeed, ForceInfluence, out ComputedSteeringForce);
 }