Example #1
0
        public static Vector3 SteerToFollowFlowField(this IVehicle vehicle, IFlowField flowField, float maxSpeed, float predictionDistance, IAnnotationService annotation = null)
        {
            var futurePosition = vehicle.PredictFuturePosition(predictionDistance);
            var flow           = flowField.Sample(futurePosition);

            return(vehicle.Velocity - flow.TruncateLength(maxSpeed));
        }
Example #2
0
 public DriveComponent(SpeedType speedType, int speed,
                       DriveState state, IFlowField flowField, Vector2I movementVector, XPos destination)
 {
     this.SpeedType      = speedType;
     this.Speed          = speed;
     this.State          = state;
     this.FlowField      = flowField;
     this.MovementVector = movementVector;
     this.Destination    = destination;
 }
 public FlowField(IFlowField field)
 {
     Field = field;
 }
Example #4
0
 protected Vector3 SteerToFollowFlowField(IFlowField field, float predictionTime)
 {
     return(this.SteerToFollowFlowField(field, MaxSpeed, predictionTime, annotation));
 }