NWH Common
Search Results for

    Show / Hide Table of Contents

    Class AnimationCurveExtensions

    Extension methods for AnimationCurve manipulation and processing.

    Inheritance
    object
    AnimationCurveExtensions
    Namespace: NWH.Common.Utility
    Assembly: NWH.Common.dll
    Syntax
    public static class AnimationCurveExtensions

    Methods

    | Edit this page View Source

    GenerateCurveArray(AnimationCurve, int)

    Samples an AnimationCurve at regular intervals and returns the values as an array. Useful for pre-calculating curve values for performance-critical code.

    Declaration
    public static float[] GenerateCurveArray(this AnimationCurve self, int resolution = 256)
    Parameters
    Type Name Description
    AnimationCurve self

    The curve to sample.

    int resolution

    Number of samples to take. Higher values provide more precision.

    Returns
    Type Description
    float[]

    Array of sampled values from 0 to 1.

    | Edit this page View Source

    MakeSmooth(AnimationCurve)

    Smooths out a scripting-generated AnimationCurve by calculating appropriate tangents. Creates smooth transitions between keyframes.

    Declaration
    public static AnimationCurve MakeSmooth(this AnimationCurve inCurve)
    Parameters
    Type Name Description
    AnimationCurve inCurve

    The curve to smooth.

    Returns
    Type Description
    AnimationCurve

    A new smoothed AnimationCurve.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics