AdamsLair / duality-companion

A community-developed Duality plugin implementing experimental or commonly requested features.
MIT License
3 stars 5 forks source link

Camera movement not smooth when Tracking object #9

Open SirePi opened 6 years ago

SirePi commented 6 years ago

Not sure if this is due to high speed tracking or not. The test project included features a free falling rigidbody and the camera tracking it; it's possible to see some "jumps" that appear randomly, in addition to some sudden changes in velocity that shouldn't happen due to not having anything to stop the body's fall. In addition, the source code ported to v3 is included as well.

CameramanTest.zip duality-companion-v3.zip

ilexp commented 6 years ago

It seems there is a bug in VelocityTracker here, because velocity is determined as a framerate-dependent value, rather than an independent one as it was done in v2 Transform. The value needs to be divided by TimeMult.

However, even with this fix, it's not an exact solution (especially in varying framerates like in the editor sandbox) and shouldn't be relied on for backtracking object positions to previous frames or similar calculations.

Not 100% sure, but I think varying framerates might be what causes this, as I can reproduce the behavior you described in the editor, but not in a VSynced test run in the launcher.

ilexp commented 6 years ago

Pushed a fix to develop-v3.0, the velocity values should now again be framerate-independent.

SirePi commented 6 years ago

From the launcher it looks way better; also I automatically add a VelocityTracker to the Camera (if needed) to use its smoothed Velocity calculations. For the moment I believe this can be put aside, just leaving it open to remind myself to look at it once Duality v3 is stable.