private Vector2 CalcHitPosition(DistanceInfo2D distanceInfo) { float dx = Mathf.Cos(distanceInfo.Angle); float dy = Mathf.Sin(distanceInfo.Angle); return(new Vector2(dx, dy) * (Collider.GetColliderRadius() + distanceInfo.Distance * 0.5f)); }
public CircleCollisionInfo(ICircleCollider collider, DistanceInfo2D distanceInfo) { Collider = collider; HitPosition = CalcHitPosition(distanceInfo); UpdateDistance(distanceInfo.Distance); UpdateAngle(distanceInfo.Angle); }