implement snapping for cube object