Nez.Portable/ECS/Components/Physics/Colliders/Collider.cs
/// <summary>
/// checks to see if this Collider with motion applied (delta movement vector) collides with collider. If it does, true will be
/// returned and result will be populated with collision data.
/// </summary>
/// <returns><c>true</c>, if with was collidesed, <c>false</c> otherwise.</returns>
/// <param name="collider">Collider.</param>
/// <param name="motion">Motion.</param>
/// <param name="result">Result.</param>
checks to see if this Collider with motion applied (delta movement vector) collides with collider. If it does, true will be
returned and result will be populated with collision data.
checks to see if this Collider with motion applied ( delta movement vector ) collides with collider . If it does true will be returned and result will be populated with collision data .
public bool collidesWith(Collider collider, Vector2 motion, out CollisionResult result)
        {
            var oldPosition = shape.position;
            shape.position += motion;
            var didCollide = shape.collidesWithShape(collider.shape, out result);
            if (didCollide)
                result.collider = collider;
            shape.position = oldPosition;
            return didCollide;
        }
public bool collidesWith ( Collider collider , Vector2 motion , out CollisionResult result ) { var oldPosition = shape . position ; shape . position += motion ; var didCollide = shape . collidesWithShape ( collider . shape , out result ) ; if ( didCollide ) result . collider = collider ; shape . position = oldPosition ; return didCollide ; }
checks to see if this Collider with motion applied (delta movement vector) collides with collider.
checks to see if this Collider with motion applied ( delta movement vector ) collides with collider .
// alter the shapes position so that it is in the place it would be after movement so we can check for overlaps // return the shapes position to where it was before the check
None
collider
Collider
None
motion
Vector2
None
CollisionResult
out
result
None