Changed to smart ptr for bounding box because of destructor problems.