Namespace UnityEngine.Splines | Splines | 2.6.0 (2024)

Classes

CurveUtility

A collection of methods for extracting information about BezierCurve types.

EmbeddedSplineData

Wrapper for accessing a SplineData<T> value stored on Spline through one of theembedded key value collections. It is not required to use this class to access embeddedSplineData<T>, however it does provide some convenient functionality for working with this datain the Inspector.

EmbeddedSplineDataFieldsAttribute

Attribute used to make an EmbeddedSplineData variable show in the Inspector with a filtered setof fields editable. Use this in situations where you want to specify EmbeddedSplineData parametersin code and not allow them to be modified in the Inspector.to a ISplineContainer.

InterpolatorUtility

InterpolatorUtility provides easy access to all the different IInterpolator implementations.

KnotLinkCollection

A collection of KnotLinks to track how spline knots are linked and the utilities toupdate these links when splines are modified.

Spline

The Spline class is a collection of BezierKnot, the closed/open state, and editing representation.

SplineAnimate

A component to animate an object along a spline.

SplineComponent

Base class for SplineInstantiate and SplineExtrude, contains common elements to both of these Components

SplineContainer

A component that holds a list of Spline objects.

SplineData<T>

The SplineData{T} class is used to store information relative to a Spline without coupling datadirectly to the Spline class. SplineData can store any type of data, and provides options for how to indexDataPoints.

SplineExtrude

A component for creating a tube mesh from a Spline at runtime.

SplineFactory

Methods to create spline shapes.

SplineIndexAttribute

Attribute used to make an integer variable show in the Inspector as a popup menu with spline choices relativeto a ISplineContainer.

SplineInstantiate

SplineInstantiate is used to automatically instantiate prefabs or objects along a spline.

SplineJobs

The SplineJobs class contains utility methods for evaluating spline data using the Jobs system.

SplineMath

Assorted utility functions for math equations commonly used when working with Splines.

SplineMesh

Utility methods for creating and working with meshes.

SplinePath

The SplinePath type is an implementation of ISpline that is composed of multiple sections ofother splines (see SplineSlice<T>). This is useful when you want to evaluate a path that followsmultiple splines, typically in the case where splines share linked knots.

This class is a data structure that defines the range of curves to associate together. This class is not meant to beused intensively for runtime evaluation because it is not performant. Data is not meant to bestored in that struct and that struct is not reactive to spline changes. The GameObject that contains thisslice can be scaled and the knots of the targeted spline that can moved around the curve length cannot be storedhere so evaluating positions, tangents and up vectors is expensive.

If performance is a critical requirement, create a new Spline orNativeSpline from your SplinePath<T>. Note that you might pass a SplinePath<T>to constructors for both Spline and NativeSpline.

SplinePath<T>

The SplinePath type is an implementation of ISpline that is composed of multiple sections ofother splines (see SplineSlice<T>). This is useful when you want to evaluate a path that followsmultiple splines, typically in the case where splines share linked knots.

If performance is a critical requirement, create a new Spline orNativeSpline from your SplinePath<T>. Note that you might pass a SplinePath<T>to constructors for both Spline and NativeSpline.

SplineUtility

A collection of methods for extracting information about Spline types.

Structs

BezierCurve

Control points for a cubic Bezier curve.

Points P0 through P3 are in sequential order, describing the starting point, second, third, and ending controlsfor a cubic Bezier curve.

BezierKnot

This struct contains position and tangent data for a knot. The position is a scalar point and the tangents are vectors.The Spline class stores a collection of BezierKnot that form a series of connectedBezierCurve. Each knot contains a Position, Tangent In, and Tangent Out. When a spline is notclosed, the first and last knots will contain an extraneous tangent (in and out, respectively).

DataPoint<TDataType>

A pair containing an interpolation ratio and {TDataType} value.

DistanceToInterpolation

A key-value pair associating a distance to interpolation ratio ('t') value. This is used when evaluating Splineattributes to ensure uniform distribution of sampling points.

GetPosition

Provides methods to calculate, in parallel, the positions along NativeSpline.

GetPositionTangentNormal

A job struct for calculating in parallel the position, tangent, and normal (up) vectors along aNativeSpline.

NativeSpline

A read-only representation of Spline that is optimized for efficient access and queries.NativeSpline can be constructed with a spline and Transform. If a transform is applied, all values will berelative to the transformed knot positions.

SplineComputeBufferScope<T>

SplineComputeBufferScope is a convenient way to extract from a spline the information necessary to evaluatespline values in a ComputeShader.To access Spline evaluation methods in a shader, include the "Splines.cginc" file:

#include "Packages/com.unity.splines/Shader/Spline.cginc"

SplineInfo

SplineInfo is used to wrap a reference to the SplineContainer and index within that container todescribe a Spline.

SplineInstantiate.InstantiableItem

Describe the item prefab to instantiate and associate it with a probability

SplineKnotIndex

Provides a tuple to define a couple (Spline index, Knot index) that identifies a particular knot on a spline.This tuple is used by KnotLinkCollection to maintain links between knots.

SplineRange

Describes a subset of knot indices in a Spline. The range might iterate in either theforward or backward direction.

SplineRange.SplineRangeEnumerator

A struct for iterating a SplineRange.

SplineSlice<T>

SplineSlice represents a partial or complete range of curves from another Spline.A SplineSlice<T> by itself does not store any BezierKnots. It stores a reference toa separate Spline, then retrieves knots by iterating the SplineRange.Use SplineSlice<T> in conjunction with SplinePath to create seamless paths fromdiscrete Spline segments.

This class is a data structure that defines the range of curves to associate together. This class is not meant to beused intensively for runtime evaluation because it is not performant. Data is not meant to bestored in that struct and that struct is not reactive to spline changes. The GameObject that contains thisslice can be scaled and the knots of the targeted spline that can moved around the curve length cannot be storedhere so evaluating positions, tangents and up vectors is expensive.

If performance is a critical requirement, create a new Spline orNativeSpline from the relevant SplinePath<T> or SplineSlice<T>.Note that you might pass a SplineSlice<T> to constructors for both Spline and NativeSpline.

Interfaces

IDataPoint

Defines an interpolation ratio 't' for a Data Point.

IHasEmptyCurves

This interface defines a collection of knot indices that should be considered disconnected from the followingknot indices when creating a BezierCurve.

IInterpolator<T>

To calculate a value at some distance along a spline, interpolation is required. The IInterpolator interfaceallows you to define how data is interpreted given a start value, end value, and normalized interpolation value(commonly referred to as 't').

ISpline

ISpline defines the interface from which Spline types inherit.

ISplineContainer

An interface that represents ISplineContainer on a MonoBehaviour to enable Spline tools in the Editor.

SplineMesh.ISplineVertexData

Interface for Spline mesh vertex data. Implement this interface if you are extruding custom mesh data anddo not want to use the vertex layout provided by SplineMesh."/>.

Enums

BezierTangent

Describes the direction of a BezierKnot tangent. A spline is composed of a list ofBezierKnot, where every knot can be either the start or end of a BezierCurve. TheBezierTangent enum indicates which tangent should be used to construct a curve.

EmbeddedSplineDataField

Describes the fields on an EmbeddedSplineData type.

EmbeddedSplineDataType

Describes a type of data stored by a SplineData<T> collection embedded in Spline.

PathIndexUnit

Describes the unit of measurement used by DataPoint<TDataType>.

SliceDirection

Describes the direction that a SplineRange interpolates. Use SplineSlice<T> andSplineRange to create paths that interpolate along a Spline in either a forwardor backward direction.

SplineAnimate.AlignmentMode

Describes the ways the object can be aligned when animating along the spline.

SplineAnimate.EasingMode

Describes the different ways the object's animation along the spline can be eased.

SplineAnimate.LoopMode

Describes the different ways the object's animation along the Spline can be looped.

SplineAnimate.Method

Describes the different methods that can be used to animated an object along a spline.

SplineComponent.AlignAxis

Describes the different types of object alignment axes.

SplineInstantiate.Method

Describe the possible methods to instantiate instances along the spline.

SplineInstantiate.OffsetSpace

The space in which to interpret the offset, this can be different from the orientation space used to instantiate objects.

SplineInstantiate.Space

Describes the coordinate space that is used to orient the instantiated object.

SplineModification

Describes the different types of changes that can occur to a spline.

TangentMode

Describes the different ways a tool might interact with a tangent handle.

Namespace UnityEngine.Splines
 | Splines | 2.6.0 (2024)

FAQs

How to make a spline in Unity? ›

Create or open a project on Unity 2022.2 or later, then install the Splines package using the Package Manager. To create a spline: From the top menu, select Create > Spline > Draw Spline. Click in the Scene view to place points for your spline.

How are splines created? ›

You can create a spline by specifying either a series of interpolation points through which the curve passes, or by defining a control polygon. A spline created with interpolation points will pass exactly through the interpolation points used to define it.

What options are used to create splines? ›

To Draw a Spline:
  • Click SPLINE.
  • (Optional) Enter m (Method). Then enter either f (Fit Points) or cv (Control Vertices).
  • Specify the first point of the spline.
  • Specify the next point of the spline. Continue specifying points as needed.
  • Press Enter to end, or enter c (Close) to close the spline.

How do you make a 3D spline? ›

To create a spline in a 3D sketch:
  1. Click 3D Sketch. (Sketch toolbar) or Insert > 3D Sketch.
  2. Click Spline. ...
  3. Click to place the first spline point, then drag to sketch the spline. ...
  4. Continue to place spline points and change planes if necessary.
  5. When the spline is complete, double-click to stop sketching.

How to do a linear spline? ›

Linear splines

The linear spline represents a set of line segments between the two adjacent data points (Vk,Ik) and (Vk+1,Ik+1). The equations for each line segment can be immediately found in a simple form: Ik(V) = Ik + ( Ik+1 - Ik) ( V - Vk ) / (Vk+1 - Vk), where V = [Vk,Vk+1] and k = 0,1,...,(n-1).

How do you make a spline on a shaft? ›

The hobbing process can produce all types of external splines. A hobbing machine uses a cutting tool called the 'hob' that rotates with the workpiece removing material from the spaces between each spline tooth. Both external and internal splines can be produced using the shaping process.

References

Top Articles
Latest Posts
Article information

Author: Delena Feil

Last Updated:

Views: 5937

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.