/// <inheritdoc /> public void Calculate(IReadOnlyList <IBody> bodies) { var p = bodies[_handle].Position; if (_bounds.Contains(p)) { _apply = false; return; } _handle.Delta = _bounds.Clamp(p) - p; _apply = true; }
/// <inheritdoc /> public void Calculate(ReadOnlyArrayView <Body> bodies) { var p = bodies[_index].Position.Current; if (_bounds.Contains(p)) { _delta = Vector3d.Zero; _apply = false; return; } _delta = _bounds.Clamp(p) - p; _apply = true; }
/// <summary> /// /// </summary> /// <param name="particles"></param> public override sealed void Calculate(IReadOnlyList <IBody> particles) { var d = Interval; foreach (var h in Handles) { var p = particles[h].Position; if (d.Contains(p)) { h.Weight = 0.0; continue; } h.Delta = Interval.Clamp(p) - p; h.Weight = Weight; } }
/// <inheritdoc/> /// <summary> /// /// </summary> /// <param name="particles"></param> public void Calculate(IReadOnlyList <IBody> particles) { var d = Interval; foreach (var h in Handles) { var p = particles[h].Position; if (d.Contains(p)) { h.Skip = true; continue; } h.Delta = Interval.Clamp(p) - p; h.Skip = false; } }