changing collision primitives to be all pure functions