CharacterController2D.primeRaycastOrigins C# (CSharp) Method

primeRaycastOrigins() private method

resets the raycastOrigins to the current extents of the box collider inset by the skinWidth. It is inset to avoid casting a ray from a position directly touching another collider which results in wonky normal data.
private primeRaycastOrigins ( Vector3 futurePosition, Vector3 deltaMovement ) : void
futurePosition Vector3 Future position.
deltaMovement Vector3 Delta movement.
return void
	private void primeRaycastOrigins( Vector3 futurePosition, Vector3 deltaMovement )
	{
		// our raycasts need to be fired from the bounds inset by the skinWidth
		var modifiedBounds = boxCollider.bounds;
		modifiedBounds.Expand( -2f * _skinWidth );

		_raycastOrigins.topLeft = new Vector2( modifiedBounds.min.x, modifiedBounds.max.y );
		_raycastOrigins.bottomRight = new Vector2( modifiedBounds.max.x, modifiedBounds.min.y );
		_raycastOrigins.bottomLeft = modifiedBounds.min;
	}