{!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 GetImpulseFromForce | Unity Physics | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetImpulseFromForce

    GetImpulseFromForce(in PhysicsMass, float, in float3, in ForceMode, in float, out float3, out PhysicsMass)

    Converts a force into an impulse based on the force mode and the bodies mass and inertia properties, and scale.

    Declaration
    public static void GetImpulseFromForce(this in PhysicsMass bodyMass, float bodyScale, in float3 force, in ForceMode mode, in float timestep, out float3 impulse, out PhysicsMass impulseMass)
    Parameters
    Type Name Description
    PhysicsMass bodyMass

    The body's PhysicsMass component.

    float bodyScale

    The body's uniform scale.

    float3 force

    The force to be applied to a body.

    ForceMode mode

    The method used to apply the force to its targets.

    float timestep

    The change in time from the current to the next frame.

    float3 impulse

    [out] A returned impulse proportional to the provided 'force' and based on the supplied 'mode'.

    PhysicsMass impulseMass

    [out] A returned PhysicsMass component to be passed to an Apply function.

    GetImpulseFromForce(in PhysicsMass, in float3, in ForceMode, in float, out float3, out PhysicsMass)

    Converts a force into an impulse based on the force mode and the bodies mass and inertia properties. Assumes that there is no scale. GetImpulseFromForce(in PhysicsMass, float, in float3, in ForceMode, in float, out float3, out PhysicsMass)

    Declaration
    public static void GetImpulseFromForce(this in PhysicsMass bodyMass, in float3 force, in ForceMode mode, in float timestep, out float3 impulse, out PhysicsMass impulseMass)
    Parameters
    Type Name Description
    PhysicsMass bodyMass

    The body mass.

    float3 force

    The force.

    ForceMode mode

    The mode.

    float timestep

    The timestep.

    float3 impulse

    [out] The impulse.

    PhysicsMass impulseMass

    [out] The impulse mass.

    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)