The problem of motion of a material point in a three-dimensional domain bounded by confocal quadrics is considered. Such a dynamical system is Liouville integrable in the piecewise-smooth sense. For two types of billiard regions, the regions of possible motion of a material point are found, the bifurcation diagrams are constructed, and the semi-local structure of the Liouville foliation is described. On singular Liouville foliation layers of nonzero rank, at least one action variable can be smoothly extended. This consideration, applied to the billiard inside a three-axial ellipsoid, gave a new proof of Staude's construction of an ellipsoid using a thread.