Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/Components
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- UPrimitiveComponent
- USplineComponent
- PAPER2UPaperTerrainSplineComponent
- UCineSplineComponent
- UWaterSplineComponent
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/Components/SplineComponent.h |
| Include | #include "Components/SplineComponent.h" |
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
| Type | Name | Description | |
|---|---|---|---|
| bool | bAllowDiscontinuousSpline | Whether the spline's leave and arrive tangents can be different | |
| bool | bDrawDebug | If true, the spline will be rendered if the Splines showflag is set. | |
| bool | bInputSplinePointsToConstructionScript | Whether the spline points should be passed to the User Construction Script so they can be further manipulated by it. | |
| bool | bModifiedByConstructionScript | Whether the UCS has made changes to the spline points | |
| bool | bShouldVisualizeScale | Whether scale visualization should be displayed | |
| bool | bSplineHasBeenEdited | Whether the spline has been edited from its default by the spline component visualizer | |
| bool | bStationaryEndpoints | Whether the endpoints of the spline are considered stationary when traversing the spline at non-constant velocity. | |
| FVector | DefaultUpVector | Default up vector in local space to be used when calculating transforms along the spline | |
| float | Duration | Specifies the duration of the spline in seconds | |
| FLinearColor | EditorSelectedSplineSegmentColor | Color of selected spline component parts in the editor | |
| FLinearColor | EditorTangentColor | Color of spline point tangents in the editor | |
| FLinearColor | EditorUnselectedSplineSegmentColor | Color of unselected spline component parts in the editor | |
| DeselectedInEditorDelegate | OnDeselectedInEditor | ||
| int32 | ReparamStepsPerSegment | Number of steps per spline segment to place in the reparameterization table | |
| float | ScaleVisualizationWidth | Width of spline in editor for use with scale visualization | |
| FSplineCurves | SplineCurves |
Constructors
| Type | Name | Description | |
|---|---|---|---|
USplineComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddPoint
(
const FSplinePoint& Point, |
Adds an FSplinePoint to the spline. | |
| void | AddPoints
(
const TArray< FSplinePoint >& Points, |
Adds an array of FSplinePoints to the spline. | |
| void | AddSplineLocalPoint
(
const FVector& Position |
Adds a local space point to the spline | |
| void | AddSplinePoint
(
const FVector& Position, |
Adds a point to the spline | |
| void | AddSplinePointAtIndex
(
const FVector& Position, |
Adds a point to the spline at the specified index | |
| void | AddSplineWorldPoint
(
const FVector& Position |
Deprecated method definitions. | |
| bool | Controls the visibility of the Spline point location editor in the details panel. | ||
| bool | Controls the visibility of the Spline point arrive tangent editor in the details panel. | ||
| bool | Controls the visibility of the Spline point leave tangent editor in the details panel. | ||
| bool | Controls the visibility of the Spline point rotation editor in the details panel. | ||
| bool | Controls the visibility of the Spline point scale editor in the details panel. | ||
| void | ApplyComponentInstanceData
(
FSplineInstanceData* ComponentInstanceData, |
||
| void | ClearSplinePoints
(
bool bUpdateSpline |
Clears all the points in the spline | |
| bool | ConvertSplineSegmentToPolyLine
(
int32 SplinePointStartIndex, |
Given a threshold, returns a list of vertices along the spline segment that, treated as a list of segments (polyline), matches the spline shape. | |
| bool | ConvertSplineToPolyLine
(
ESplineCoordinateSpace::Type CoordinateSpace, |
Given a threshold, returns a list of vertices along the spline that, treated as a list of segments (polyline), matches the spline shape. | |
| bool | DivideSplineIntoPolylineRecursive
(
float StartDistanceAlongSpline, |
Given a threshold, recursively sub-divides the spline section until the list of segments (polyline) matches the spline shape. | |
| bool | DivideSplineIntoPolylineRecursiveWithDistances
(
float StartDistanceAlongSpline, |
Given a threshold, recursively sub-divides the spline section until the list of segments (polyline) matches the spline shape. | |
| void | Draw
(
FPrimitiveDrawInterface* PDI, |
Helper function to draw a vector curve | |
| FVector | FindDirectionClosestToWorldLocation
(
const FVector& WorldLocation, |
Given a location, in world space, return a unit direction vector of the spline tangent closest to the location. | |
| float | FindInputKeyClosestToWorldLocation
(
const FVector& WorldLocation |
Given a location, in world space, return the input key closest to that location. | |
| FVector | FindLocationClosestToWorldLocation
(
const FVector& WorldLocation, |
Given a location, in world space, return the point on the curve that is closest to the location. | |
| FQuat | FindQuaternionClosestToWorldLocation
(
const FVector& WorldLocation, |
Given a location, in world space, return a quaternion corresponding to the spline's rotation closest to the location. | |
| FVector | FindRightVectorClosestToWorldLocation
(
const FVector& WorldLocation, |
Given a location, in world space, return a unit direction vector corresponding to the spline's right vector closest to the location. | |
| float | FindRollClosestToWorldLocation
(
const FVector& WorldLocation, |
Given a location, in world space, return the spline's roll closest to the location, in degrees. | |
| FRotator | FindRotationClosestToWorldLocation
(
const FVector& WorldLocation, |
Given a location, in world space, return rotation corresponding to the spline's rotation closest to the location. | |
| FVector | FindScaleClosestToWorldLocation
(
const FVector& WorldLocation |
Given a location, in world space, return the spline's scale closest to the location. | |
| FVector | FindTangentClosestToWorldLocation
(
const FVector& WorldLocation, |
Given a location, in world space, return the tangent vector of the spline closest to the location. | |
| FTransform | FindTransformClosestToWorldLocation
(
const FVector& WorldLocation, |
Given a location, in world space, return an FTransform closest to that location. | |
| FVector | FindUpVectorClosestToWorldLocation
(
const FVector& WorldLocation, |
Given a location, in world space, return a unit direction vector corresponding to the spline's up vector closest to the location. | |
| FVector | GetArriveTangentAtSplinePoint
(
int32 PointIndex, |
Get the arrive tangent at spline point | |
| FVector | GetDefaultUpVector
(
ESplineCoordinateSpace::Type CoordinateSpace |
Gets the default up vector used by this spline | |
| FVector | GetDirectionAtDistanceAlongSpline
(
float Distance, |
Given a distance along the length of this spline, return a unit direction vector of the spline tangent there. | |
| FVector | GetDirectionAtSplineInputKey
(
float InKey, |
Get unit direction along spline at the provided input key value | |
| FVector | GetDirectionAtSplinePoint
(
int32 PointIndex, |
Get the direction at spline point | |
| FVector | GetDirectionAtTime
(
float Time, |
Given a time from 0 to the spline duration, return a unit direction vector of the spline tangent there. | |
| float | GetDistanceAlongSplineAtLocation
(
const FVector& InLocation, |
Get distance along the spline at closest point of the provided input location | |
| float | GetDistanceAlongSplineAtSplineInputKey
(
float InKey |
Get distance along the spline at the provided input key value | |
| float | GetDistanceAlongSplineAtSplinePoint
(
int32 PointIndex |
Get the distance along the spline at the spline point | |
| TArray< ESplinePointType::Type > | Get the enabled Spline Point types for this spline component. | ||
| float | GetFloatPropertyAtSplineInputKey
(
float InKey, |
Get a metadata property float value along the spline at spline input key | |
| float | GetFloatPropertyAtSplinePoint
(
int32 Index, |
Get a metadata property float value along the spline at spline point | |
| float | GetInputKeyAtDistanceAlongSpline
(
float Distance |
Given a distance along the length of this spline, return the corresponding input key at that point This method has been deprecated because it was incorrectly returning the input key at time. | |
| float | GetInputKeyValueAtDistanceAlongSpline
(
float Distance |
Given a distance along the length of this spline, return the corresponding input key at that point with a fractional component between the current input key and the next as a percentage. | |
| float | GetInputKeyValueAtSplinePoint
(
int32 PointIndex |
Get the input key (e.g. the time) of the control point of the spline at the specified index. | |
| FVector | GetLeaveTangentAtSplinePoint
(
int32 PointIndex, |
Get the leave tangent at spline point | |
| void | GetLocalLocationAndTangentAtSplinePoint
(
int32 PointIndex, |
Get local location and tangent at a spline point | |
| void | GetLocationAndTangentAtSplinePoint
(
int32 PointIndex, |
Get location and tangent at a spline point | |
| FVector | GetLocationAtDistanceAlongSpline
(
float Distance, |
Given a distance along the length of this spline, return the point in space where this puts you | |
| FVector | GetLocationAtSplineInputKey
(
float InKey, |
Get location along spline at the provided input key value | |
| FVector | GetLocationAtSplinePoint
(
int32 PointIndex, |
Get the location at spline point | |
| FVector | GetLocationAtTime
(
float Time, |
Given a time from 0 to the spline duration, return the point in space where this puts you | |
| int32 | Get the number of points that make up this spline | ||
| int32 | Get the number of segments that make up this spline | ||
| FQuat | GetQuaternionAtDistanceAlongSpline
(
float Distance, |
Given a distance along the length of this spline, return a quaternion corresponding to the spline's rotation there. | |
| FQuat | GetQuaternionAtSplineInputKey
(
float InKey, |
Get quaternion corresponding to rotation along spline at the provided input key value | |
| FQuat | GetQuaternionAtSplinePoint
(
int32 PointIndex, |
Get the rotation at spline point as a quaternion | |
| FQuat | GetQuaternionAtTime
(
float Time, |
Given a time from 0 to the spline duration, return a quaternion corresponding to the spline's rotation there. | |
| FVector | GetRightVectorAtDistanceAlongSpline
(
float Distance, |
Given a distance along the length of this spline, return a unit direction vector corresponding to the spline's right vector there. | |
| FVector | GetRightVectorAtSplineInputKey
(
float InKey, |
Get right vector at the provided input key value | |
| FVector | GetRightVectorAtSplinePoint
(
int32 PointIndex, |
Get the right vector at spline point | |
| FVector | GetRightVectorAtTime
(
float Time, |
Given a time from 0 to the spline duration, return the spline's right vector there. | |
| float | GetRollAtDistanceAlongSpline
(
float Distance, |
Given a distance along the length of this spline, return the spline's roll there, in degrees. | |
| float | GetRollAtSplineInputKey
(
float InKey, |
Get roll in degrees at the provided input key value | |
| float | GetRollAtSplinePoint
(
int32 PointIndex, |
Get the amount of roll at spline point, in degrees | |
| float | GetRollAtTime
(
float Time, |
Given a time from 0 to the spline duration, return the spline's roll there, in degrees. | |
| FRotator | GetRotationAtDistanceAlongSpline
(
float Distance, |
Given a distance along the length of this spline, return a rotation corresponding to the spline's rotation there. | |
| FRotator | GetRotationAtSplineInputKey
(
float InKey, |
Get rotator corresponding to rotation along spline at the provided input key value | |
| FRotator | GetRotationAtSplinePoint
(
int32 PointIndex, |
Get the rotation at spline point as a rotator | |
| FRotator | GetRotationAtTime
(
float Time, |
Given a time from 0 to the spline duration, return a rotation corresponding to the spline's position and direction there. | |
| FVector | GetScaleAtDistanceAlongSpline
(
float Distance |
Given a distance along the length of this spline, return the spline's scale there. | |
| FVector | GetScaleAtSplineInputKey
(
float InKey |
Get scale at the provided input key value | |
| FVector | GetScaleAtSplinePoint
(
int32 PointIndex |
Get the scale at spline point | |
| FVector | GetScaleAtTime
(
float Time, |
Given a time from 0 to the spline duration, return the spline's scale there. | |
| float | Returns total length along this spline | ||
| FSplinePoint | GetSplinePointAt
(
int32 PointIndex, |
Gets the spline point of the spline at the specified index | |
| const USplineMetadata * | |||
| USplineMetadata * | |||
| const FInterpCurveVector & | |||
| FInterpCurveVector & | |||
| const FInterpCurveQuat & | |||
| FInterpCurveQuat & | |||
| FInterpCurveVector & | |||
| const FInterpCurveVector & | |||
| ESplinePointType::Type | GetSplinePointType
(
int32 PointIndex |
Get the type of a spline point | |
| FVector | GetTangentAtDistanceAlongSpline
(
float Distance, |
Given a distance along the length of this spline, return the tangent vector of the spline there. | |
| FVector | GetTangentAtSplineInputKey
(
float InKey, |
Get tangent along spline at the provided input key value | |
| FVector | GetTangentAtSplinePoint
(
int32 PointIndex, |
Get the tangent at spline point. This fetches the Leave tangent of the point. | |
| FVector | GetTangentAtTime
(
float Time, |
Given a time from 0 to the spline duration, return the spline's tangent there. | |
| float | GetTimeAtDistanceAlongSpline
(
float Distance |
Given a distance along the length of this spline, return the corresponding time at that point | |
| FTransform | GetTransformAtDistanceAlongSpline
(
float Distance, |
Given a distance along the length of this spline, return an FTransform corresponding to that point on the spline. | |
| FTransform | GetTransformAtSplineInputKey
(
float InKey, |
Get transform at the provided input key value | |
| FTransform | GetTransformAtSplinePoint
(
int32 PointIndex, |
Get the transform at spline point | |
| FTransform | GetTransformAtTime
(
float Time, |
Given a time from 0 to the spline duration, return the spline's transform at the corresponding position. | |
| FVector | GetUpVectorAtDistanceAlongSpline
(
float Distance, |
Given a distance along the length of this spline, return a unit direction vector corresponding to the spline's up vector there. | |
| FVector | GetUpVectorAtSplineInputKey
(
float InKey, |
Get up vector at the provided input key value | |
| FVector | GetUpVectorAtSplinePoint
(
int32 PointIndex, |
Get the up vector at spline point | |
| FVector | GetUpVectorAtTime
(
float Time, |
Given a time from 0 to the spline duration, return the spline's up vector there. | |
| FVector | GetVectorPropertyAtSplineInputKey
(
float InKey, |
Get a metadata property vector value along the spline at spline input key | |
| FVector | GetVectorPropertyAtSplinePoint
(
int32 Index, |
Get a metadata property vector value along the spline at spline point | |
| 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. | |
| FVector | GetWorldDirectionAtTime
(
float Time, |
Given a time from 0 to the spline duration, return a unit direction vector of the spline tangent there. | |
| FVector | GetWorldLocationAtDistanceAlongSpline
(
float Distance |
Given a distance along the length of this spline, return the point in world space where this puts you | |
| FVector | GetWorldLocationAtSplinePoint
(
int32 PointIndex |
Get the world location at spline point | |
| FVector | GetWorldLocationAtTime
(
float Time, |
Given a time from 0 to the spline duration, return the point in space where this puts you | |
| 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. | |
| FRotator | GetWorldRotationAtTime
(
float Time, |
Given a time from 0 to the spline duration, return a rotation corresponding to the spline's position and direction there, in world space. | |
| FVector | GetWorldTangentAtDistanceAlongSpline
(
float Distance |
Given a distance along the length of this spline, return the tangent vector of the spline there, in world space. | |
| bool | IsClosedLoop () |
Check whether the spline is a closed loop or not | |
| void | RemoveSplinePoint
(
int32 Index, |
Removes point at specified index from the spline | |
| void | Reset the spline to its default shape (a spline of two points) | ||
| void | SetClosedLoop
(
bool bInClosedLoop, |
Specify whether the spline is a closed loop or not. | |
| void | SetClosedLoopAtPosition
(
bool bInClosedLoop, |
Specify whether the spline is a closed loop or not, and if so, the input key corresponding to the loop point | |
| void | SetDefaultUpVector
(
const FVector& UpVector, |
Sets the default up vector used by this spline | |
| void | SetDrawDebug
(
bool bShow |
Specify whether this spline should be rendered when the Editor/Game spline show flag is set | |
| void | SetLocationAtSplinePoint
(
int32 PointIndex, |
Move an existing point to a new location | |
| void | SetRotationAtSplinePoint
(
int32 PointIndex, |
Set the rotation of an existing spline point | |
| void | SetScaleAtSplinePoint
(
int32 PointIndex, |
Set the scale at a given spline point | |
| void | SetSelectedSplineSegmentColor
(
const FLinearColor& SegmentColor |
Specify selected spline component segment color in the editor | |
| void | SetSplineLocalPoints
(
const TArray< FVector >& Points |
Sets the spline to an array of local space points | |
| void | SetSplinePoints
(
const TArray< FVector >& Points, |
Sets the spline to an array of points | |
| void | SetSplinePointType
(
int32 PointIndex, |
Specify the type of a spline point | |
| void | SetSplineWorldPoints
(
const TArray< FVector >& Points |
Sets the spline to an array of world space points | |
| void | SetTangentAtSplinePoint
(
int32 PointIndex, |
Specify the tangent at a given spline point | |
| void | SetTangentColor
(
const FLinearColor& TangentColor |
Specify selected spline component segment color in the editor | |
| void | SetTangentsAtSplinePoint
(
int32 PointIndex, |
Specify the tangents at a given spline point | |
| void | SetUnselectedSplineSegmentColor
(
const FLinearColor& SegmentColor |
Specify unselected spline component segment color in the editor | |
| void | SetUpVectorAtSplinePoint
(
int32 PointIndex, |
Specify the up vector at a given spline point | |
| void | SetWorldLocationAtSplinePoint
(
int32 PointIndex, |
Move an existing point to a new world location | |
| void | UpdateSpline () |
Update the spline tangents and SplineReparamTable |
Overridden from UPrimitiveComponent
| Type | Name | Description | |
|---|---|---|---|
| FPrimitiveSceneProxy * | Creates a proxy to represent the primitive to the scene manager in the rendering thread. | ||
| bool | Whether or not the bounds of this component should be considered when focusing the editor camera to an actor with this component in it. | ||
| void | Pushes new selection state to the render thread primitive proxy |
Overridden from USceneComponent
| Type | Name | Description | |
|---|---|---|---|
| FBoxSphereBounds | CalcBounds
(
const FTransform& LocalToWorld |
Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size. |
Overridden from UActorComponent
| Type | Name | Description | |
|---|---|---|---|
| TStructOnScope< FActorComponentInstanceData > | Called before we throw away components during RerunConstructionScripts, to cache any data we wish to persist across that operation |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | GetLifetimeReplicatedProps
(
TArray< FLifetimeProperty >& OutLifetimeProps |
Returns properties that are replicated for the lifetime of the actor channel | |
| void | PostEditChangeChainProperty
(
FPropertyChangedChainEvent& PropertyChangedEvent |
This alternate version of PostEditChange is called when properties inside structs are modified. | |
| void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | |
| void | Handles reading, writing, and reference collecting using FArchive. |
Typedefs
| Name | Description |
|---|---|
| DeselectedInEditorDelegate | Delegate that's called when this component is deselected in the editor |
Constants
| Name | Description |
|---|---|
| DummyPointPosition | The dummy value used for queries when there are no point in a spline |
| DummyPointRotation | |
| DummyPointScale |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bAllowSplineEditingPerInstance_DEPRECATED | ||
| FInterpCurveVector | SplineInfo_DEPRECATED | Deprecated - please use GetSplinePointsPosition() to fetch this FInterpCurve | |
| FInterpCurveFloat | SplineReparamTable_DEPRECATED | ||
| FInterpCurveQuat | SplineRotInfo_DEPRECATED | Deprecated - please use GetSplinePointsRotation() to fetch this FInterpCurve | |
| FInterpCurveVector | SplineScaleInfo_DEPRECATED | Deprecated - please use GetSplinePointsScale() to fetch this FInterpCurve |
See Also
https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/Blueprint_Splines