コード例 #1
0
 public UDECartesianMovementBuilder Accel(CartesianTimeFunction accel)
 {
     this.accel = accel;
     return(this);
 }
コード例 #2
0
 /// <summary>
 /// The basic constructor of the struct.
 /// </summary>
 /// <param name="mode">Move mode</param>
 /// <param name="startTime">Start time to move</param>
 /// <param name="endTime">End time to move</param>
 /// <param name="hasEndTime"><see langword="true"/> if it has an end time</param>
 /// <param name="limitSpeed"><see langword="true"/> if there is a speed limit</param>
 /// <param name="setSpeedToPrevMovement"><see langword="true"/> if the initial speed sets to the current speed of the bullet automatically.</param>
 /// <param name="velocity">Velocity vector in cartesian coordinate system</param>
 /// <param name="maxVelocity">Maximum speed of each component of the velocity in cartesian coordinate system</param>
 /// <param name="minVelocity">Minimum speed of each component of the velocity in cartesian coordinate system</param>
 /// <param name="maxMagnitude">Maximum magnitude of velocity vector in cartesian coordinate system</param>
 /// <param name="minMagnitude">Minimum magnitude of velocity vector in cartesian coordinate system</param>
 /// <param name="accel">Acceleration vector by time in cartesian coordinate system</param>
 /// <param name="speed">Speed in cartesian coordinate system</param>
 /// <param name="maxSpeed">Maximum speed in cartesian coordinate system</param>
 /// <param name="minSpeed">Minimum speed in cartesian coordinate system</param>
 /// <param name="angle">Angle to move</param>
 /// <param name="tangentialAccel">Tangential acceleration by time in cartesian coordinate system</param>
 /// <param name="normalAccel">Normal acceleration by time in cartesian coordinate system</param>
 /// <param name="radialSpeed">Radial speed in polar coordinate system</param>
 /// <param name="angularSpeed">Angular speed in polar coordinate system</param>
 /// <param name="maxRadialSpeed">Maximum radial speed in polar coordinate system</param>
 /// <param name="maxAngularSpeed">Maximum angular speed in polar coordinate system</param>
 /// <param name="minRadialSpeed">Minimum radial speed in polar coordinate system</param>
 /// <param name="minAngularSpeed">Minimum angular speed in polar coordinate system</param>
 /// <param name="radialAccel">Radial acceleration by time in polar coordinate system</param>
 /// <param name="angularAccel">Angular acceleration by time in polar coordinate system</param>
 /// <param name="faceToMovingDirection"><see langword="true"/> if the bullet rotates toward the moving direction</param>
 /// <param name="rotationAngularSpeed">Bullel's speed of rotation</param>
 /// <param name="rotationAngularAcceleration">Bullet's acceleration of rotation by time</param>
 /// <param name="limitRotationSpeed"><see langword="true"/> if there is a limit of rotation speed</param>
 /// <param name="minRotationSpeed">Minimum speed of rotation</param>
 /// <param name="maxRotationSpeed">Maximum speed of rotation</param>
 public UDEBulletMovement(MoveMode mode,
                          float startTime,
                          float endTime,
                          bool hasEndTime,
                          bool limitSpeed,
                          bool setSpeedToPrevMovement,
                          Vector2 velocity,
                          Vector2 maxVelocity,
                          Vector2 minVelocity,
                          float maxMagnitude,
                          float minMagnitude,
                          CartesianTimeFunction accel,
                          float speed,
                          float maxSpeed,
                          float minSpeed,
                          float angle,
                          TimeFunction tangentialAccel,
                          TimeFunction normalAccel,
                          float radialSpeed,
                          float angularSpeed,
                          float maxRadialSpeed,
                          float maxAngularSpeed,
                          float minRadialSpeed,
                          float minAngularSpeed,
                          TimeFunction radialAccel,
                          TimeFunction angularAccel,
                          bool faceToMovingDirection,
                          float rotationAngularSpeed,
                          TimeFunction rotationAngularAcceleration,
                          bool limitRotationSpeed,
                          float minRotationSpeed,
                          float maxRotationSpeed)
 {
     this.mode                        = mode;
     this.startTime                   = startTime;
     this.endTime                     = endTime;
     this.hasEndTime                  = hasEndTime;
     this.limitSpeed                  = limitSpeed;
     this.setSpeedToPrevMovement      = setSpeedToPrevMovement;
     updateCount                      = 0;
     this.velocity                    = velocity;
     this.maxVelocity                 = maxVelocity;
     this.minVelocity                 = minVelocity;
     this.maxMagnitude                = maxMagnitude;
     this.minMagnitude                = minMagnitude;
     this.accel                       = accel ?? throw new ArgumentNullException(nameof(accel));
     this.speed                       = speed;
     this.maxSpeed                    = maxSpeed;
     this.minSpeed                    = minSpeed;
     this.angle                       = angle;
     this.tangentialAccel             = tangentialAccel ?? throw new ArgumentNullException(nameof(tangentialAccel));
     this.normalAccel                 = normalAccel ?? throw new ArgumentNullException(nameof(normalAccel));
     this.radialSpeed                 = radialSpeed;
     this.angularSpeed                = angularSpeed;
     this.maxRadialSpeed              = maxRadialSpeed;
     this.maxAngularSpeed             = maxAngularSpeed;
     this.minRadialSpeed              = minRadialSpeed;
     this.minAngularSpeed             = minAngularSpeed;
     this.radialAccel                 = radialAccel ?? throw new ArgumentNullException(nameof(radialAccel));
     this.angularAccel                = angularAccel ?? throw new ArgumentNullException(nameof(angularAccel));
     this.faceToMovingDirection       = faceToMovingDirection;
     this.rotationAngularSpeed        = rotationAngularSpeed;
     this.rotationAngularAcceleration = rotationAngularAcceleration;
     this.limitRotationSpeed          = limitRotationSpeed;
     this.minRotationSpeed            = minRotationSpeed;
     this.maxRotationSpeed            = maxRotationSpeed;
 }