Version:

Spline Component

The Spline component creates a line that is 8 meters long, with 4 points. The point positions are defined in the local space of the entity. The spline’s length, segments, and shape can be defined using the component’s Spline Type property and Edit functionality. Splines are curves that connect two or more points and can be used as paths for animated entities or as a backbone for components such as the Tube Shape component.

Provider

O3DE Core (LmbrCentral) Gem

Spline properties

Linear Spline

PropertyDescriptionValuesDefault
VisibleEnable to always display the spline in the viewport, even when the entity is not selected. Disable to hide the spline when the entity is not selected.BooleanEnabled
Configuration - Spline TypeThe interpolation type that defines the spline’s segments. Linear splines have straight segments. Bezier splines interpolate a curve with uniform steps through the spline’s segments. Catmull-Rom splines are defined by control points. A Catmull-Rom spline needs four control points to define each segment, so the default spline with four points will only generate one segment.Linear, Bezier, Catmull-RomLinear
SplineThe Spline property group options for the selected Spline Type.
ClosedEnable to close the spline and create a loop.BooleanDisabled
EditChoose the Edit button to enter Edit mode. In Edit mode, you can modify the length, segments and shape of the spline in the viewport using the methods outlined in Edit mode actions below. While in Edit mode, the Edit menu in the menu bar displays available actions and hotkeys. To exit Edit mode, choose Done in the component interface.

Bezier Spline

PropertyDescriptionValuesDefault
VisibleEnable to always display the spline in the viewport, even when the entity is not selected. Disable to hide the spline when the entity is not selected.BooleanEnabled
Configuration - Spline TypeThe interpolation type that defines the spline’s segments. Linear splines have straight segments. Bezier splines interpolate a curve with uniform steps through the spline’s segments. Catmull-Rom splines are defined by control points. A Catmull-Rom spline needs four control points to define each segment, so the default spline with four points will only generate one segment.Linear, Bezier, Catmull-RomLinear
SplineThe Spline property group options for the selected Spline Type.
ClosedEnable to close the spline and create a loop.BooleanDisabled
GranularityThe number of interpolation steps in each spline segment. The higher the Granularity value, the smoother the curve segment.2 - 648
EditChoose the Edit button to enter Edit mode. In Edit mode, you can modify the length, segments and shape of the spline in the viewport using the methods outlined in Edit mode actions below. While in Edit mode, the Edit menu in the menu bar displays available actions and hotkeys. To exit Edit mode, choose Done in the component interface.

Catmull-Rom Spline

PropertyDescriptionValuesDefault
VisibleEnable to always display the spline in the viewport, even when the entity is not selected. Disable to hide the spline when the entity is not selected.BooleanEnabled
Configuration - Spline TypeThe interpolation type that defines the spline’s segments. Linear splines have straight segments. Bezier splines interpolate a curve with uniform steps through the spline’s segments. Catmull-Rom splines are defined by control points. A Catmull-Rom spline needs four control points to define each segment, so the default spline with four points will only generate one segment.Linear, Bezier, Catmull-RomLinear
SplineThe Spline property group options for the selected Spline Type.
ClosedEnable to close the spline and create a loop.BooleanDisabled
Knot ParameterizationSpecifies how the spline is interpolated between control points. Smaller values sharpen the interpolation around control points and higher values ease the interpolation around control points.0 - 10.0
GranularityThe number of interpolation steps in each spline segment. The higher the Granularity value, the smoother the curve segment.2 - 648
EditChoose the Edit button to enter Edit mode. In Edit mode, you can modify the length, segments and shape of the spline in the viewport using the methods outlined in Edit mode actions below. While in Edit mode, the Edit menu in the menu bar displays available actions and hotkeys. To exit Edit mode, choose Done in the component interface.

Edit mode actions

  • Select a point - Left-click any point.
  • Add to selection - Hold Ctrl and Left-click an unselected point.
  • Remove from selection - Hold Ctrl and Left-click a selected point.
  • Select multiple - Left-click and drag over multiple points.
  • Move point(s) - With point(s) selected, Left-click and drag the transform manipulator.
  • Add a point - Hold Ctrl and Left-click on a segment between existing points.
  • Delete a point - Hold Alt and Left-click on a point.
  • Delete selected points - Press Delete to delete all selected points.
  • Snap points to position - Hold Ctrl + Shift and Left-click in the viewport to snap the selected points to the position.
  • Snap points to grid - If the Enable Grid Snapping is set to true in viewport options, points will snap to positions on the construction plane.

SplineComponentRequestBus

Use the following request functions with the SplineComponentRequestBus EBus interface to communicate with Spline components in your game. The Spline component also uses VertexContainer functions. See Vertex Container for more information.

Request NameDescriptionParameterReturnScriptable
GetSplineReturns a constant pointer to the underlying spline type. You can use this function to query the spline against raycasts and positions. You can also request information, such as the length of the spline, its position, normal, and tangent at various points along the spline.NoneSpline: AZ::ConstSplinePtrNo
ChangeSplineTypeChanges the type of the spline to Linear, Bezier, or Catmull-Rom.Spline Type: AZ::u64 containing RTTI hash of the Spline Type.NoneNo
SetClosedSpecify True to connect the end points of the spline and create a closed loop. Specify False to disconnect the end points of the spline and create an open curve.SetClosed: BooleanNoneNo

SplineComponentNotificationBus

Request NameDescriptionParameterReturnScriptable
OnSplineChangedNotifies listeners that the spline has been updated.NoneNoneYes