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

Instantiate a mesh along the TrackFlowSpline. This is for discrete mesh pieces. If you want a pipe or road those are built into the Mesh settings within TrackFlowSpline. More...

Classes

class  CustomProfileOptions
struct  SpawnPlacement

Public Member Functions

void NuclearDestruction ()
 Destroys the pool, clears the active object array increments nuclearRegret counter.
void RecalculateBounds ()
 calculate the bounds of the instantiated object
void ReleaseSpawnedObjects ()
void ClearSpawnedMeshes ()
void SeverMesh ()
GameObject[] GetSeveredMeshes ()
TrackFlowSample Evaluate (float t01)
 Evaluate the potentially snapped and offset polyline. Fallback to TrackFlowSpline polyline.
bool TryGetSpawnPreviewPolyline (out ChordErrorSampler.Polyline poly)
 Get the polyline that we want to display.

Public Attributes

bool ignoreOtherTrackFlowSpawnersForSnap = true
bool ignoreSelfForSnap = true
bool enableSurfaceSnap = false
SurfaceSnapDirectionMode snapDirection = SurfaceSnapDirectionMode.WorldDown
float snapMaxDistance = 100f
LayerMask snapLayerMask = ~0
float surfaceOffset = 0f
bool alignToSurfaceNormal = true
int upHintSmoothWindow = 3
float upHintMaxDegPerMeter = 0
int tangentHintSmoothWindow = 3
float tangentHintMaxDegPerMeter = 0
float frameSmooth01 = 0.85f
TrackFlowSpline Spline
bool resampleCurvatureAfterSnap = true
 If true, recompute arc-length + curvature/torsion after snapping/offset. This keeps curvature preview and g-force colors consistent with the deformed path.
bool build = true
 Master enable flag for spawning along the spline.
SpawnMethod SpawnMethod = SpawnMethod.Object
SpawnJitterVolume jitterVolume = SpawnJitterVolume.Line
SpawnJitter spawnJitter = SpawnJitter.Default
bool preview = false
 Editor preview for spawner positions.
TrackMeshType meshType = TrackMeshType.Road
Material meshMaterial
float meshWidth = 1f
 Width parameter passed to the track mesh builder. For roads this is total road width; for pipes it is outer diameter.
AnimationCurve meshScale = AnimationCurve.Linear(0f, 1f, 1f, 1f)
 Scale profile along the spline (x = normalized arc, y = scale factor).
MeshingUtils.MeshUvSettings meshUvSettings = MeshingUtils.MeshUvSettings.Default
TubeOptions tubeOptions = new()
 Optional curvature / torsion / g-force vertex color preview.
RoadOptions roadOptions = new()
 Road-specific options (thickness, etc.).
UTrackOptions uTrackOptions = new()
CustomProfileOptions customProfile = new CustomProfileOptions()
float meshQuality = 1
bool generateMeshCollider = false
bool convexMeshCollider = false
bool cacheDeformedPolyline = true
Bounds prefabBounds = new(Vector3.zero, Vector3.zero)
bool ignorePrefabBounds = false
GameObject ObjectToInstantiate
 The prefab to place along the spline.
int maxInstances = 40
 Max number of instances allowed. If negative, fill the usable spline length.
bool forceEvenSpacing = false
float separation
 Extra spacing between instances along the spline (in meters of arc length).
float startOffset = 0f
 Arc length offset from the start of the spline.
Vector3 localOffset = Vector3.zero
 Local offset from the spawn position.
bool ApplyLocalOffsetBeforeSnapping = false
float rollOffsetDegrees = 0f
 The Y axis of the prefab will be aligned with the binormal of the moving frame. This offset is a clockwise rotation around the tangent when looking along the tangent.

Properties

bool IsInitialized [get, private set]
bool HasDeformedPolyline [get]
double DeformedLength [get]

Private Member Functions

bool ShouldIgnoreSnapCollider (Collider col)
 Evaluate a collider to see if we should ignore it when calculating snap positions.
bool TryGetNearestValidSnapHit (in Ray ray, out RaycastHit bestHit)
bool TryGetDeformedPolyline (out ChordErrorSampler.Polyline poly)
void RefreshSplineSubscription ()
 Remove Spline rebuilt subscription if we have an old spline reference.
void UnsubscribeSpline ()
Transform GetOrCreateRoot (ref Transform cache, string name, HideFlags editorFlags)
Transform GetOrCreateInstancesRoot ()
Transform GetOrCreatePoolRoot ()
bool CanMutateGeneratedHierarchy ()
 Check if the spawner should be able to change the scene hierarchy. Don't allow if it is a prefab or otherwise not a real object loaded into an active scene.
void ResetTransientState ()
 Completely reset the references, useful if we saved a spawner as a prefab with references attached.
void OnEnable ()
void OnDisable ()
void CleanupOrphanChildrenEditorNow ()
void QueueEditorMaintenance (bool cleanupOrphans=false, bool nuclear=false, bool rebuild=false, bool refreshPool=false)
void CancelEditorMaintenance ()
void EditorDelayedMaintenance ()
void EditorDelayedRebuild ()
 Add a delay call to rebuild the spline when the editor finishes updating the inspectors. It's okay to stack many of these in a single frame the extras will be ignored.
void CancelEditorRebuild ()
void OnValidate ()
void CleanupGeneratedChildrenEditorNow ()
 Cleanup the generated children based on the TrackFlowGeneratedMarker.
void EnsureObjectPoolInitialized ()
void HandleSplineRebuilt (object sender, EventArgs args)
ChordErrorSampler.Polyline ApplySpawnOffsetsPreserveFrames (in ChordErrorSampler.Polyline basePoly)
Vector3 Quaternion rotation GetSpawnOrientation (TrackFlowSample sample, out Vector3 upHintWS)
Vector3 Quaternion rotation GetSpawnOrientation (TrackFlowSample sample, Vector3 effectiveLocalOffset, float effectiveRollOffsetDegrees, out Vector3 upHintWS)
void OnDestroy ()
GameObject CreateNewPooledObject ()
 Create a new pooled object, set it inactive reset its transform etc.
void OnGetPooledObject (GameObject obj)
void OnReleasePooledObject (GameObject obj)
void OnDestroyPooledObject (GameObject obj)
void SyncActiveInstanceCount (int requiredCount)
Vector3[] BuildTangentHints (ChordErrorSampler.Polyline offsetPoly)
 after building a deformed polyline, the tangents are not following the terrain or other deformities, do a quick forward difference to build new tangents
ChordErrorSampler.Polyline BuildOffsetPolyline2 (ChordErrorSampler.Polyline basePoly, out Vector3[] upHintsWS)
ITrackMeshBuilder CreateMeshBuilderForSpawner ()
bool SpawnerWantsDeform ()
bool TryBuildFinalPolyline (out ChordErrorSampler.Polyline poly)
 apply offsets and deformations to the polyline, cache the result if enabled. if the spawner does not want a deformed polyline, return the base polyline instead.
GameObject GetOrCreateMeshGO ()
void BuildMeshFromSpline ()
bool TryBuildPlacementForSlot (in ChordErrorSampler.Polyline poly, float pathLength, int slotIndex, float baseS, float baseT01, out SpawnPlacement placement)
void BuildObjectPlacements (in ChordErrorSampler.Polyline poly, float pathLength, float clampedStart, float blockWidth, int requiredCount)
bool JitterEnabled ()
uint InitJitterState (int slotIndex)

Static Private Member Functions

static TrackFlowSpawnAnchorCache GetOrBuildAnchorCache (GameObject root)
static void ApplySpawnPose (GameObject obj, Vector3 targetPos, Quaternion targetRot, Vector3 scale)
static bool IsInPrefabStage (GameObject go)
static bool IsPersistentOrPrefabAssetObject (GameObject go)
static void SubscribeToOnEditorQuitting ()
static void CleanupAllSpawnedObjectsInScene ()
 Called to ensure we cleanup any spawned objects before the editor closes.
static float GetPolylineLength (in ChordErrorSampler.Polyline poly, float fallback)
static float WrapOrClampS (float s, float length, bool closed)
static uint Hash32 (uint x)
static float Next01 (ref uint state)
static float Range (ref uint state, float min, float max)
static Vector3 Range (ref uint state, Vector3 min, Vector3 max)

Private Attributes

TrackFlowSpline _spline
readonly List< SpawnPlacement_spawnPlacements = new()
ChordErrorSampler.Polyline _cachedDeformedPolyline
bool _hasCachedDeformedPolyline
readonly List< UnityEngine.Mesh > _meshes = new()
readonly List< GameObject > _meshObjects = new()
GameObject _prevObjectToInstantiate
readonly List< GameObject > activePooledObjects = new()
ObjectPool< GameObject > objectPool
TrackFlowSpline _subscribedSpline
Transform _instancesRoot
Transform _poolRoot
bool _editorMaintenanceQueued
bool _editorWantsCleanupOrphans
bool _editorWantsNuke
bool _editorWantsRebuild
bool _editorWantsPoolRefresh
Vector3 position

Static Private Attributes

const string GeneratedMeshName = "_SpawnMesh_Generated"
static RaycastHit[] s_RaycastHits = new RaycastHit[32]

Detailed Description

Instantiate a mesh along the TrackFlowSpline. This is for discrete mesh pieces. If you want a pipe or road those are built into the Mesh settings within TrackFlowSpline.

"Forward" is assumed to be the Z direction; we align prefab Z with spline tangent (blue), and prefab Y with spline binormal (green).

Member Function Documentation

◆ ApplySpawnOffsetsPreserveFrames()

ChordErrorSampler.Polyline TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.ApplySpawnOffsetsPreserveFrames ( in ChordErrorSampler.Polyline basePoly)
private

◆ ApplySpawnPose()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.ApplySpawnPose ( GameObject obj,
Vector3 targetPos,
Quaternion targetRot,
Vector3 scale )
staticprivate

◆ BuildMeshFromSpline()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.BuildMeshFromSpline ( )
private

◆ BuildObjectPlacements()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.BuildObjectPlacements ( in ChordErrorSampler.Polyline poly,
float pathLength,
float clampedStart,
float blockWidth,
int requiredCount )
private

◆ BuildOffsetPolyline2()

ChordErrorSampler.Polyline TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.BuildOffsetPolyline2 ( ChordErrorSampler.Polyline basePoly,
out Vector3[] upHintsWS )
private

◆ BuildTangentHints()

Vector3[] TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.BuildTangentHints ( ChordErrorSampler.Polyline offsetPoly)
private

after building a deformed polyline, the tangents are not following the terrain or other deformities, do a quick forward difference to build new tangents

Parameters
offsetPoly
Returns

◆ CancelEditorMaintenance()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.CancelEditorMaintenance ( )
private

◆ CancelEditorRebuild()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.CancelEditorRebuild ( )
private

◆ CanMutateGeneratedHierarchy()

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.CanMutateGeneratedHierarchy ( )
private

Check if the spawner should be able to change the scene hierarchy. Don't allow if it is a prefab or otherwise not a real object loaded into an active scene.

Returns

◆ CleanupAllSpawnedObjectsInScene()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.CleanupAllSpawnedObjectsInScene ( )
staticprivate

Called to ensure we cleanup any spawned objects before the editor closes.

◆ CleanupGeneratedChildrenEditorNow()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.CleanupGeneratedChildrenEditorNow ( )
private

Cleanup the generated children based on the TrackFlowGeneratedMarker.

◆ CleanupOrphanChildrenEditorNow()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.CleanupOrphanChildrenEditorNow ( )
private

◆ ClearSpawnedMeshes()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.ClearSpawnedMeshes ( )

◆ CreateMeshBuilderForSpawner()

ITrackMeshBuilder TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.CreateMeshBuilderForSpawner ( )
private

◆ CreateNewPooledObject()

GameObject TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.CreateNewPooledObject ( )
private

Create a new pooled object, set it inactive reset its transform etc.

Returns

◆ EditorDelayedMaintenance()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.EditorDelayedMaintenance ( )
private

◆ EditorDelayedRebuild()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.EditorDelayedRebuild ( )
private

Add a delay call to rebuild the spline when the editor finishes updating the inspectors. It's okay to stack many of these in a single frame the extras will be ignored.

◆ EnsureObjectPoolInitialized()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.EnsureObjectPoolInitialized ( )
private

◆ Evaluate()

TrackFlowSample TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.Evaluate ( float t01)

Evaluate the potentially snapped and offset polyline. Fallback to TrackFlowSpline polyline.

Parameters
t01
Returns

◆ GetOrBuildAnchorCache()

TrackFlowSpawnAnchorCache TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.GetOrBuildAnchorCache ( GameObject root)
staticprivate

◆ GetOrCreateInstancesRoot()

Transform TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.GetOrCreateInstancesRoot ( )
private

◆ GetOrCreateMeshGO()

GameObject TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.GetOrCreateMeshGO ( )
private

◆ GetOrCreatePoolRoot()

Transform TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.GetOrCreatePoolRoot ( )
private

◆ GetOrCreateRoot()

Transform TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.GetOrCreateRoot ( ref Transform cache,
string name,
HideFlags editorFlags )
private

◆ GetPolylineLength()

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.GetPolylineLength ( in ChordErrorSampler.Polyline poly,
float fallback )
staticprivate

◆ GetSeveredMeshes()

GameObject[] TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.GetSeveredMeshes ( )

◆ GetSpawnOrientation() [1/2]

Vector3 Quaternion rotation TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.GetSpawnOrientation ( TrackFlowSample sample,
out Vector3 upHintWS )
private

◆ GetSpawnOrientation() [2/2]

Vector3 Quaternion rotation TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.GetSpawnOrientation ( TrackFlowSample sample,
Vector3 effectiveLocalOffset,
float effectiveRollOffsetDegrees,
out Vector3 upHintWS )
private

◆ HandleSplineRebuilt()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.HandleSplineRebuilt ( object sender,
EventArgs args )
private

◆ Hash32()

uint TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.Hash32 ( uint x)
staticprivate

◆ InitJitterState()

uint TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.InitJitterState ( int slotIndex)
private

◆ IsInPrefabStage()

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.IsInPrefabStage ( GameObject go)
staticprivate

◆ IsPersistentOrPrefabAssetObject()

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.IsPersistentOrPrefabAssetObject ( GameObject go)
staticprivate

◆ JitterEnabled()

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.JitterEnabled ( )
private

◆ Next01()

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.Next01 ( ref uint state)
staticprivate

◆ NuclearDestruction()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.NuclearDestruction ( )

Destroys the pool, clears the active object array increments nuclearRegret counter.

◆ OnDestroy()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.OnDestroy ( )
private

◆ OnDestroyPooledObject()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.OnDestroyPooledObject ( GameObject obj)
private

◆ OnDisable()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.OnDisable ( )
private

◆ OnEnable()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.OnEnable ( )
private

◆ OnGetPooledObject()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.OnGetPooledObject ( GameObject obj)
private

◆ OnReleasePooledObject()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.OnReleasePooledObject ( GameObject obj)
private

◆ OnValidate()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.OnValidate ( )
private

◆ QueueEditorMaintenance()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.QueueEditorMaintenance ( bool cleanupOrphans = false,
bool nuclear = false,
bool rebuild = false,
bool refreshPool = false )
private

◆ Range() [1/2]

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.Range ( ref uint state,
float min,
float max )
staticprivate

◆ Range() [2/2]

Vector3 TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.Range ( ref uint state,
Vector3 min,
Vector3 max )
staticprivate

◆ RecalculateBounds()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.RecalculateBounds ( )

calculate the bounds of the instantiated object

◆ RefreshSplineSubscription()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.RefreshSplineSubscription ( )
private

Remove Spline rebuilt subscription if we have an old spline reference.

◆ ReleaseSpawnedObjects()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.ReleaseSpawnedObjects ( )

◆ ResetTransientState()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.ResetTransientState ( )
private

Completely reset the references, useful if we saved a spawner as a prefab with references attached.

◆ SeverMesh()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.SeverMesh ( )

◆ ShouldIgnoreSnapCollider()

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.ShouldIgnoreSnapCollider ( Collider col)
private

Evaluate a collider to see if we should ignore it when calculating snap positions.

Parameters
col
Returns

◆ SpawnerWantsDeform()

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.SpawnerWantsDeform ( )
private

◆ SubscribeToOnEditorQuitting()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.SubscribeToOnEditorQuitting ( )
staticprivate

◆ SyncActiveInstanceCount()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.SyncActiveInstanceCount ( int requiredCount)
private

◆ TryBuildFinalPolyline()

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.TryBuildFinalPolyline ( out ChordErrorSampler.Polyline poly)
private

apply offsets and deformations to the polyline, cache the result if enabled. if the spawner does not want a deformed polyline, return the base polyline instead.

Parameters
poly
Returns

◆ TryBuildPlacementForSlot()

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.TryBuildPlacementForSlot ( in ChordErrorSampler.Polyline poly,
float pathLength,
int slotIndex,
float baseS,
float baseT01,
out SpawnPlacement placement )
private

◆ TryGetDeformedPolyline()

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.TryGetDeformedPolyline ( out ChordErrorSampler.Polyline poly)
private

◆ TryGetNearestValidSnapHit()

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.TryGetNearestValidSnapHit ( in Ray ray,
out RaycastHit bestHit )
private

◆ TryGetSpawnPreviewPolyline()

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.TryGetSpawnPreviewPolyline ( out ChordErrorSampler.Polyline poly)

Get the polyline that we want to display.

Parameters
poly
Returns

◆ UnsubscribeSpline()

void TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.UnsubscribeSpline ( )
private

◆ WrapOrClampS()

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.WrapOrClampS ( float s,
float length,
bool closed )
staticprivate

Member Data Documentation

◆ _cachedDeformedPolyline

ChordErrorSampler.Polyline TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._cachedDeformedPolyline
private

◆ _editorMaintenanceQueued

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._editorMaintenanceQueued
private

◆ _editorWantsCleanupOrphans

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._editorWantsCleanupOrphans
private

◆ _editorWantsNuke

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._editorWantsNuke
private

◆ _editorWantsPoolRefresh

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._editorWantsPoolRefresh
private

◆ _editorWantsRebuild

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._editorWantsRebuild
private

◆ _hasCachedDeformedPolyline

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._hasCachedDeformedPolyline
private

◆ _instancesRoot

Transform TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._instancesRoot
private

◆ _meshes

readonly List<UnityEngine.Mesh> TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._meshes = new()
private

◆ _meshObjects

readonly List<GameObject> TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._meshObjects = new()
private

◆ _poolRoot

Transform TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._poolRoot
private

◆ _prevObjectToInstantiate

GameObject TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._prevObjectToInstantiate
private

◆ _spawnPlacements

readonly List<SpawnPlacement> TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._spawnPlacements = new()
private

◆ _spline

TrackFlowSpline TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._spline
private

◆ _subscribedSpline

TrackFlowSpline TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner._subscribedSpline
private

◆ activePooledObjects

readonly List<GameObject> TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.activePooledObjects = new()
private

◆ alignToSurfaceNormal

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.alignToSurfaceNormal = true

◆ ApplyLocalOffsetBeforeSnapping

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.ApplyLocalOffsetBeforeSnapping = false

◆ build

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.build = true

Master enable flag for spawning along the spline.

◆ cacheDeformedPolyline

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.cacheDeformedPolyline = true

◆ convexMeshCollider

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.convexMeshCollider = false

◆ customProfile

CustomProfileOptions TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.customProfile = new CustomProfileOptions()

◆ enableSurfaceSnap

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.enableSurfaceSnap = false

◆ forceEvenSpacing

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.forceEvenSpacing = false

◆ frameSmooth01

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.frameSmooth01 = 0.85f

◆ GeneratedMeshName

const string TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.GeneratedMeshName = "_SpawnMesh_Generated"
staticprivate

◆ generateMeshCollider

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.generateMeshCollider = false

◆ ignoreOtherTrackFlowSpawnersForSnap

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.ignoreOtherTrackFlowSpawnersForSnap = true

◆ ignorePrefabBounds

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.ignorePrefabBounds = false

◆ ignoreSelfForSnap

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.ignoreSelfForSnap = true

◆ jitterVolume

SpawnJitterVolume TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.jitterVolume = SpawnJitterVolume.Line

◆ localOffset

Vector3 TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.localOffset = Vector3.zero

Local offset from the spawn position.

◆ maxInstances

int TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.maxInstances = 40

Max number of instances allowed. If negative, fill the usable spline length.

◆ meshMaterial

Material TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.meshMaterial

◆ meshQuality

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.meshQuality = 1

◆ meshScale

AnimationCurve TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.meshScale = AnimationCurve.Linear(0f, 1f, 1f, 1f)

Scale profile along the spline (x = normalized arc, y = scale factor).

◆ meshType

TrackMeshType TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.meshType = TrackMeshType.Road

◆ meshUvSettings

MeshingUtils.MeshUvSettings TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.meshUvSettings = MeshingUtils.MeshUvSettings.Default

◆ meshWidth

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.meshWidth = 1f

Width parameter passed to the track mesh builder. For roads this is total road width; for pipes it is outer diameter.

◆ objectPool

ObjectPool<GameObject> TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.objectPool
private

◆ ObjectToInstantiate

GameObject TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.ObjectToInstantiate

The prefab to place along the spline.

◆ position

Vector3 TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.position
private

◆ prefabBounds

Bounds TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.prefabBounds = new(Vector3.zero, Vector3.zero)

◆ preview

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.preview = false

Editor preview for spawner positions.

◆ resampleCurvatureAfterSnap

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.resampleCurvatureAfterSnap = true

If true, recompute arc-length + curvature/torsion after snapping/offset. This keeps curvature preview and g-force colors consistent with the deformed path.

◆ roadOptions

RoadOptions TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.roadOptions = new()

Road-specific options (thickness, etc.).

◆ rollOffsetDegrees

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.rollOffsetDegrees = 0f

The Y axis of the prefab will be aligned with the binormal of the moving frame. This offset is a clockwise rotation around the tangent when looking along the tangent.

◆ s_RaycastHits

RaycastHit [] TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.s_RaycastHits = new RaycastHit[32]
staticprivate

◆ separation

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.separation

Extra spacing between instances along the spline (in meters of arc length).

◆ snapDirection

SurfaceSnapDirectionMode TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.snapDirection = SurfaceSnapDirectionMode.WorldDown

◆ snapLayerMask

LayerMask TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.snapLayerMask = ~0

◆ snapMaxDistance

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.snapMaxDistance = 100f

◆ spawnJitter

SpawnJitter TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.spawnJitter = SpawnJitter.Default

◆ SpawnMethod

SpawnMethod TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.SpawnMethod = SpawnMethod.Object

◆ Spline

TrackFlowSpline TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.Spline

◆ startOffset

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.startOffset = 0f

Arc length offset from the start of the spline.

◆ surfaceOffset

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.surfaceOffset = 0f

◆ tangentHintMaxDegPerMeter

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.tangentHintMaxDegPerMeter = 0

◆ tangentHintSmoothWindow

int TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.tangentHintSmoothWindow = 3

◆ tubeOptions

TubeOptions TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.tubeOptions = new()

Optional curvature / torsion / g-force vertex color preview.

Pipe-specific options (tube, caps, cross section, wall thickness).

◆ upHintMaxDegPerMeter

float TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.upHintMaxDegPerMeter = 0

◆ upHintSmoothWindow

int TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.upHintSmoothWindow = 3

◆ uTrackOptions

UTrackOptions TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.uTrackOptions = new()

Property Documentation

◆ DeformedLength

double TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.DeformedLength
get

◆ HasDeformedPolyline

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.HasDeformedPolyline
get

◆ IsInitialized

bool TrackFlowPro.Runtime.Core.Meshing.TrackFlowSpawner.IsInitialized
getprivate set

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