Arrive() public static méthode

Creates a force that tends to move towards a position and decelerate when getting close to it
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
Résultat void
Exemple #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);
 }
Exemple #2
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);
 }