Language:
Discover
By Skill Level
By Category

USplineComponent

Choose your OS:

Inheritance Hierarchy

Syntax

class USplineComponent : public UPrimitiveComponent

Remarks

A spline component is a spline shape which can be used for other purposes (e.g. animating objects). It contains debug rendering capabilities.

Variables

Name Description

Public variable

bool

 

bAllowDiscontinuousSpline

Whether the spline's leave and arrive tangents can be different

Public variable

bool

 

bDrawDebug

If true, the spline will be rendered if the Splines showflag is set.

Public variable

bool

 

bInputSplinePointsToConstructionScript

Whether the spline points should be passed to the User Construction Script so they can be further manipulated by it.

Public variable

bool

 

bModifiedByConstructionScript

Whether the UCS has made changes to the spline points

Public variable

bool

 

bShouldVisualizeScale

Whether scale visualization should be displayed

Public variable

bool

 

bSplineHasBeenEdited

Whether the spline has been edited from its default by the spline component visualizer

Public variable

bool

 

bStationaryEndpoints

Whether the endpoints of the spline are considered stationary when traversing the spline at non-constant velocity.

Public variable

FVector

 

DefaultUpVector

Default up vector in local space to be used when calculating transforms along the spline

Public variable

float

 

Duration

Specifies the duration of the spline in seconds

Public variable

FLinearColor

 

EditorSelectedSplineSegmentColor

Color of a selected spline component segment in the editor

Public variable

FLinearColor

 

EditorUnselectedSplineSegmentColor

Color of an unselected spline component segment in the editor

Public variable

int32

 

ReparamStepsPerSegment

Number of steps per spline segment to place in the reparameterization table

Public variable

float

 

ScaleVisualizationWidth

Width of spline in editor for use with scale visualization

Public variable

FSplineCurves

 

SplineCurves

Constructors

Name Description

Public function

USplineComponent

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Public function

void

 

AddPoint

(
    const FSplinePoint & Point,
    bool bUpdateSpline
)

Adds an FSplinePoint to the spline.

Public function

void

 

AddPoints

(
    const TArray < FSplinePoint >& Poin...,
    bool bUpdateSpline
)

Adds an array of FSplinePoints to the spline.

Public function

void

 

AddSplineLocalPoint

(
    const FVector & Position
)

Adds a local space point to the spline

Public function

void

 

AddSplinePoint

(
    const FVector & Position,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUpdateSpline
)

Adds a point to the spline

Public function

void

 

AddSplinePointAtIndex

(
    const FVector & Position,
    int32 Index,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUpdateSpline
)

Adds a point to the spline at the specified index

Public function

void

 

AddSplineWorldPoint

(
    const FVector & Position
)

Deprecated method definitions.

Public function

void

 

ApplyComponentInstanceData

(
    FSplineInstanceData* Component...,
    const bool bPostUCS
)

Public function

void

 

ClearSplinePoints

(
    bool bUpdateSpline
)

Clears all the points in the spline

Public function Static

void

 

Draw

(
    FPrimitiveDrawInterface * PDI,
    const FSceneView * View,
    const FInterpCurveVector & SplineIn...,
    const FMatrix & LocalToWorld,
    const FLinearColor & LineColor,
    uint8 DepthPriorityGroup
)

Helper function to draw a vector curve

Public function

FVector

 

FindDirectionClosestToWorldLocation

(
    const FVector & WorldLocation,
    ESplineCoordinateSpace::Type Coordi...
)

Given a location, in world spcae, return a unit direction vector of the spline tangent closest to the location.

Public function

float

 

FindInputKeyClosestToWorldLocation

(
    const FVector & WorldLocation
)

Given a location, in world space, return the input key closest to that location.

Public function

FVector

 

FindLocationClosestToWorldLocation

(
    const FVector & WorldLocation,
    ESplineCoordinateSpace::Type Coordi...
)

Given a location, in world space, return the point on the curve that is closest to the location.

Public function

FQuat

 

FindQuaternionClosestToWorldLocation

(
    const FVector & WorldLocation,
    ESplineCoordinateSpace::Type Coordi...
)

Given a location, in world space, return a quaternion corresponding to the spline's rotation closest to the location.

Public function

FVector

 

FindRightVectorClosestToWorldLocation

(
    const FVector & WorldLocation,
    ESplineCoordinateSpace::Type Coordi...
)

Given a location, in world space, return a unit direction vector corresponding to the spline's right vector closest to the location.

Public function

float

 

FindRollClosestToWorldLocation

(
    const FVector & WorldLocation,
    ESplineCoordinateSpace::Type Coordi...
)

Given a location, in world space, return the spline's roll closest to the location, in degrees.

Public function

FRotator

 

FindRotationClosestToWorldLocation

(
    const FVector & WorldLocation,
    ESplineCoordinateSpace::Type Coordi...
)

Given a location, in world space, return rotation corresponding to the spline's rotation closest to the location.

Public function

FVector

 

FindScaleClosestToWorldLocation

(
    const FVector & WorldLocation
)

Given a location, in world space, return the spline's scale closest to the location.

Public function

FVector

 

FindTangentClosestToWorldLocation

(
    const FVector & WorldLocation,
    ESplineCoordinateSpace::Type Coordi...
)

Given a location, in world space, return the tangent vector of the spline closest to the location.

Public function

FTransform

 

FindTransformClosestToWorldLocation

(
    const FVector & WorldLocation,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseScale
)

Given a location, in world space, return an FTransform closest to that location.

Public function

FVector

 

FindUpVectorClosestToWorldLocation

(
    const FVector & WorldLocation,
    ESplineCoordinateSpace::Type Coordi...
)

Given a location, in world space, return a unit direction vector corresponding to the spline's up vector closest to the location.

Public function

FVector

 

GetArriveTangentAtSplinePoint

(
    int32 PointIndex,
    ESplineCoordinateSpace::Type Coordi...
)

Get the arrive tangent at spline point

Public function

FVector

 

GetDefaultUpVector

(
    ESplineCoordinateSpace::Type Coordi...
)

Gets the default up vector used by this spline

Public function

FVector

 

GetDirectionAtDistanceAlongSpline

(
    float Distance,
    ESplineCoordinateSpace::Type Coordi...
)

Given a distance along the length of this spline, return a unit direction vector of the spline tangent there.

Public function

FVector

 

GetDirectionAtSplineInputKey

(
    float InKey,
    ESplineCoordinateSpace::Type Coordi...
)

Get unit direction along spline at the provided input key value

Public function

FVector

 

GetDirectionAtSplinePoint

(
    int32 PointIndex,
    ESplineCoordinateSpace::Type Coordi...
)

Get the location at spline point

Public function

FVector

 

GetDirectionAtTime

(
    float Time,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return a unit direction vector of the spline tangent there.

Public function

float

 

GetDistanceAlongSplineAtSplinePoint

(
    int32 PointIndex
)

Get the distance along the spline at the spline point

Public function

float

 

GetInputKeyAtDistanceAlongSpline

(
    float Distance
)

Given a distance along the length of this spline, return the corresponding input key at that point

Public function

FVector

 

GetLeaveTangentAtSplinePoint

(
    int32 PointIndex,
    ESplineCoordinateSpace::Type Coordi...
)

Get the leave tangent at spline point

Public function

void

 

GetLocalLocationAndTangentAtSplinePoint

(
    int32 PointIndex,
    FVector & LocalLocation,
    FVector & LocalTangent
)

Get local location and tangent at a spline point

Public function

void

 

GetLocationAndTangentAtSplinePoint

(
    int32 PointIndex,
    FVector & Location,
    FVector & Tangent,
    ESplineCoordinateSpace::Type Coordi...
)

Get location and tangent at a spline point

Public function

FVector

 

GetLocationAtDistanceAlongSpline

(
    float Distance,
    ESplineCoordinateSpace::Type Coordi...
)

Given a distance along the length of this spline, return the point in space where this puts you

Public function

FVector

 

GetLocationAtSplineInputKey

(
    float InKey,
    ESplineCoordinateSpace::Type Coordi...
)

Get location along spline at the provided input key value

Public function

FVector

 

GetLocationAtSplinePoint

(
    int32 PointIndex,
    ESplineCoordinateSpace::Type Coordi...
)

Get the location at spline point

Public function

FVector

 

GetLocationAtTime

(
    float Time,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return the point in space where this puts you

Public function

int32

 

GetNumberOfSplinePoints()

Get the number of points that make up this spline

Public function

FQuat

 

GetQuaternionAtDistanceAlongSpline

(
    float Distance,
    ESplineCoordinateSpace::Type Coordi...
)

Given a distance along the length of this spline, return a quaternion corresponding to the spline's rotation there.

Public function

FQuat

 

GetQuaternionAtSplineInputKey

(
    float InKey,
    ESplineCoordinateSpace::Type Coordi...
)

Get quaternion corresponding to rotation along spline at the provided input key value

Public function

FQuat

 

GetQuaternionAtSplinePoint

(
    int32 PointIndex,
    ESplineCoordinateSpace::Type Coordi...
)

Get the rotation at spline point as a quaternion

Public function

FQuat

 

GetQuaternionAtTime

(
    float Time,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return a quaternion corresponding to the spline's rotation there.

Public function

FVector

 

GetRightVectorAtDistanceAlongSpline

(
    float Distance,
    ESplineCoordinateSpace::Type Coordi...
)

Given a distance along the length of this spline, return a unit direction vector corresponding to the spline's right vector there.

Public function

FVector

 

GetRightVectorAtSplineInputKey

(
    float InKey,
    ESplineCoordinateSpace::Type Coordi...
)

Get up vector at the provided input key value

Public function

FVector

 

GetRightVectorAtSplinePoint

(
    int32 PointIndex,
    ESplineCoordinateSpace::Type Coordi...
)

Get the right vector at spline point

Public function

FVector

 

GetRightVectorAtTime

(
    float Time,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return the spline's right vector there.

Public function

float

 

GetRollAtDistanceAlongSpline

(
    float Distance,
    ESplineCoordinateSpace::Type Coordi...
)

Given a distance along the length of this spline, return the spline's roll there, in degrees.

Public function

float

 

GetRollAtSplineInputKey

(
    float InKey,
    ESplineCoordinateSpace::Type Coordi...
)

Get roll in degrees at the provided input key value

Public function

float

 

GetRollAtSplinePoint

(
    int32 PointIndex,
    ESplineCoordinateSpace::Type Coordi...
)

Get the amount of roll at spline point, in degrees

Public function

float

 

GetRollAtTime

(
    float Time,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return the spline's roll there, in degrees.

Public function

FRotator

 

GetRotationAtDistanceAlongSpline

(
    float Distance,
    ESplineCoordinateSpace::Type Coordi...
)

Given a distance along the length of this spline, return a rotation corresponding to the spline's rotation there.

Public function

FRotator

 

GetRotationAtSplineInputKey

(
    float InKey,
    ESplineCoordinateSpace::Type Coordi...
)

Get rotator corresponding to rotation along spline at the provided input key value

Public function

FRotator

 

GetRotationAtSplinePoint

(
    int32 PointIndex,
    ESplineCoordinateSpace::Type Coordi...
)

Get the rotation at spline point as a rotator

Public function

FRotator

 

GetRotationAtTime

(
    float Time,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return a rotation corresponding to the spline's position and direction there.

Public function

FVector

 

GetScaleAtDistanceAlongSpline

(
    float Distance
)

Given a distance along the length of this spline, return the spline's scale there.

Public function

FVector

 

GetScaleAtSplineInputKey

(
    float InKey
)

Get scale at the provided input key value

Public function

FVector

 

GetScaleAtSplinePoint

(
    int32 PointIndex
)

Get the scale at spline point

Public function

FVector

 

GetScaleAtTime

(
    float Time,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return the spline's scale there.

Public function

float

 

GetSplineLength()

Returns total length along this spline

Public function

const FInter ...

 

GetSplinePointsPosition()

Public function

FInterpCurve ...

 

GetSplinePointsPosition()

Public function

const FInter ...

 

GetSplinePointsRotation()

Public function

FInterpCurve ...

 

GetSplinePointsRotation()

Public function

FInterpCurve ...

 

GetSplinePointsScale()

Public function

const FInter ...

 

GetSplinePointsScale()

Public function

ESplinePoint ...

 

GetSplinePointType

(
    int32 PointIndex
)

Get the type of a spline point

Public function

FVector

 

GetTangentAtDistanceAlongSpline

(
    float Distance,
    ESplineCoordinateSpace::Type Coordi...
)

Given a distance along the length of this spline, return the tangent vector of the spline there.

Public function

FVector

 

GetTangentAtSplineInputKey

(
    float InKey,
    ESplineCoordinateSpace::Type Coordi...
)

Get tangent along spline at the provided input key value

Public function

FVector

 

GetTangentAtSplinePoint

(
    int32 PointIndex,
    ESplineCoordinateSpace::Type Coordi...
)

Get the tangent at spline point. This fetches the Leave tangent of the point.

Public function

FVector

 

GetTangentAtTime

(
    float Time,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return the spline's tangent there.

Public function

FTransform

 

GetTransformAtDistanceAlongSpline

(
    float Distance,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseScale
)

Given a distance along the length of this spline, return an FTransform corresponding to that point on the spline.

Public function

FTransform

 

GetTransformAtSplineInputKey

(
    float InKey,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseScale
)

Get transform at the provided input key value

Public function

FTransform

 

GetTransformAtSplinePoint

(
    int32 PointIndex,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseScale
)

Get the transform at spline point

Public function

FTransform

 

GetTransformAtTime

(
    float Time,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseConstantVelocity,
    bool bUseScale
)

Given a time from 0 to the spline duration, return the spline's transform at the corresponding position.

Public function

FVector

 

GetUpVectorAtDistanceAlongSpline

(
    float Distance,
    ESplineCoordinateSpace::Type Coordi...
)

Given a distance along the length of this spline, return a unit direction vector corresponding to the spline's up vector there.

Public function

FVector

 

GetUpVectorAtSplineInputKey

(
    float InKey,
    ESplineCoordinateSpace::Type Coordi...
)

Get up vector at the provided input key value

Public function

FVector

 

GetUpVectorAtSplinePoint

(
    int32 PointIndex,
    ESplineCoordinateSpace::Type Coordi...
)

Get the up vector at spline point

Public function

FVector

 

GetUpVectorAtTime

(
    float Time,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return the spline's up vector there.

Public function

FVector

 

GetWorldDirectionAtDistanceAlongSpline

(
    float Distance
)

Given a distance along the length of this spline, return a unit direction vector of the spline tangent there, in world space.

Public function

FVector

 

GetWorldDirectionAtTime

(
    float Time,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return a unit direction vector of the spline tangent there.

Public function

FVector

 

GetWorldLocationAtDistanceAlongSpline

(
    float Distance
)

Given a distance along the length of this spline, return the point in world space where this puts you

Public function

FVector

 

GetWorldLocationAtSplinePoint

(
    int32 PointIndex
)

Get the world location at spline point

Public function

FVector

 

GetWorldLocationAtTime

(
    float Time,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return the point in space where this puts you

Public function

FRotator

 

GetWorldRotationAtDistanceAlongSpline

(
    float Distance
)

Given a distance along the length of this spline, return a rotation corresponding to the spline's rotation there, in world space.

Public function

FRotator

 

GetWorldRotationAtTime

(
    float Time,
    bool bUseConstantVelocity
)

Given a time from 0 to the spline duration, return a rotation corresponding to the spline's position and direction there.

Public function

FVector

 

GetWorldTangentAtDistanceAlongSpline

(
    float Distance
)

Given a distance along the length of this spline, return the tangent vector of the spline there, in world space.

Public function

bool

 

IsClosedLoop()

Check whether the spline is a closed loop or not

Public function

void

 

RemoveSplinePoint

(
    int32 Index,
    bool bUpdateSpline
)

Removes point at specified index from the spline

Public function

void

 

SetClosedLoop

(
    bool bInClosedLoop,
    bool bUpdateSpline
)

Specify whether the spline is a closed loop or not.

Public function

void

 

SetClosedLoopAtPosition

(
    bool bInClosedLoop,
    float Key,
    bool bUpdateSpline
)

Specify whether the spline is a closed loop or not, and if so, the input key corresponding to the loop point

Public function

void

 

SetDefaultUpVector

(
    const FVector & UpVector,
    ESplineCoordinateSpace::Type Coordi...
)

Sets the default up vector used by this spline

Public function

void

 

SetDrawDebug

(
    bool bShow
)

Specify whether this spline should be rendered when the Editor/Game spline show flag is set

Public function

void

 

SetLocationAtSplinePoint

(
    int32 PointIndex,
    const FVector & InLocation,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUpdateSpline
)

Move an existing point to a new location

Public function

void

 

SetSelectedSplineSegmentColor

(
    const FLinearColor & SegmentColor
)

Specify selected spline component segment color in the editor

Public function

void

 

SetSplineLocalPoints

(
    const TArray < FVector >& Points
)

Sets the spline to an array of local space points

Public function

void

 

SetSplinePoints

(
    const TArray < FVector >& Points,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUpdateSpline
)

Sets the spline to an array of points

Public function

void

 

SetSplinePointType

(
    int32 PointIndex,
    ESplinePointType::Type Type,
    bool bUpdateSpline
)

Specify the type of a spline point

Public function

void

 

SetSplineWorldPoints

(
    const TArray < FVector >& Points
)

Sets the spline to an array of world space points

Public function

void

 

SetTangentAtSplinePoint

(
    int32 PointIndex,
    const FVector & InTangent,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUpdateSpline
)

Specify the tangent at a given spline point

Public function

void

 

SetTangentsAtSplinePoint

(
    int32 PointIndex,
    const FVector & InArriveTangent,
    const FVector & InLeaveTangent,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUpdateSpline
)

Specify the tangents at a given spline point

Public function

void

 

SetUnselectedSplineSegmentColor

(
    const FLinearColor & SegmentColor
)

Specify unselected spline component segment color in the editor

Public function

void

 

SetUpVectorAtSplinePoint

(
    int32 PointIndex,
    const FVector & InUpVector,
    ESplineCoordinateSpace::Type Coordi...,
    bool bUpdateSpline
)

Specify the up vector at a given spline point

Public function

void

 

SetWorldLocationAtSplinePoint

(
    int32 PointIndex,
    const FVector & InLocation
)

Move an existing point to a new world location

Public function

void

 

UpdateSpline()

Update the spline tangents and SplineReparamTable

Overridden from UPrimitiveComponent

Name Description

Public function Virtual

FPrimitiveSc ...

 

CreateSceneProxy()

Creates a proxy to represent the primitive to the scene manager in the rendering thread.

Overridden from USceneComponent

Name Description

Public function Virtual

FBoxSphereBo ...

 

CalcBounds

(
    const FTransform & LocalToWorld
)

Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size.

Overridden from UActorComponent

Name Description

Public function Virtual

FActorCompon ...

 

GetComponentInstanceData()

Called before we throw away components during RerunConstructionScripts, to cache any data we wish to persist across that operation

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeChainProperty

(
    FPropertyChangedChainEvent & Proper...
)

This alternate version of PostEditChange is called when properties inside structs are modified.

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

UObject serializer.

Constants

Name

Description

DummyPointPosition

The dummy value used for queries when there are no point in a spline

DummyPointRotation

DummyPointScale

See Also

References

Module

Engine

Header

Runtime/Engine/Classes/Components/SplineComponent.h