-
Notifications
You must be signed in to change notification settings - Fork 0
Physics
Physics only contains one feature at the moment, which is rigid body interpolation.
In Unity, KSP's game engine, there are two (sort of) independent frame-rates. The rate that new frames are rendered, which is whatever your final framerate is, and the rate of the physics engine, which is always 50 FPS, and is how frequently the positions of vessels and parts are updated.
When the rendering frame-rate is higher than the physics framerate (50 FPS/Hz), the game will render parts and vessels (rigid bodies) in the same position for multiple frames. This can appear as stuttery movement.
All this feature does is to enable a setting in Unity where each frame the visual position of the rigid body is updated to smoothly interpolate between either the previous two physics frames, or the current physics frame and an extrapolation of the next physics frame.
This can be useful when you notice a stuttering in the movement of rigid bodies, especially fast rigid bodies, and when using the Rendering sync mode.
Warning
It's unknown how rigid body interpolation affects other areas of the game, so it might be a good idea to turn it off after you're finished with it!
You can use rigid body interpolation to create a smooth and stable slow motion effect.
Physics-locked slow motion in either Time Control or using Capture Tool's timescale setting appears stepped, as now many visual frames are being rendered between each new physics frame, which only comes every 1/50th of a second of in-game time.
You can use Capture Tools or Time Control to increase the physics frame-rate (decrease fixed delta-time) to match the slow motion, but it severely impacts the stability of the physics, as Unity is designed for one physics update to always represent 1/50th of a second of game time.
Leaving the fixed delta-time unchanged, and enabling interpolated rigid-bodies before bringing the timescale down, allows you to get smooth slow motion without any changes to the physics results.