Navigation
API > API/Editor > API/Editor/CurveEditor
Given keys that are between an imaginary, x-axis aligned mirror edge and dragged edge, this class facilitates recalculates the tangents for all specified keys. The tangents are linearly interpolated, ensuring that if the dragged edge crosses to the opposite side of the mirror edge, the tangents will flip, resulting in mirrored curves.
Inputs:
- Height of the dragged edge aligned to the x-axis
- Height of the x-axis-aligned mirror edge
- Keys originally located between the dragged and mirror edges
Example: Given a grid with a single key at a 45-degree angle, moving the top edge:
- An equal distance past the bottom edge will result in a tangent of -45 degrees for the key.
- Halfway between the starting position and the bottom edge will result in a tangent of 22.5 degrees for the key.
This class only recalculates tangents. To adjust the positions of the keys use e.g. FPositionMirrorSolver.
| Name | FTangentMirrorSolver |
| Type | class |
| Header File | /Engine/Source/Editor/CurveEditor/Public/Misc/Mirror/TangentMirrorSolver.h |
| Include Path | #include "Misc/Mirror/TangentMirrorSolver.h" |
Syntax
class FTangentMirrorSolver
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTangentMirrorSolver
(
double InStartY, |
InStartY and InMiddlePointY define two imaginary, x-axis aligned lines. | Misc/Mirror/TangentMirrorSolver.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CurveData | TMap< FCurveModelID, FCurveTangentMirrorData > | This memory is reused across OnMoveEdge to hold the updated tangents. | Misc/Mirror/TangentMirrorSolver.h | |
| MiddlePointY | const double | Height of the mirroring line. | Misc/Mirror/TangentMirrorSolver.h | |
| StartY | const double | Height of the dragged line. | Misc/Mirror/TangentMirrorSolver.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool AddTangents
(
const FCurveEditor& InCurveEditor, |
Adds tangents that are be mirrored. | Misc/Mirror/TangentMirrorSolver.h | |
bool AddTangents
(
const FCurveEditor& InCurveEditor, |
Version that allows you to do additional processing for the tangents. | Misc/Mirror/TangentMirrorSolver.h | |
void OnMoveEdge
(
const FCurveEditor& InCurveEditor, |
Recomputes the tangents angles and updates the key attributes. | Misc/Mirror/TangentMirrorSolver.h |