Added object class, moved intersection maths code.