docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method GetLinePoints

    GetLinePoints(ref NativeArray<Vector3>, out int, Ray?)

    Gets the polygonal chain represented by a list of endpoints which form line segments to approximate the curve. Positions are in world space coordinates.

    Declaration
    public bool GetLinePoints(ref NativeArray<Vector3> linePoints, out int numPoints, Ray? rayOriginOverride = null)
    Parameters
    Type Name Description
    NativeArray<Vector3> linePoints

    When this method returns, contains the sample points if successful.

    int numPoints

    When this method returns, contains the number of sample points if successful.

    Ray? rayOriginOverride

    Optional ray origin override used when re-computing the line.

    Returns
    Type Description
    bool

    Returns true if the sample points form a valid line, such as by having at least two points. Otherwise, returns false.

    Implements
    IAdvancedLineRenderable.GetLinePoints(ref NativeArray<Vector3>, out int, Ray?)

    GetLinePoints(ref Vector3[], out int)

    Gets the polygonal chain represented by a list of endpoints which form line segments to approximate the curve. Positions are in world space coordinates.

    Declaration
    public bool GetLinePoints(ref Vector3[] linePoints, out int numPoints)
    Parameters
    Type Name Description
    Vector3[] linePoints

    When this method returns, contains the sample points if successful.

    int numPoints

    When this method returns, contains the number of sample points if successful.

    Returns
    Type Description
    bool

    Returns true if the sample points form a valid line, such as by having at least two points. Otherwise, returns false.

    Implements
    ILineRenderable.GetLinePoints(ref Vector3[], out int)
    Remarks

    Getting line points with Vector3 array is much less performant than using a native array. Use GetLinePoints(ref NativeArray<Vector3>, out int, Ray?) instead if available.

    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)