public static Arrive ( Vector3 position, Vector3 destination, float deceleration, Vector3 velocity, float maxSpeed, Vector3 forceInfluence, Vector3 &steeringForce ) : void | ||
position | Vector3 | Current position of the agent |
destination | Vector3 | Current position of the destination |
deceleration | float | Deceleration factor applied when reaching close to destination |
velocity | Vector3 | Current velocity of the agent |
maxSpeed | float | Current maximum speed of the agent |
forceInfluence | Vector3 | Limits for each axis |
steeringForce | Vector3 | The resulting force |
Результат | void |
/// <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); }
/// <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); }