docs.unity3d.com
    Show / Hide Table of Contents

    Class SplineFactory

    Methods to create spline shapes.

    Inheritance
    Object
    SplineFactory
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.Splines
    Syntax
    public static class SplineFactory

    Methods

    CreateCatmullRom(IList<float3>, Boolean)

    Create a Spline from a list of positions and place tangents to create Catmull Rom curves.

    Declaration
    public static Spline CreateCatmullRom(IList<float3> positions, bool closed = false)
    Parameters
    Type Name Description
    IList<float3> positions

    A collection of knot positions.

    Boolean closed

    Whether the spline is open (has a start and end point) or closed (forms an unbroken loop).

    Returns
    Type Description
    Spline

    A new Spline.

    CreateLinear(IList<float3>, Boolean)

    Create a Spline from a list of positions.

    Declaration
    public static Spline CreateLinear(IList<float3> positions, bool closed = false)
    Parameters
    Type Name Description
    IList<float3> positions

    A collection of knot positions.

    Boolean closed

    Whether the spline is open (has a start and end point) or closed (forms an unbroken loop).

    Returns
    Type Description
    Spline

    A new Spline.

    CreateLinear(IList<float3>, IList<quaternion>, Boolean)

    Create a Spline from a list of positions.

    Declaration
    public static Spline CreateLinear(IList<float3> positions, IList<quaternion> rotations, bool closed = false)
    Parameters
    Type Name Description
    IList<float3> positions

    A collection of knot positions.

    IList<quaternion> rotations

    A collection of knot rotations. Must be equal in length to the positions array.

    Boolean closed

    Whether the spline is open (has a start and end point) or closed (forms an unbroken loop).

    Returns
    Type Description
    Spline

    A new Spline.

    CreateRoundedSquare(Single, Single)

    Create a Spline in a square shape with rounding at the edges.

    Declaration
    public static Spline CreateRoundedSquare(float radius, float rounding)
    Parameters
    Type Name Description
    Single radius

    The distance from center to outermost edge.

    Single rounding

    The amount of rounding to apply to corners.

    Returns
    Type Description
    Spline

    A new Spline.

    CreateSquare(Single)

    Create a Spline in a square shape with sharp corners.

    Declaration
    public static Spline CreateSquare(float radius)
    Parameters
    Type Name Description
    Single radius

    The distance from center to outermost edge.

    Returns
    Type Description
    Spline

    A new Spline.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023