Similar Items: RigidFormer: Learning Rigid Dynamics using Transformers