class

FSplineMath

Sampling for SplineComponent points. Everything is in the points' own space (the actor's local space) and addressed by input key: key k lies on the segment from point floor(k) to the next, so 0 is the first point and SegmentCount the last (or the first again, on a closed loop). A curved segment is uniform Catmull-Rom through its neighbours, which passes through every point; a point marked linear makes the segment leaving it straight.

Module
Components
Header
#include "Components/SplineMath.h"
Namespace
Mowo

Public functions

ReturnsNameDescription
int32_tSegmentCount
Vec3PositionAtKey
Vec3DirectionAtKeyUnit direction of travel at the key; +Z for a spline with no length.
floatRollAtKey
Vec2ScaleAtKey
floatLengthArc length by summing chords, subdivisions per segment.
floatKeyAtDistanceThe key distance metres along the curve, clamped to its ends.
floatClosestKeyThe key of the curve point nearest position: a coarse scan, then a refinement inside the best step.

Function details

SegmentCount

C++
static int32_t SegmentCount(const std::vector<FSplinePoint>& points, bool closed)

PositionAtKey

C++
static Vec3 PositionAtKey(const std::vector<FSplinePoint>& points, bool closed, float key)

DirectionAtKey

C++
static Vec3 DirectionAtKey(const std::vector<FSplinePoint>& points, bool closed, float key)

Unit direction of travel at the key; +Z for a spline with no length.

RollAtKey

C++
static float RollAtKey(const std::vector<FSplinePoint>& points, bool closed, float key)

ScaleAtKey

C++
static Vec2 ScaleAtKey(const std::vector<FSplinePoint>& points, bool closed, float key)

Length

C++
static float Length(const std::vector<FSplinePoint>& points, bool closed, int32_t subdivisions = 16)

Arc length by summing chords, subdivisions per segment.

KeyAtDistance

C++
static float KeyAtDistance(const std::vector<FSplinePoint>& points, bool closed, float distance, int32_t subdivisions = 16)

The key distance metres along the curve, clamped to its ends. The constant-speed walk a mover or a mesh-along-spline wants.

ClosestKey

C++
static float ClosestKey(const std::vector<FSplinePoint>& points, bool closed, const Vec3& position, int32_t subdivisions = 16)

The key of the curve point nearest position: a coarse scan, then a refinement inside the best step.

Generated from Components/SplineMath.h via components.json · Oct 26, 2026Version 1.0.0