コード例 #1
0
 /// <summary>
 /// Creates a gravitational field.
 /// </summary>
 /// <param name="shape">Shape representing the volume of the force field.</param>
 /// <param name="origin">Location that entities will be pushed toward.</param>
 /// <param name="multiplier">Represents the gravitational constant of the field times the effective mass at the center of the field.</param>
 /// <param name="maxAcceleration">Maximum acceleration the field can apply.</param>
 public GravitationalField(ForceFieldShape shape, Vector3 origin, float multiplier, float maxAcceleration)
     : base(shape)
 {
     this.Multiplier      = multiplier;
     this.Origin          = origin;
     this.MaxAcceleration = maxAcceleration;
 }
コード例 #2
0
 /// <summary>
 /// Constructs a force field.
 /// </summary>
 /// <param name="shape">Shape to use for the force field.</param>
 protected ForceField(ForceFieldShape shape)
 {
     Shape               = shape;
     subfunction         = new Action <int>(CalculateImpulsesSubfunction);
     AllowMultithreading = true;
 }