#jira UE-11822 - Add up vector, roll and scale properties to USplineComponent which can be used when calculating rotations/transforms at a point on the spline
#jira UE-13333 - BP spline components do not update when setting points
#jira UE-3637 - SplineComponent: Add a get transform at distance accessor
Summary of changes:
- FInterpCurve now natively understands looping. A input key can be set, at which point the spline will loop back to its start point. Adjusted FInterpCurve methods to take looped curves into account.
- Fixed bugs in FInterpCurve regarding returning default values (T(ForceInit) instead of T() otherwise FVectors and FQuats are not initialized correctly).
- SplineComponent now holds three separate splines (location, rotation and scale).
- The SplineReparamTable is no longer transient, but is built and saved as part of the asset.
- Changed the SplineComponent API. All methods now take a ESplineCoordinateSpace value which specifies whether the values are intended for use in local or world space. The old methods have been deprecated but not removed (for now).
- bAllowSplineEditingPerInstance is deprecated. A new member (bSplineHasBeenEdited) has superseded it, and is set automatically when editing the spline with the visualizer. Added "Reset to Default" option in the visualizer, which restores the archetype defaults.
- SplineComponentVisualizer determines if spline points have been initialized by the user construction script, and, if so, will disallow editing. This is to conform with the general idea that the UCS always overrides property values.
- Fixed a number of bugs in the visualizer, and added new facilities to allow the scale and rotation to be edited (still work-in-progress).
[CL 2524087 by Richard TalbotWatkin in Main branch]
#ttp 338259 - SplineComponent: Add an option flag to close the spline
#branch UE4
#proj Editor.ComponentVisualizers, Runtime.Engine
[CL 2315996 by Richard TalbotWatkin in Main branch]
#ttp 341724 - FEATURE REQUEST: PAPER2D: Add or insert a key into a terrain spline
#ttp 341720 - FEATURE REQUEST: PAPER2D: Rename Key on terrain splines
#ttp 341378 - Spline Component/Meshs: Controls points only editable in worldspace. no localpace transformation
#reviewedby James.Golding
[CL 2228433 by Richard TalbotWatkin in Main branch]
- Changed USplineComponent::SplineReparamTable to a transient member and force rebuild each time in PostLoad() / PostDuplicate().
- Initialize the SplineReparamTable size at the start to save needless reallocations (as its size is known from the beginning).
- Added menu options to set spline key types (curve, linear, constant)
- Added Reset to Automatic Tangent to allow resetting to either a clamped or an unclamped tangent.
#branch UE4
#proj Runtime.Engine, Editor.ComponentVisualizers
#reviewedby James.Golding, Michael.Noland
[CL 2119717 by Richard TalbotWatkin in Main branch]
#add Added a new FUICommandList::ProcessCommandBindings overload, which can be called from a Viewport Client's InputKey() method (in the absence of an FKeyboardEvent object).
#add Fixed key binding handling in SplineComponentVisualizer so that it works through the FUICommandList, instead of being hardcoded.
#change USplineComponent - changed method by which spline reparam table is created (now uses the old method of splitting each segment into a fixed number of steps, instead of using fixed arc length reparameterization, which doesn't lead to such good results where the distance between control points varies largely throughout the spline). The ReparamStepsPerSegment parameter remains, although I'd like to remove it when I can hit upon a better way to adaptively step through the spline. Merged UpdateSplineReparamTable and AutoSetTangents into a single UpdateSpline method.
#add Added a parameter to FInterpCurve::AutoSetTangents - bStationaryEndpoints - which determines whether the endpoints should be assigned zero tangents, or whether the tangents should be set in order to extrapolate the curve beyond the endpoints, essentially providing a constant velocity at the start/end.
#add Added bStationaryEndpoints as an editable parameter to USplineComponent. Use this if you only wish to traverse the spline at constant velocity, as it will lead to more accurate results.
#codereview James.Golding, Michael.Noland
[CL 2112073 by Richard TalbotWatkin in Main branch]
Breaking changes include:
* Rename of GEditorModeTools -> GLevelEditorModeTools to signify that it applies only to the level editor modes
* Addition of FEditorModeRegistry, responsible for managing and creating new editor modes. Modes are no longer registered with an instance of the mode, instead with a mode factory that is able to create a new mode of that type.
* Editor modes now operate on FEditorViewportClients rather than FLevelEditorViewportClients
* Added ability to specify an FEditorModeTools when creating an FEditorViewport
Moved component vizualiser manager handling outside of individual editor modes, and into FLevelEditorViewportClient. This should make it easier to transplant in future.
This work addresses TTP#334640 - EDITOR: Investigate making editor modes a per-'editor' concept
Reviewed by Michael Noland, Matt Kuhlenschmidt
[CL 2109245 by Andrew Rodham in Main branch]
#branch UE4
#proj Editor.ComponentVisualizers, Editor.UnrealEd, Runtime.Core, Runtime.Engine
#change FInterpCurve now uses a binary search to obtain the correct key. Removed the optional out-parameter on Eval, EvalDerivative, etc. Removed FORCEINLINEs on large methods.
#change USplineComponent now builds the remap table with points spaced at equal distances, which leads to better results. Added internal methods to obtain the segment length, and the interpolation parameter along the segment at a given distance.
#add Added Duration to USplineComponent.
#add Added a number of different methods for obtaining position, tangent and rotation at a specified distance, or a specified time (optionally at constant velocity).
#add Added methods for building the spline procedurally.
#add Supports right-click context menu on ComponentVisualizers in the standard interface.
#add Key tangents can be manually edited.
#change FLevelEditorViewportClient::ProcessClick now handles right clicks to the Unreal gizmo in the same manner as left clicks, i.e. the method recurses using a version of the hit proxy with the gizmo removed, so we can look at what's underneath. This allows for "genuine" context menus, i.e. depending on what was clicked, instead of using a single default provided by the current level editor.
#reviewedby James.Golding
[CL 2089561 by Richard TalbotWatkin in Main branch]
Remove ComponentInstanceDataCache.h from ActorComponent.h
Remove SplineComponent.h from Engine.h
Change splinecomp funcs to get get location/direction at point on spline to be world space (and normalized direction vector)
Update reparam table when editing spline
#codereview marc.audy
[CL 2077607 by James Golding in Main branch]
Simplified SplineComponent, now a SceneComponent not a PrimitiveComponent
Added support for persisting SplineComp state across CS re-run
SplineComponentVisualizer editing started
[CL 2075479 by James Golding in Main branch]
#proj core
#branch UE4
#summary Removed header groups, removed some redundant includes and replaced with forward declarations. Fixed compilation errors.
[CL 2055361 by Mikolaj Sieluzycki in Main branch]
#proj core
#branch UE4
#summary Removed header groups, removed some redundant includes and replaced with forward declarations. Fixed compilation errors.
[CL 2054304 by Mikolaj Sieluzycki in Main branch]