{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Method Extrapolate | Unity Physics | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Extrapolate

    Extrapolate(in RigidTransform, in PhysicsVelocity, in PhysicsMass, float)

    Compute a simple extrapolated transform for the graphical representation of a rigid body using its currentTransform and currentVelocity. Because bodies' motion may change the next time physics steps (e.g., as the result of a collision), using this method can mis-predict their future locations, causing them to appear to snap into place the next time physics steps. It generally results in a solid contact and kick from collisions, albeit with some interpenetration, as well as slight jitter on small, smooth velocity changes (e.g., the top of a parabolic arc).

    Simulation:                Graphical Extrapolation:
    
                  O (t=2)                     O (t=2)
    (t=0) O      /               (t=0) O     o
           \    /                       o   o
            \  O (t=1)                   o O (t=1)
    _________\/_________       ___________o________
                                           o
    Declaration
    public static RigidTransform Extrapolate(in RigidTransform currentTransform, in PhysicsVelocity currentVelocity, in PhysicsMass mass, float timeAhead)
    Parameters
    Type Name Description
    RigidTransform currentTransform

    The transform of the rigid body after physics has stepped (i.e., the value of its LocalTransform components).

    PhysicsVelocity currentVelocity

    The velocity of the rigid body after physics has stepped (i.e., the value of its PhysicsVelocity component).

    PhysicsMass mass

    The body's PhysicsMass component.

    float timeAhead

    A value indicating how many seconds the current elapsed time for graphics is ahead of the elapsed time when physics last stepped.

    Returns
    Type Description
    RigidTransform

    An extrapolated transform for a rigid body's graphical representation, suitable for constructing its LocalToWorld matrix before rendering. See also BuildLocalToWorld(int, RigidTransform, float, bool, NativeArray<PostTransformMatrix>).

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)