Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
        /// <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;
        }