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.TrackFlowPlaceKnotTool Class Referencesealed

An editor tool that can place knots in the world similar to the default Unity Spline, but it can also snap to TrackFlowKnot, or positions along any sampled TrackFlowSpline. You can use this tool to insert knots in an existing spline. More...

Classes

struct  DragState
struct  HoverCache

Public Member Functions

override void OnActivated ()
override void OnWillBeDeactivated ()
override void OnToolGUI (EditorWindow window)

Properties

override GUIContent toolbarIcon [get]

Private Member Functions

void LoadIcon ()

Static Private Member Functions

static void QueueUnitySelection (GameObject go)
static void FlushUnitySelectionAndKeepTool ()
static void MarkCacheDirty ()
static void InvalidateHoverCache ()
static void SelectExistingKnot (SnapResult snap, bool ctrlToggle)
static int GetSplitSegmentStartKnotIndex (TrackFlowSpline spline, int insertIndex)
static void PlaceNewKnot (SceneView sv, Event evt, SnapResult snap)
static TrackFlowSpline CreateNewSplineAt (Vector3 worldPos)
static int ComputeInsertIndexFromSample (TrackFlowSpline spline, int sampleIndex)
static float ComputeInitialHandleLengthWorld (TrackFlowSpline spline, int insertIndex, Vector3 newWorldPos)
static Vector3 GuessTangentWorld (TrackFlowSpline spline, int insertIndex, Vector3 newWorldPos)
static bool TryInsertBezierKnotPreserveShape (TrackFlowSpline spline, int insertIndex, Vector3 desiredWorld, Vector3 binormalHintWorld, out int insertedIndex, out Vector3 insertedWorldPos, out float handleLenWorld)
static float ClosestParamOnCubicBezier (in Vector3 P0, in Vector3 P1, in Vector3 P2, in Vector3 P3, in Vector3 Q)
static bool IsMouseInsideSceneView (SceneView sv, Vector2 mousePos)
static bool IsFinite (Vector3 v)
static Vector3 CubicBezier (in Vector3 P0, in Vector3 P1, in Vector3 P2, in Vector3 P3, float t)
static Vector3 CubicBezierDeriv (in Vector3 P0, in Vector3 P1, in Vector3 P2, in Vector3 P3, float t)
static Vector3 CubicBezierSecondDeriv (in Vector3 P0, in Vector3 P1, in Vector3 P2, in Vector3 P3, float t)
static void HandleDrag (SceneView sv, Event evt, Ray ray)
static Vector3 GetMouseWorldOnViewPlane (SceneView sv, Ray ray, Vector3 throughPoint)
static bool ShouldRefreshHoverCache (SceneView sv, Event evt)
static void RefreshHoverCache (SceneView sv, Vector2 mousePosition)
static TrackFlowSpline GetActiveSplineSafe ()
static TrackFlowSpline[] GetAllSplinesCached ()
static bool TryComputePlacement (SceneView sv, Ray ray, Vector2 mouseGui, out SnapResult snap)
static bool TrySnapToBestKnotOnOtherSplines (Ray ray, TrackFlowSpline skip, out SnapResult snap)
static bool TrySnapToBestSegmentOnOtherSplines (Vector2 mouseGui, TrackFlowSpline skip, out SnapResult snap)
static bool TrySnapToSegment (Vector2 mouseGui, TrackFlowSpline spline, bool isActive, out SnapResult snap)
static void DrawPreview (SceneView sv, SnapResult snap)

Private Attributes

GUIContent _icon
Texture2D icon

Static Private Attributes

static bool s_AllowSegmentSnapToOtherSplines = true
static float s_SegmentSnapPixelRadius = TrackFlowScreenPickUtil.DefaultPixelRadius
static bool s_SnapToColliders = true
static bool s_SnapToKnots = true
static bool s_SnapToSegments = true
static bool s_UseSurfaceNormalAsBinormal = true
static bool s_RebuildOnMouseUp = true
static float s_MaxRayDistance = 10000f
static LayerMask s_RaycastMask = ~0
static bool s_FallbackToViewPlane = true
static TrackFlowSpline[] s_SplineCache
static double s_LastScanTime
static bool s_CacheDirty = true
static DragState s_Drag
static HoverCache s_Hover
static GameObject s_PendingUnitySelectionGO
static bool s_ReassertToolAfterSelection

Detailed Description

An editor tool that can place knots in the world similar to the default Unity Spline, but it can also snap to TrackFlowKnot, or positions along any sampled TrackFlowSpline. You can use this tool to insert knots in an existing spline.

Member Function Documentation

◆ ClosestParamOnCubicBezier()

float TrackFlowPro.Editor.TrackFlowPlaceKnotTool.ClosestParamOnCubicBezier ( in Vector3 P0,
in Vector3 P1,
in Vector3 P2,
in Vector3 P3,
in Vector3 Q )
staticprivate

◆ ComputeInitialHandleLengthWorld()

float TrackFlowPro.Editor.TrackFlowPlaceKnotTool.ComputeInitialHandleLengthWorld ( TrackFlowSpline spline,
int insertIndex,
Vector3 newWorldPos )
staticprivate

◆ ComputeInsertIndexFromSample()

int TrackFlowPro.Editor.TrackFlowPlaceKnotTool.ComputeInsertIndexFromSample ( TrackFlowSpline spline,
int sampleIndex )
staticprivate

◆ CreateNewSplineAt()

TrackFlowSpline TrackFlowPro.Editor.TrackFlowPlaceKnotTool.CreateNewSplineAt ( Vector3 worldPos)
staticprivate

◆ CubicBezier()

Vector3 TrackFlowPro.Editor.TrackFlowPlaceKnotTool.CubicBezier ( in Vector3 P0,
in Vector3 P1,
in Vector3 P2,
in Vector3 P3,
float t )
staticprivate

◆ CubicBezierDeriv()

Vector3 TrackFlowPro.Editor.TrackFlowPlaceKnotTool.CubicBezierDeriv ( in Vector3 P0,
in Vector3 P1,
in Vector3 P2,
in Vector3 P3,
float t )
staticprivate

◆ CubicBezierSecondDeriv()

Vector3 TrackFlowPro.Editor.TrackFlowPlaceKnotTool.CubicBezierSecondDeriv ( in Vector3 P0,
in Vector3 P1,
in Vector3 P2,
in Vector3 P3,
float t )
staticprivate

◆ DrawPreview()

void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.DrawPreview ( SceneView sv,
SnapResult snap )
staticprivate

◆ FlushUnitySelectionAndKeepTool()

void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.FlushUnitySelectionAndKeepTool ( )
staticprivate

◆ GetActiveSplineSafe()

TrackFlowSpline TrackFlowPro.Editor.TrackFlowPlaceKnotTool.GetActiveSplineSafe ( )
staticprivate

◆ GetAllSplinesCached()

TrackFlowSpline[] TrackFlowPro.Editor.TrackFlowPlaceKnotTool.GetAllSplinesCached ( )
staticprivate

◆ GetMouseWorldOnViewPlane()

Vector3 TrackFlowPro.Editor.TrackFlowPlaceKnotTool.GetMouseWorldOnViewPlane ( SceneView sv,
Ray ray,
Vector3 throughPoint )
staticprivate

◆ GetSplitSegmentStartKnotIndex()

int TrackFlowPro.Editor.TrackFlowPlaceKnotTool.GetSplitSegmentStartKnotIndex ( TrackFlowSpline spline,
int insertIndex )
staticprivate

◆ GuessTangentWorld()

Vector3 TrackFlowPro.Editor.TrackFlowPlaceKnotTool.GuessTangentWorld ( TrackFlowSpline spline,
int insertIndex,
Vector3 newWorldPos )
staticprivate

◆ HandleDrag()

void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.HandleDrag ( SceneView sv,
Event evt,
Ray ray )
staticprivate

◆ InvalidateHoverCache()

void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.InvalidateHoverCache ( )
staticprivate

◆ IsFinite()

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.IsFinite ( Vector3 v)
staticprivate

◆ IsMouseInsideSceneView()

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.IsMouseInsideSceneView ( SceneView sv,
Vector2 mousePos )
staticprivate

◆ LoadIcon()

void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.LoadIcon ( )
private

◆ MarkCacheDirty()

void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.MarkCacheDirty ( )
staticprivate

◆ OnActivated()

override void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.OnActivated ( )

◆ OnToolGUI()

override void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.OnToolGUI ( EditorWindow window)

◆ OnWillBeDeactivated()

override void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.OnWillBeDeactivated ( )

◆ PlaceNewKnot()

void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.PlaceNewKnot ( SceneView sv,
Event evt,
SnapResult snap )
staticprivate

◆ QueueUnitySelection()

void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.QueueUnitySelection ( GameObject go)
staticprivate

◆ RefreshHoverCache()

void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.RefreshHoverCache ( SceneView sv,
Vector2 mousePosition )
staticprivate

◆ SelectExistingKnot()

void TrackFlowPro.Editor.TrackFlowPlaceKnotTool.SelectExistingKnot ( SnapResult snap,
bool ctrlToggle )
staticprivate

◆ ShouldRefreshHoverCache()

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.ShouldRefreshHoverCache ( SceneView sv,
Event evt )
staticprivate

◆ TryComputePlacement()

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.TryComputePlacement ( SceneView sv,
Ray ray,
Vector2 mouseGui,
out SnapResult snap )
staticprivate

◆ TryInsertBezierKnotPreserveShape()

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.TryInsertBezierKnotPreserveShape ( TrackFlowSpline spline,
int insertIndex,
Vector3 desiredWorld,
Vector3 binormalHintWorld,
out int insertedIndex,
out Vector3 insertedWorldPos,
out float handleLenWorld )
staticprivate

◆ TrySnapToBestKnotOnOtherSplines()

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.TrySnapToBestKnotOnOtherSplines ( Ray ray,
TrackFlowSpline skip,
out SnapResult snap )
staticprivate

◆ TrySnapToBestSegmentOnOtherSplines()

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.TrySnapToBestSegmentOnOtherSplines ( Vector2 mouseGui,
TrackFlowSpline skip,
out SnapResult snap )
staticprivate

◆ TrySnapToSegment()

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.TrySnapToSegment ( Vector2 mouseGui,
TrackFlowSpline spline,
bool isActive,
out SnapResult snap )
staticprivate

Member Data Documentation

◆ _icon

GUIContent TrackFlowPro.Editor.TrackFlowPlaceKnotTool._icon
private

◆ icon

Texture2D TrackFlowPro.Editor.TrackFlowPlaceKnotTool.icon
private

◆ s_AllowSegmentSnapToOtherSplines

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_AllowSegmentSnapToOtherSplines = true
staticprivate

◆ s_CacheDirty

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_CacheDirty = true
staticprivate

◆ s_Drag

DragState TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_Drag
staticprivate

◆ s_FallbackToViewPlane

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_FallbackToViewPlane = true
staticprivate

◆ s_Hover

HoverCache TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_Hover
staticprivate

◆ s_LastScanTime

double TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_LastScanTime
staticprivate

◆ s_MaxRayDistance

float TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_MaxRayDistance = 10000f
staticprivate

◆ s_PendingUnitySelectionGO

GameObject TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_PendingUnitySelectionGO
staticprivate

◆ s_RaycastMask

LayerMask TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_RaycastMask = ~0
staticprivate

◆ s_ReassertToolAfterSelection

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_ReassertToolAfterSelection
staticprivate

◆ s_RebuildOnMouseUp

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_RebuildOnMouseUp = true
staticprivate

◆ s_SegmentSnapPixelRadius

float TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_SegmentSnapPixelRadius = TrackFlowScreenPickUtil.DefaultPixelRadius
staticprivate

◆ s_SnapToColliders

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_SnapToColliders = true
staticprivate

◆ s_SnapToKnots

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_SnapToKnots = true
staticprivate

◆ s_SnapToSegments

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_SnapToSegments = true
staticprivate

◆ s_SplineCache

TrackFlowSpline [] TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_SplineCache
staticprivate

◆ s_UseSurfaceNormalAsBinormal

bool TrackFlowPro.Editor.TrackFlowPlaceKnotTool.s_UseSurfaceNormalAsBinormal = true
staticprivate

Property Documentation

◆ toolbarIcon

override GUIContent TrackFlowPro.Editor.TrackFlowPlaceKnotTool.toolbarIcon
get

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