using UnityEngine;

public static class VerticalProjectionCalculator
{
    public static Vector3 CalculateProjectionPointOnDomeGivenXZ(float x, float z)
    {
        Vector3 targetPoint = Vector3.zero;
        //do some things here, like

        //create a ray from a point on the plane, looking upward
        Ray constructedRay = new Ray(new Vector3((float)x, (float)z), Vector3.up);
        //confirm this indeed hits the dome (make sure the layers matrix is set properly
        RaycastHit raycastHit;
        if (Physics.Raycast(constructedRay, out raycastHit))
        {
            targetPoint = raycastHit.point;
        }
        return targetPoint;
    }
}

