Safety requirements in dynamical systems are commonly enforced with set invariance constraints over a safe region of the state space. Control barrier functions, which are Lyapunov-like functions for guaranteeing set invariance, are an effective tool to enforce such constraints and guarantee safety when the system is represented as a point in the state space. In this paper, we introduce extent-compatible control barrier functions as a tool to enforce safety for the system including its volume (extent) in the physical world. In order to implement the extent-compatible control barrier functions framework, a sum-of-squares based optimization program is proposed. Since sum-of-squares programs can be computationally prohibitive, we additionally introduce a sampling based method in order to retain the computational advantage of a traditional barrier function based quadratic program controller. We prove that the proposed sampling based controller retains the guarantee for safety. Simulation and robotic implementation results are also provided.