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)); }
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; }
protected Vector3 SteerToFollowFlowField(IFlowField field, float predictionTime) { return(this.SteerToFollowFlowField(field, MaxSpeed, predictionTime, annotation)); }