コード例 #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));
        }
コード例 #2
0
ファイル: LocomotorDrive.cs プロジェクト: askeladdk/CCEngine
 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;
 }
コード例 #3
0
 public FlowField(IFlowField field)
 {
     Field = field;
 }
コード例 #4
0
 protected Vector3 SteerToFollowFlowField(IFlowField field, float predictionTime)
 {
     return(this.SteerToFollowFlowField(field, MaxSpeed, predictionTime, annotation));
 }