TrackFlow Pro Documentation 1
Generate roller coasters, railroads, conveyors and more with a physics aware spline and meshing system.
Loading...
Searching...
No Matches
TrackFlowPro.Editor.TrackFlowSplineEditor Class Reference

Custom editor for the TrackFlowSpline object, the goal here is for this to work similarly to the spline editor, where you can edit the track properties in the inspector as well as using handles in the scene view. More...

Classes

class  ControlPointAccordionRow
class  KnotListRow

Public Member Functions

override VisualElement CreateInspectorGUI ()

Static Public Member Functions

static VisualElement BuildTrackModifierOptionMenu (SerializedProperty trackModOptsProp)
 This ensures roll option menus are generated the same between TrackFlowKnot and the TrackFlowSpline in spline mode.
static void DrawDefaultFrameIndicators (ChordErrorSampler.Polyline poly, int maxTotalIndicators=300, float maxIndicatorsPerMeter=1f)
static void DrawFrameIndicator (Vector3 position, Quaternion rotation, Bounds bounds)

Private Member Functions

bool IsDrivenRollDragFor (TrackFlowSpline spline, int knotIndex)
void BeginDrivenRollDrag (TrackFlowSpline spline, int knotIndex, float committedDegrees, Vector3 tangentWS, Vector3 normalWS, Vector3 binormalWS)
void CancelDrivenRollDrag ()
void CommitDrivenRollDrag (TrackFlowSpline spline)
void OnEnable ()
void OnDisable ()
void OnSceneGUI ()
VisualElement CreateControlPointsField ()
VisualElement CreateSplineSettingsField (out PropertyField useSplineField)
VisualElement CreateMainSettingsField ()
void ShowBezierKnotContextMenu (TrackFlowSpline spline, int knotIndex)

Static Private Member Functions

static GUIStyle GetKnotLabelStyle (TrackFlowEditorPreferences prefs)
static float ApplyRotationSnap (float rawAngleDeg, float snapRotDeg, bool incrementalSnap, bool gridSnap)
static void CollapseAllControlPointProperties (SerializedProperty cpsProp)
static void ClampAnimationCurve (AnimationCurve curve)
 Clamp keys and values to be within [0, 1].

Private Attributes

readonly List< int > _controlPointIndexSource = new()
HashSet< int > _selectedKnotIndices = new()
bool _drivenRollDragActive
TrackFlowSpline _drivenRollSpline
int _drivenRollKnot = -1
Vector3 _drivenRollStartT
Vector3 _drivenRollStartN
Vector3 _drivenRollStartB
float _drivenRollStartDegrees
float _drivenRollPreviewDegrees
bool _drivenRollChanged
float _drivenRollAccumulatedDeltaDegrees
Vector3 _drivenRollLastB
Tool lastTool = Tool.None

Static Private Attributes

static GUIStyle s_KnotLabelStyle
static Color s_LastKnotLabelColor

Detailed Description

Custom editor for the TrackFlowSpline object, the goal here is for this to work similarly to the spline editor, where you can edit the track properties in the inspector as well as using handles in the scene view.

Member Function Documentation

◆ ApplyRotationSnap()

float TrackFlowPro.Editor.TrackFlowSplineEditor.ApplyRotationSnap ( float rawAngleDeg,
float snapRotDeg,
bool incrementalSnap,
bool gridSnap )
staticprivate

◆ BeginDrivenRollDrag()

void TrackFlowPro.Editor.TrackFlowSplineEditor.BeginDrivenRollDrag ( TrackFlowSpline spline,
int knotIndex,
float committedDegrees,
Vector3 tangentWS,
Vector3 normalWS,
Vector3 binormalWS )
private

◆ BuildTrackModifierOptionMenu()

VisualElement TrackFlowPro.Editor.TrackFlowSplineEditor.BuildTrackModifierOptionMenu ( SerializedProperty trackModOptsProp)
static

This ensures roll option menus are generated the same between TrackFlowKnot and the TrackFlowSpline in spline mode.

Parameters
trackModOptsProp
showTrackModifierOptions
Returns

◆ CancelDrivenRollDrag()

void TrackFlowPro.Editor.TrackFlowSplineEditor.CancelDrivenRollDrag ( )
private

◆ ClampAnimationCurve()

void TrackFlowPro.Editor.TrackFlowSplineEditor.ClampAnimationCurve ( AnimationCurve curve)
staticprivate

Clamp keys and values to be within [0, 1].

Parameters
curve

◆ CollapseAllControlPointProperties()

void TrackFlowPro.Editor.TrackFlowSplineEditor.CollapseAllControlPointProperties ( SerializedProperty cpsProp)
staticprivate

◆ CommitDrivenRollDrag()

void TrackFlowPro.Editor.TrackFlowSplineEditor.CommitDrivenRollDrag ( TrackFlowSpline spline)
private

◆ CreateControlPointsField()

VisualElement TrackFlowPro.Editor.TrackFlowSplineEditor.CreateControlPointsField ( )
private

◆ CreateInspectorGUI()

override VisualElement TrackFlowPro.Editor.TrackFlowSplineEditor.CreateInspectorGUI ( )

◆ CreateMainSettingsField()

VisualElement TrackFlowPro.Editor.TrackFlowSplineEditor.CreateMainSettingsField ( )
private

presets buttons

◆ CreateSplineSettingsField()

VisualElement TrackFlowPro.Editor.TrackFlowSplineEditor.CreateSplineSettingsField ( out PropertyField useSplineField)
private

◆ DrawDefaultFrameIndicators()

void TrackFlowPro.Editor.TrackFlowSplineEditor.DrawDefaultFrameIndicators ( ChordErrorSampler.Polyline poly,
int maxTotalIndicators = 300,
float maxIndicatorsPerMeter = 1f )
static

◆ DrawFrameIndicator()

void TrackFlowPro.Editor.TrackFlowSplineEditor.DrawFrameIndicator ( Vector3 position,
Quaternion rotation,
Bounds bounds )
static

◆ GetKnotLabelStyle()

GUIStyle TrackFlowPro.Editor.TrackFlowSplineEditor.GetKnotLabelStyle ( TrackFlowEditorPreferences prefs)
staticprivate

◆ IsDrivenRollDragFor()

bool TrackFlowPro.Editor.TrackFlowSplineEditor.IsDrivenRollDragFor ( TrackFlowSpline spline,
int knotIndex )
private

◆ OnDisable()

void TrackFlowPro.Editor.TrackFlowSplineEditor.OnDisable ( )
private

◆ OnEnable()

void TrackFlowPro.Editor.TrackFlowSplineEditor.OnEnable ( )
private

◆ OnSceneGUI()

void TrackFlowPro.Editor.TrackFlowSplineEditor.OnSceneGUI ( )
private

◆ ShowBezierKnotContextMenu()

void TrackFlowPro.Editor.TrackFlowSplineEditor.ShowBezierKnotContextMenu ( TrackFlowSpline spline,
int knotIndex )
private

Member Data Documentation

◆ _controlPointIndexSource

readonly List<int> TrackFlowPro.Editor.TrackFlowSplineEditor._controlPointIndexSource = new()
private

◆ _drivenRollAccumulatedDeltaDegrees

float TrackFlowPro.Editor.TrackFlowSplineEditor._drivenRollAccumulatedDeltaDegrees
private

◆ _drivenRollChanged

bool TrackFlowPro.Editor.TrackFlowSplineEditor._drivenRollChanged
private

◆ _drivenRollDragActive

bool TrackFlowPro.Editor.TrackFlowSplineEditor._drivenRollDragActive
private

◆ _drivenRollKnot

int TrackFlowPro.Editor.TrackFlowSplineEditor._drivenRollKnot = -1
private

◆ _drivenRollLastB

Vector3 TrackFlowPro.Editor.TrackFlowSplineEditor._drivenRollLastB
private

◆ _drivenRollPreviewDegrees

float TrackFlowPro.Editor.TrackFlowSplineEditor._drivenRollPreviewDegrees
private

◆ _drivenRollSpline

TrackFlowSpline TrackFlowPro.Editor.TrackFlowSplineEditor._drivenRollSpline
private

◆ _drivenRollStartB

Vector3 TrackFlowPro.Editor.TrackFlowSplineEditor._drivenRollStartB
private

◆ _drivenRollStartDegrees

float TrackFlowPro.Editor.TrackFlowSplineEditor._drivenRollStartDegrees
private

◆ _drivenRollStartN

Vector3 TrackFlowPro.Editor.TrackFlowSplineEditor._drivenRollStartN
private

◆ _drivenRollStartT

Vector3 TrackFlowPro.Editor.TrackFlowSplineEditor._drivenRollStartT
private

◆ _selectedKnotIndices

HashSet<int> TrackFlowPro.Editor.TrackFlowSplineEditor._selectedKnotIndices = new()
private

◆ lastTool

Tool TrackFlowPro.Editor.TrackFlowSplineEditor.lastTool = Tool.None
private

◆ s_KnotLabelStyle

GUIStyle TrackFlowPro.Editor.TrackFlowSplineEditor.s_KnotLabelStyle
staticprivate

◆ s_LastKnotLabelColor

Color TrackFlowPro.Editor.TrackFlowSplineEditor.s_LastKnotLabelColor
staticprivate

The documentation for this class was generated from the following file: