SimulationSettingsSynchronizeCollisionDomain Property |
Namespace: DigitalRune.Physics.Settings
The simulation updates the internal collision domain (see CollisionDomain) only if necessary. In Update(TimeSpan) the collision domain is updated to compute the new contacts at the beginning of each time step. Then the new positions and orientations of the simulation objects are computed. At the end of Update(TimeSpan) the contact information of the collision domain is not up-to-date because the simulation objects have moved.
By setting SynchronizeCollisionDomain to the Simulation explicitly updates the collision domain at the end of Update(TimeSpan) to ensure that the contact information is valid. This additional update costs a bit of performance, therefore the property SynchronizeCollisionDomain should only be set if other parts of the application need to access the contact information of the collision domain.
Alternatively, the user can explicitly update the collision domain by calling:
// Ensure that the contact information is up-to-date. simulation.CollisionDomain.Update(0);