sapCollisionConstraint
Sets the collision resolution handler to a sweep-and-prune (SAP) based collision constraint.
The SAP collision constraint enhances the simulation by applying an efficient algorithm to resolve collisions between bodies. This method modifies the collisionConstraint property of the ForceSimulation instance to utilize an instance of SAPCollisionConstraint, which is specifically designed to handle collision detection and resolution using the sweep-and-prune approach.
By leveraging this method, the simulation can benefit from an optimized collision detection process that is well-suited for scenarios with a significant number of interacting bodies.
It is recommended to call this method before initiating a simulation to ensure proper collision handling is in place.