added optimizations to rigid body computation.  Basically the rigid body computation is restricted to an appropriate domain.