  The aim of the paper is to unify the efforts in the study of integrable
billiards within quadrics in flat and curved spaces and to explore further the
interplay of symplectic and contact integrability. As a starting point in this
direction, we consider virtual billiard dynamics within quadrics in
pseudo--Euclidean spaces. In contrast to the usual billiards, the incoming
velocity and the velocity after the billiard reflection can be at opposite
sides of the tangent plane at the reflection point. In the symmetric case we
prove noncommutative integrability of the system and give a geometrical
interpretation of integrals, an analog of the classical Chasles and Poncelet
theorems and we show that the virtual billiard dynamics provides a natural
framework in the study of billiards within quadrics in projective spaces, in
particular of billiards within ellipsoids on the sphere $\mathbb S^{n-1}$ and
the Lobachevsky space $\mathbb H^{n-1}$.
