Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Havok rigidbody translation tolerance?

Discussion in 'Physics Previews' started by ameinfjg, Dec 20, 2019.

  1. ameinfjg

    ameinfjg

    Joined:
    Feb 14, 2017
    Posts:
    78
    Hi,

    We've encountered an issue using Havok physics that we cannot reproduce with Unity physics. It seems that changes made to the translation of a body from outside the simulation are not applied if the value is sufficiently small. In our case a translation of (0.01, 0.01, 0.01) has been proved not to work but (0.02, 0.02, 0.02) does work. The visual debugger clearly shows calls of 'Set Body Transform Command' with the greater value that cannot be seen when the lesser value is used. Meanwhile Unity physics seems to always update the transform even with the smaller value.

    This has lead us to suspect that somewhere some kind of tolerance is being applied that we've no access to, is this true or is there some other explanation?
     
  2. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    You are absolutely right. There is a sync tolerance currently of 1e-2 at the minute, on transforms and velocities. Sounds like this it too aggressive and we should investigate better defaults and/or allow the user to set them.
    The reason for this tolerance is that there is a bunch of space conversations than can introduce small delta. Also, ultimately calling 'Set Body Transform' in the SDK (i.e. warp body) is reasonably expensive rather than calling it ever frame is not a great idea rather than via velocities and integration.
    Can I ask why are small translations being applied to bodies? Are they static, kinematic or dynamic?
     
  3. ameinfjg

    ameinfjg

    Joined:
    Feb 14, 2017
    Posts:
    78
    It's part of our server -> client sync system. They're producing slightly different results for the position of certain bodies (whether that's the result of a bug or not is unclear at this time and something I need to work on some more) and when we try to update the client with the result from the server the change isn't applied because the difference is apparently within that tolerance.