Scylla Framework
  • API Reference
Search Results for

    Show / Hide Table of Contents
    • Scylla.Core
      • Char
      • FileLog
      • ILogReceiver
      • IScyllaDependencyProvider
      • Log
      • LogCategory
      • LogEntry
      • LogFileFormat
      • LogLevel
      • Num
      • ScyllaAAMode
      • ScyllaAAQuality
      • ScyllaBootstrap
      • ScyllaCore
      • ScyllaCore.Meta
      • ScyllaDependencyInfoData
      • ScyllaMaterialSurface
      • ScyllaRenderPipeline
      • ScyllaShadowResolution
      • Str
      • TextAlignment
      • UnityConsoleLog
    • Scylla.Core.Attributes
      • AttributeValidator
      • CompareOperator
      • ConditionalAttributeBase
      • DisableIfAttribute
      • DisplayNameAttribute
      • EnableIfAttribute
      • FoldoutAttribute
      • FormerlySerializedAsAttribute
      • GroupAttribute
      • HideIfAttribute
      • HideInFilterWindowAttribute
      • HorizontalLineAttribute
      • InfoBoxAttribute
      • InfoType
      • LayerFieldAttribute
      • MinMaxRangeAttribute
      • MonoTextAreaAttribute
      • NotEmptyAttribute
      • NotNullAttribute
      • ReadOnlyAttribute
      • ReflectedTypeAttribute
      • RequiredAttribute
      • SceneFieldAttribute
      • ShowIfAttribute
      • SortingLayerFieldAttribute
      • TagFieldAttribute
      • TitleAttribute
      • ValidateInputAttribute
      • ValidationException
    • Scylla.Core.Config
      • ConfigFileManager
      • ConfigurationRegistry
      • ConfigurationSlotAttribute
      • ConfigurationValidationResult
      • ConsoleLoggingSettings
      • FileLogFormattingSettings
      • FileLoggingSettings
      • IConfigurationRegistry
      • ScyllaConfiguration
      • ScyllaCoreConfiguration
      • ScyllaEventConfiguration
      • ScyllaLoggerConfiguration
      • ValidationSeverity
    • Scylla.Core.Editor
      • CalendarDefinitionEditor
      • ClockDefinitionEditor
      • ColorGradientAssetEditor
      • ColorGradientReducer
      • ColorPaletteAssetEditor
      • DebugCameraEditor
      • DebugEventMonitor
      • DependencySourceType
      • DependencyStatus
      • EventFilterCategory
      • EventLogEntry
      • GameViewCapture
      • IScyllaShaderProvider
      • ScyllaAboutWindow
      • ScyllaBootstrapEditor
      • ScyllaCard
      • ScyllaConfigurationEditorBase
      • ScyllaCopyMenu
      • ScyllaCoreConfigurationEditor
      • ScyllaCoreDependencyProvider
      • ScyllaCoreShaderProvider
      • ScyllaDebugWindow
      • ScyllaDependencyDetector
      • ScyllaDependencyGraphElement
      • ScyllaDependencyInfo
      • ScyllaDescriptionBox
      • ScyllaEditorAssetUtil
      • ScyllaEditorAssets
      • ScyllaEditorBase
      • ScyllaEditorClipboard
      • ScyllaEditorColors
      • ScyllaEditorConstants
      • ScyllaEditorIconNames
      • ScyllaEditorLogScope
      • ScyllaEditorPrefs
      • ScyllaEditorStyles
      • ScyllaEditorTheme
      • ScyllaEditorUSSClasses
      • ScyllaEventConfigurationEditor
      • ScyllaFontCharacterExtractorWindow
      • ScyllaGettingStartedWindow
      • ScyllaIconPreview
      • ScyllaLoggerConfigurationEditor
      • ScyllaLogoElement
      • ScyllaMenuItems
      • ScyllaModuleEditor
      • ScyllaModuleStatusIndicator
      • ScyllaModuleWindow
      • ScyllaNameField
      • ScyllaPanel
      • ScyllaPresetSelector
      • ScyllaSceneConfigurationEditor
      • ScyllaScheduler
      • ScyllaSearchField
      • ScyllaSearchablePopup
      • ScyllaSearchablePopup.Item
      • ScyllaSettingsProvider
      • ScyllaSetupWizard
      • ScyllaShaderInclusionBuildProcessor
      • ScyllaSplitView
      • ScyllaStatusBar
      • ScyllaTabBar
      • ScyllaTimeConfigurationEditor
      • ScyllaToolWindowBase
      • ScyllaToolbar
      • ScyllaValidatedTextField
      • ScyllaWizardWindowBase
      • ScyllaWizardWindowBase.WizardLayout
      • ScyllaWizardWindowBase.WizardStepDef
    • Scylla.Core.Editor.Attributes
      • AttributeReflectionCache
      • ConditionalDrawerBase
      • DisableIfDrawer
      • EnableIfDrawer
      • FoldoutDrawer
      • HideIfDrawer
      • HorizontalLineDrawer
      • InfoBoxDrawer
      • LayerFieldDrawer
      • MinMaxRangeDrawer
      • MonoTextAreaDrawer
      • ReadOnlyDrawer
      • RequiredDrawer
      • SceneFieldDrawer
      • SerializedPropertyExtensions
      • ShowIfDrawer
      • SortingLayerFieldDrawer
      • TagFieldDrawer
      • TitleDrawer
    • Scylla.Core.Editor.Drawers
      • DoubleRangeDrawer
      • FloatRangeDrawer
      • IntRangeDrawer
    • Scylla.Core.Editor.Util.UI.Layout
      • ScyllaUIEdgeInsetsDrawer
      • ScyllaUILayoutMenuItems
      • ScyllaUILengthDrawer
    • Scylla.Core.Events
      • IScyllaEventBus
      • ScyllaEvent
      • ScyllaEventBus
      • ScyllaEventPriority
      • ScyllaEventSubscription
      • ScyllaEvents
      • ScyllaFrameworkInitializedEvent
      • ScyllaFrameworkShutdownEvent
      • ScyllaModuleShutdownEvent
      • ScyllaModuleStartedEvent
    • Scylla.Core.Modules
      • IScyllaModule
      • IScyllaModuleManager
      • ScyllaModule
      • ScyllaModuleDependency
      • ScyllaModuleDependencyType
      • ScyllaModuleException
      • ScyllaModuleID
      • ScyllaModuleInfo
      • ScyllaModuleManager
      • ScyllaModulePlacement
      • ScyllaModuleState
    • Scylla.Core.Scenes
      • HygieneOverride
      • SceneLoadOperation
      • SceneLoadRunner
      • SceneLoadState
      • ScyllaActiveSceneChangedEvent
      • ScyllaSceneConfiguration
      • ScyllaSceneLoadOptions
      • ScyllaSceneLoadProgressEvent
      • ScyllaSceneLoadedEvent
      • ScyllaSceneManager
      • ScyllaSceneUnloadedEvent
      • ScyllaSceneWillLoadEvent
      • ScyllaSceneWillUnloadEvent
    • Scylla.Core.Settings
      • ScyllaProjectSettings
    • Scylla.Core.Structures
      • FractionalHexCoord
      • GridUtil
      • HexCoord
      • HexCornerCoord
      • HexCornerMap<TData>
      • HexCornerMap<TData>.Enumerator
      • HexCornerPosition
      • HexEdgeCoord
      • HexEdgeDirection
      • HexEdgeMap<TData>
      • HexEdgeMap<TData>.Enumerator
      • HexGridLayout
      • HexLayoutMode
      • HexOrientation
      • IScyllaCollection
      • IScyllaCollection<T>
      • IScyllaGraph
      • IScyllaGrid<TCoord, TCell>
      • IScyllaMap<TKey, TValue>
      • IScyllaMutableGraph
      • IScyllaMutableGraph<TNodeData>
      • IScyllaMutableGraph<TNodeData, TEdgeData>
      • IScyllaPausableState<TContext>
      • IScyllaPriorityQueueItem
      • IScyllaReadOnlyGraph
      • IScyllaReadOnlyGraph<TNodeData>
      • IScyllaReadOnlyGraph<TNodeData, TEdgeData>
      • IScyllaState<TContext>
      • IScyllaTransition<TContext>
      • IScyllaTrie
      • IScyllaTrie<TValue>
      • NeighborWriter<TCoord>
      • ScyllaAABB2
      • ScyllaAABB3
      • ScyllaAdjacencyListGraph
      • ScyllaAdjacencyListGraph.Builder
      • ScyllaAdjacencyListGraph.NodeEnumerator
      • ScyllaAdjacencyListGraph.SynchronizedScyllaAdjacencyListGraph
      • ScyllaAdjacencyListGraph<TNodeData>
      • ScyllaAdjacencyListGraph<TNodeData, TEdgeData>
      • ScyllaBVH
      • ScyllaBVH.Builder
      • ScyllaBVHCore
      • ScyllaBitArray
      • ScyllaBitArray.Builder
      • ScyllaBitArray.Enumerator
      • ScyllaBitArray.SynchronizedScyllaBitArray
      • ScyllaBitArrayDOTS
      • ScyllaBitArrayDOTS.Builder
      • ScyllaBitArrayDOTS.Enumerator
      • ScyllaCSRGraph
      • ScyllaCSRGraph.Builder
      • ScyllaCSRGraph<TNodeData>
      • ScyllaCSRGraph<TNodeData, TEdgeData>
      • ScyllaCollectionCapabilities
      • ScyllaCollectionThreadSafety
      • ScyllaCompositeState<TContext>
      • ScyllaDequeDOTS<T>
      • ScyllaDequeDOTS<T>.Builder
      • ScyllaDeque<T>
      • ScyllaDeque<T>.Builder
      • ScyllaDeque<T>.Enumerator
      • ScyllaDeque<T>.SynchronizedScyllaDeque
      • ScyllaDisjointSet
      • ScyllaDisjointSet.Builder
      • ScyllaDisjointSet.SynchronizedScyllaDisjointSet
      • ScyllaDisjointSetDOTS
      • ScyllaDisjointSetDOTS.Builder
      • ScyllaGenericObjectPool<T>
      • ScyllaGenericObjectPool<T>.Builder
      • ScyllaGenericObjectPool<T>.Enumerator
      • ScyllaGenericObjectPool<T>.SynchronizedScyllaGenericObjectPool
      • ScyllaGraphAlgorithms
      • ScyllaGraphDOTS
      • ScyllaGraphDOTS.Builder
      • ScyllaGraphEdge
      • ScyllaGraphEdge<TEdgeData>
      • ScyllaGraphNode
      • ScyllaGraphNodeFlags
      • ScyllaGraphPath
      • ScyllaGraphProperties
      • ScyllaGraphSearchState
      • ScyllaGridGraphAdapter<TCoord, TCell>
      • ScyllaHexGrid<TCell>
      • ScyllaHexGrid<TCell>.Builder
      • ScyllaHexGrid<TCell>.Enumerator
      • ScyllaHexGrid<TCell>.SynchronizedScyllaHexGrid
      • ScyllaHierarchicalStateMachine<TContext>
      • ScyllaKDTree3
      • ScyllaKDTree3.Builder
      • ScyllaKDTree3Core
      • ScyllaKDTree3Core.Node
      • ScyllaLayeredStateMachine<TContext>
      • ScyllaLooseOctree
      • ScyllaLooseOctree.Builder
      • ScyllaLooseOctreeCore
      • ScyllaLooseOctreeUtil
      • ScyllaLooseOctree<T>
      • ScyllaLooseQuadtree
      • ScyllaLooseQuadtree.Builder
      • ScyllaLooseQuadtreeCore
      • ScyllaLooseQuadtreeUtil
      • ScyllaLooseQuadtree<T>
      • ScyllaMapDOTS<TKey, TValue>
      • ScyllaMapDOTS<TKey, TValue>.Builder
      • ScyllaMapEntry<TKey, TValue>
      • ScyllaMap<TKey, TValue>
      • ScyllaMap<TKey, TValue>.Builder
      • ScyllaMap<TKey, TValue>.Enumerator
      • ScyllaMap<TKey, TValue>.SynchronizedScyllaMap
      • ScyllaObjectPool<T>
      • ScyllaObjectPool<T>.Builder
      • ScyllaObjectPool<T>.Enumerator
      • ScyllaObjectPool<T>.SynchronizedScyllaObjectPool
      • ScyllaPausableStateBase<TContext>
      • ScyllaPriorityQueueDOTS<TValue>
      • ScyllaPriorityQueueDOTS<TValue>.Builder
      • ScyllaPriorityQueueItemComparer<T>
      • ScyllaPriorityQueueNode<TValue>
      • ScyllaPriorityQueueOrder
      • ScyllaPriorityQueue<T>
      • ScyllaPriorityQueue<T>.Builder
      • ScyllaPriorityQueue<T>.Enumerator
      • ScyllaPriorityQueue<T>.SynchronizedScyllaPriorityQueue
      • ScyllaPushdownStateMachine<TContext>
      • ScyllaQuadtreePlane
      • ScyllaQueueDOTS<T>
      • ScyllaQueueDOTS<T>.Builder
      • ScyllaQueue<T>
      • ScyllaQueue<T>.Builder
      • ScyllaQueue<T>.Enumerator
      • ScyllaQueue<T>.SynchronizedScyllaQueue
      • ScyllaRay3
      • ScyllaRingBufferDOTS<T>
      • ScyllaRingBufferDOTS<T>.Builder
      • ScyllaRingBufferDOTS<T>.Enumerator
      • ScyllaRingBufferDOTS<T>.ReverseEnumerable
      • ScyllaRingBufferDOTS<T>.ReverseEnumerator
      • ScyllaRingBuffer<T>
      • ScyllaRingBuffer<T>.Builder
      • ScyllaRingBuffer<T>.Enumerator
      • ScyllaRingBuffer<T>.ReverseEnumerable
      • ScyllaRingBuffer<T>.ReverseEnumerator
      • ScyllaRingBuffer<T>.SynchronizedScyllaRingBuffer
      • ScyllaSparseHexGrid<TCell>
      • ScyllaSparseHexGrid<TCell>.Builder
      • ScyllaSparseHexGrid<TCell>.Enumerator
      • ScyllaSparseHexGrid<TCell>.SynchronizedScyllaSparseHexGrid
      • ScyllaSparseSquareGrid<TCell>
      • ScyllaSparseSquareGrid<TCell>.Builder
      • ScyllaSparseSquareGrid<TCell>.Enumerator
      • ScyllaSparseSquareGrid<TCell>.SynchronizedScyllaSparseSquareGrid
      • ScyllaSparseTriGrid<TCell>
      • ScyllaSparseTriGrid<TCell>.Builder
      • ScyllaSparseTriGrid<TCell>.Enumerator
      • ScyllaSparseTriGrid<TCell>.SynchronizedScyllaSparseTriGrid
      • ScyllaSquareGrid<TCell>
      • ScyllaSquareGrid<TCell>.Builder
      • ScyllaSquareGrid<TCell>.Enumerator
      • ScyllaSquareGrid<TCell>.SynchronizedScyllaSquareGrid
      • ScyllaStackDOTS<T>
      • ScyllaStackDOTS<T>.Builder
      • ScyllaStack<T>
      • ScyllaStack<T>.Builder
      • ScyllaStack<T>.Enumerator
      • ScyllaStack<T>.SynchronizedScyllaStack
      • ScyllaStateBase<TContext>
      • ScyllaStateMachine<TContext>
      • ScyllaTransition<TContext>
      • ScyllaTriGrid<TCell>
      • ScyllaTriGrid<TCell>.Builder
      • ScyllaTriGrid<TCell>.Enumerator
      • ScyllaTriGrid<TCell>.SynchronizedScyllaTriGrid
      • ScyllaTrie
      • ScyllaTrie.Builder
      • ScyllaTrie.SynchronizedScyllaTrie
      • ScyllaTrie<TValue>
      • ScyllaTrie<TValue>.Builder
      • ScyllaTrie<TValue>.SynchronizedScyllaTrie
      • ScyllaTypeMap
      • ScyllaTypeMap.Builder
      • ScyllaTypeMap.DiagnosticEntry
      • ScyllaTypeMap.SynchronizedScyllaTypeMap
      • SerializableDictionary<TKey, TValue>
      • SquareAdjacency
      • SquareCoord
      • SquareCornerCoord
      • SquareCornerMap<TData>
      • SquareCornerMap<TData>.Enumerator
      • SquareDistanceMetric
      • SquareEdgeCoord
      • SquareEdgeDirection
      • SquareEdgeMap<TData>
      • SquareEdgeMap<TData>.Enumerator
      • SquareGridLayout
      • TriCoord
      • TriCornerCoord
      • TriCornerMap<TData>
      • TriCornerMap<TData>.Enumerator
      • TriEdgeCoord
      • TriEdgeDirection
      • TriEdgeMap<TData>
      • TriEdgeMap<TData>.Enumerator
      • TriGridLayout
    • Scylla.Core.Time
      • CalendarDefinition
      • CalendarMath
      • ClockDayChangedEvent
      • ClockDebugInfo
      • ClockDefinition
      • ClockEraChangedEvent
      • ClockEvent
      • ClockEventKind
      • ClockHourChangedEvent
      • ClockMinuteChangedEvent
      • ClockMonthChangedEvent
      • ClockPausedEvent
      • ClockRegisteredEvent
      • ClockResumedEvent
      • ClockSeasonChangedEvent
      • ClockSecondChangedEvent
      • ClockState
      • ClockTickEvent
      • ClockTimeScaleChangedEvent
      • ClockUnregisteredEvent
      • ClockWeekdayChangedEvent
      • ClockYearChangedEvent
      • EraDefinition
      • GameDate
      • IClockListener
      • IClockSource
      • IEraConditionProvider
      • ILocationProfile
      • INetworkTimeSyncStrategy
      • ITimeListener
      • LeapYearRule
      • MasterTimeState
      • MonthDefinition
      • PauseMode
      • ScheduleExtensions
      • ScheduleMode
      • ScheduledTickHandle
      • ScyllaClock
      • ScyllaTime
      • ScyllaTimeConfiguration
      • ScyllaTimeDebugInfo
      • SeasonDefinition
      • SmoothTimeScaleTransition
      • TimeEffectHandle
      • TimeEffects
      • TimeEvent
      • TimeScaleBlendMode
      • TimeScaleModifier
      • TimeScaleModifierHandle
      • TimeScaleModifierStack
      • TimeScaleModifierState
      • TimeTickRunner
      • WeekdayDefinition
    • Scylla.Core.Util
      • ArrayUtil
      • AssemblyUtil
      • CameraUtil
      • CollectionUtil
      • ColorUtil
      • ComponentUtil
      • DateUtil
      • DebugCamera
      • FontUtil
      • FontVariant
      • GameObjectExtensions
      • GameObjectUtil
      • InterfaceUtil
      • Interpolation
      • LightUtil
      • LitMaterialDescriptor
      • ManualResetEventEx
      • MaterialUtil
      • NumberExtensions
      • NumberUtil
      • OptionalPackages
      • PlatformUtil
      • ResourceUtil
      • SpriteUtil
      • StringUtil
      • TabularText
      • TabularText.Builder
      • TestTextGenerator
      • ThreadUtil
      • TimeUtil
      • Timer
      • TransformExtensions
      • TypeUtil
      • UnicodeRange
      • VirtualTransform
    • Scylla.Core.Util.Addressables
      • AddressableErrorCode
      • AddressableException
      • AddressableExtensions
      • AddressableProgress
      • AddressableResult
      • AddressableResult<T>
      • AddressableSettings
      • ManagedAddressableList<T>
      • ManagedAddressable<T>
      • ScyllaAddressables
    • Scylla.Core.Util.Checksum
      • ChecksumAdler32
      • ChecksumCRC16
      • ChecksumCRC32
      • ChecksumFletcher32
      • ChecksumXXHash32
      • ChecksumXXHash64
      • IChecksum
    • Scylla.Core.Util.Compression
      • ArchiveEntryInfo
      • CompressionAlgorithm
      • CompressionErrorCode
      • CompressionException
      • CompressionExtensions
      • CompressionLevel
      • CompressionProgress
      • CompressionResult
      • CompressionResult<T>
      • CompressionSettings
      • IArchiveProvider
      • ICompressionProvider
      • ScyllaCompression
    • Scylla.Core.Util.Crypto
      • CryptoAlgorithm
      • CryptoErrorCode
      • CryptoException
      • CryptoExtensions
      • CryptoSettings
      • ICryptoProvider
      • KeyDerivationHash
      • KeyDerivationSettings
      • ScyllaCrypto
    • Scylla.Core.Util.DebugDraw
      • DebugDraw
      • DebugDrawSpace
      • DebugDrawTextAlign
    • Scylla.Core.Util.Effects
      • ColorAnimationText
      • ColorAnimationTextDirection
      • ColorAnimationTextGradient
    • Scylla.Core.Util.File
      • ConfigFile
      • ConfigFileGroup
      • ConfigFileProperty
      • ConfigFilePropertyType
      • ConfigFileUtil
      • FileErrorCode
      • FileException
      • FileExtensions
      • FilePathExtensions
      • FilePathUtil
      • FileProgress
      • FileSettings
      • ImageFileFormat
      • ImageFileSettings
      • ScyllaFileUtil
    • Scylla.Core.Util.Geom
      • AABB3D
      • BarrelColoringMode
      • BollardColoringMode
      • CappedWallColoringMode
      • Capsule3D
      • ColliderMode
      • CrateColoringMode
      • Ellipse
      • FaceColoringMode
      • IFaceColorResolver
      • OBB3D
      • PaletteFaceColorResolver
      • PaneledWall1ColoringMode
      • PaneledWall2ColoringMode
      • PipeSegmentColoringMode
      • RoundedBoxColoringMode
      • ScyllaArchwayShape
      • ScyllaBarrelShape
      • ScyllaBollardShape
      • ScyllaBoxShape
      • ScyllaCappedWallShape
      • ScyllaCapsuleShape
      • ScyllaColumnShape
      • ScyllaConeShape
      • ScyllaCrateShape
      • ScyllaCurvedStairsShape
      • ScyllaCylinderShape
      • ScyllaDomeShape
      • ScyllaFloorTileShape
      • ScyllaIcoSphereShape
      • ScyllaLadderShape
      • ScyllaLinearStairsShape
      • ScyllaOctahedronShape
      • ScyllaPaneledWall1Shape
      • ScyllaPaneledWall2Shape
      • ScyllaPipeSegmentShape
      • ScyllaPipeShape
      • ScyllaPlaneShape
      • ScyllaPyramidShape
      • ScyllaQuadShape
      • ScyllaRampShape
      • ScyllaRingShape
      • ScyllaRoundedBoxShape
      • ScyllaShapeBase3D
      • ScyllaShapes
      • ScyllaShelvedWallShape
      • ScyllaSignShape
      • ScyllaSkirtedWallShape
      • ScyllaSkyDomeShape
      • ScyllaSphereShape
      • ScyllaSpiralStairsShape
      • ScyllaTorusShape
      • ScyllaTriangularPrismShape
      • ScyllaWallShape
      • ScyllaWallWithDoorShape
      • ScyllaWallWithWindowShape
      • ShapeMaterialCache
      • ShelvedWallColoringMode
      • SignColoringMode
      • Size2D
      • Size3D
      • SkirtedWallColoringMode
      • Sphere3D
      • StairsColoringMode
      • UniformColorResolver
    • Scylla.Core.Util.Math
      • Complex
      • MathUtil
      • Monomial
      • Polynomial
    • Scylla.Core.Util.Noise
      • CellularDistanceType
      • CellularReturnType
      • CellularSettings
      • FractalType
      • NoiseAlgorithm
      • NoiseCurlSampler
      • NoiseDomainWarper
      • NoiseGenerator
      • NoiseSettings
      • PixelNoise
      • PixelNoiseDistribution
      • PixelNoiseSettings
      • WarpSettings
    • Scylla.Core.Util.Palette
      • ColorAssetRegistry
      • ColorGradient
      • ColorGradientAlphaStop
      • ColorGradientAlphaStopData
      • ColorGradientAsset
      • ColorGradientColorSpace
      • ColorGradientData
      • ColorGradientMode
      • ColorGradientStop
      • ColorGradientStopData
      • ColorGradientStopInterpolation
      • ColorPalette
      • ColorPaletteAsset
      • ColorPaletteData
      • ColorPaletteEntry
      • ColorPaletteEntryData
      • ColorPaletteMapping
      • ColorRole
      • ColorStopBlendMode
      • ColorSwatchCollection
      • ColorSwatchCollectionAsset
      • ColorSwatchCollectionData
      • ColorSwatchEntryData
      • MutableColorGradient
      • MutableColorPalette
    • Scylla.Core.Util.ProceduralMapGen
      • BSPSettings
      • CellularAutomataSettings
      • CorridorStyle
      • DoorAxis
      • DoorPlacement
      • DoorPlacementSettings
      • DoorShapeConfig
      • DrunkardWalkSettings
      • FloorplanSettings
      • InstantiationResult
      • MapCellType
      • MapCorridor<TCoord>
      • MapGenResult<TCoord>
      • MapGenSettings
      • MapOverlaySettings
      • MapPatternType
      • MapRoom<TCoord>
      • MazeRoomSettings
      • MazeSettings
      • NoiseThresholdSettings
      • ProceduralMapGenerator
      • ProceduralMapOverlay
      • ProceduralMapPostProcessor
      • RoomCorridorSettings
      • RoomGroup
      • ScyllaProceduralMapInstantiator
      • VoronoiRegionSettings
      • WindingCorridorSettings
    • Scylla.Core.Util.Random
      • AliasTable
      • CryptoRandomSource
      • DiceRoll
      • IProbabilityInfluence
      • IRandomSource
      • MersenneTwister
      • MersenneTwisterState
      • PCG32
      • PCG32State
      • PickHistory
      • PickRecord
      • PoissonDiskSampler
      • PoissonDiskSampler.BoundChecker
      • ProbabilityEntry<T>
      • ProbabilityList<T>
      • ProbabilityNormalizer
      • RandomAlgorithm
      • RandomExtensions
      • RandomID
      • RandomSeeder
      • RandomText
      • RandomUtil
      • RandomUtil.DeterministicRNG
      • RandomUtil.DeterministicRNGState
      • RepeatPreventionMode
      • SelectionStrategy
      • SplitMix64RNG
      • SplitMix64State
      • SystemRandomSource
      • UnityRandomSource
      • Xoroshiro128Plus
      • Xoroshiro128State
      • Xoshiro256StarStar
      • Xoshiro256State
    • Scylla.Core.Util.Ranges
      • DoubleRange
      • FloatRange
      • IntRange
    • Scylla.Core.Util.Serialization
      • ArraySerializer<T>
      • BoolSerializer
      • BoundsSerializer
      • ByteArraySerializer
      • ByteSerializer
      • CharSerializer
      • Color32Serializer
      • ColorSerializer
      • DateTimeOffsetSerializer
      • DateTimeSerializer
      • DecimalSerializer
      • DefaultValueHandling
      • DictionarySerializer<TKey, TValue>
      • DoubleSerializer
      • EnumSerializer<T>
      • FloatSerializer
      • GuidSerializer
      • HashSetSerializer<T>
      • IScyllaReader
      • IScyllaWriter
      • ISerializationContext
      • ITypeSerializer
      • ITypeSerializer<T>
      • IntSerializer
      • LayerMaskSerializer
      • ListSerializer<T>
      • LongSerializer
      • NullHandling
      • PropertyMetadata
      • QuaternionSerializer
      • QueueSerializer<T>
      • RectIntSerializer
      • RectSerializer
      • ReferenceHandling
      • ReferenceTracker
      • ReflectionSerializer
      • SByteSerializer
      • ScyllaIgnoreAttribute
      • ScyllaIncludeAttribute
      • ScyllaJSONReader
      • ScyllaJSONWriter
      • ScyllaMigrationAttribute
      • ScyllaPropertyAttribute
      • ScyllaSerializableAttribute
      • ScyllaSerialization
      • SerializationContext
      • SerializationEngine
      • SerializationException
      • SerializationFormat
      • SerializationResult
      • SerializationResult<T>
      • SerializationSettings
      • SerializationSettings.Builder
      • SerializationToken
      • ShortSerializer
      • StackSerializer<T>
      • StringSerializer
      • TimeSpanSerializer
      • TypeMetadata
      • TypeMetadataCache
      • TypeSerializerAdapter<T>
      • TypeSerializerBase<T>
      • UIntSerializer
      • ULongSerializer
      • UShortSerializer
      • Vector2IntSerializer
      • Vector2Serializer
      • Vector3IntSerializer
      • Vector3Serializer
      • Vector4Serializer
    • Scylla.Core.Util.Tween
      • Ease
      • EaseType
      • ITween
      • LoopType
      • ScyllaShapeTweenExtensions
      • ScyllaTween
      • SequenceItem
      • SequenceItemType
      • TweenAudioSourceExtensions
      • TweenBase
      • TweenCanvasGroupExtensions
      • TweenColor
      • TweenErrorCode
      • TweenException
      • TweenExtensions
      • TweenFloat
      • TweenID
      • TweenLerp
      • TweenManager
      • TweenMaterialExtensions
      • TweenPool
      • TweenQuaternion
      • TweenRectTransformExtensions
      • TweenSequence
      • TweenSettings
      • TweenSpriteRendererExtensions
      • TweenState
      • TweenTransformExtensions
      • TweenVector2
      • TweenVector3
      • TweenVector4
      • Tween<T>
    • Scylla.Core.Util.UI
      • DebugCanvasUtil
      • GradientBackground
      • IUIText
      • IUITextField
      • LineScrollTextArea
      • LineScrollTextAreaBuilder
      • LineScrollTextBuffer
      • LineScrollTextBuffer.Builder
      • LineScrollTextBuffer.LogicalLine
      • LineScrollTextBufferLineAddedEvent
      • LineScrollTextBufferScrolledEvent
      • LineScrollWindow
      • LineScrollWindow.Enumerator
      • ScrollDirection
      • ScrollPhysics
      • ScrollTextArea
      • ScrollTextAreaBuilder
      • ScrollTextAreaDragEndedEvent
      • ScrollTextAreaDragStartedEvent
      • ScrollTextAreaScrolledEvent
      • ScrollTextBuffer
      • ScrollTextBuffer.Builder
      • ScrollTextBuffer.ScrollTextLine
      • ScrollTextBufferLineAddedEvent
      • ScrollTextLineView
      • ScyllaScrollRect
      • ScyllaUIAdaptiveStack
      • ScyllaUIAlignment
      • ScyllaUIAspectBreakpoint
      • ScyllaUICrossAlignment
      • ScyllaUIEdgeInsets
      • ScyllaUIFitMode
      • ScyllaUIFlexElement
      • ScyllaUIGrid
      • ScyllaUIGridItem
      • ScyllaUIHStack
      • ScyllaUILayoutAnimator
      • ScyllaUILayoutDebugDraw
      • ScyllaUILayoutDebugDrawConfig
      • ScyllaUILayoutGizmos
      • ScyllaUILayoutRoot
      • ScyllaUILayoutStyle
      • ScyllaUILength
      • ScyllaUILengthUnit
      • ScyllaUIPositioned
      • ScyllaUIScreenMargin
      • ScyllaUISizeMode
      • ScyllaUISpacer
      • ScyllaUIStackBase
      • ScyllaUIText
      • ScyllaUITextGroup
      • ScyllaUITrack
      • ScyllaUITrackSizingMode
      • ScyllaUIVStack
      • ScyllaUIZStack
      • TMPSettings
      • TMPUtil
      • TextSelectionPosition
      • TextSelectionRange
      • UIAlignment
      • UIAnchor
      • UIAnchors
      • UIFontReference
      • UIFontStyle
      • UIMargin
      • UIPadding
      • UITextBuilder
      • UITextComponent
      • UITextFactory
      • UITextFieldBuilder
      • UITextFieldComponent
      • UIUtil
      • VisualLine
    • Scylla.Core.Util.Units
      • AreaUnit
      • DataUnit
      • LengthUnit
      • MassUnit
      • PressureUnit
      • SpeedUnit
      • TemperatureUnit
      • TimeFormat
      • TimeUnit

    Class MathUtil

    Provides advanced mathematical utilities for game development including coordinate conversions, physics-based smoothing, geometry calculations, and camera frustum operations.

    Inheritance
    object
    MathUtil
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Scylla.Core.Util.Math
    Assembly: ScyllaCore.dll
    Syntax
    public static class MathUtil
    Remarks

    MathUtil focuses on higher-level spatial mathematics that are frequently needed in game logic, camera systems, and physics integrations:

    • Exponential/power functions for non-integer exponents.
    • Normalization and denormalization between arbitrary ranges and [0, 1].
    • Angle clamping and wrapping to the [-PI, PI] range.
    • Bidirectional conversion between Cartesian, spherical, cylindrical, and polar coordinate systems.
    • Vector flattening and rotation correction helpers.
    • Spring-damper smooth damping and constant-speed convergence for value animation.
    • 3D geometry utilities: plane intersection, grid snapping, plane projection, and closest-point-on-segment queries.
    • Legacy camera frustum corner extraction (see Scylla.Core.Util.Math.MathUtil.GetNearPlaneCorners(UnityEngine.Camera) for the deprecation note).

    For basic numeric operations such as clamping, rounding, floating-point comparison, and safe division, see NumberUtil.

    Methods

    CartesianToCylindrical(Vector3)

    Converts a 3D Cartesian position to cylindrical coordinates (r, theta, height).

    Declaration
    public static Vector3 CartesianToCylindrical(Vector3 cartesian)
    Parameters
    Type Name Description
    Vector3 cartesian

    The Cartesian position (x, y, z) to convert. The y component represents height and is passed through unchanged.

    Returns
    Type Description
    Vector3

    A UnityEngine.Vector3 encoding the cylindrical coordinates:

    • x - radial distance r from the Y axis (always non-negative).
    • y - azimuthal angle theta in the XZ plane measured from the positive Z axis, in radians, in the range (-PI, PI].
    • z - height, identical to the input y component.
    Remarks

    Unity's coordinate system places the vertical axis on Y. The cylindrical azimuthal angle theta is therefore measured in the XZ plane, not XY. To convert back, use CylindricalToCartesian(Vector3).

    See Also
    CylindricalToCartesian(Vector3)

    CartesianToPolar(Vector2)

    Converts a 2D Cartesian position to polar coordinates, with the angle measured from the positive X axis.

    Declaration
    public static Vector2 CartesianToPolar(Vector2 cartesian)
    Parameters
    Type Name Description
    Vector2 cartesian

    The 2D Cartesian position (x, y) to convert. The zero vector produces a radius of 0 and an angle of 0.

    Returns
    Type Description
    Vector2

    A UnityEngine.Vector2 encoding the polar coordinates:

    • x - radial distance r from the origin (always non-negative).
    • y - angle theta measured counter-clockwise from the positive X axis, in radians, in the range (-PI, PI].
    Remarks

    This overload follows the standard mathematical convention where the reference direction is the positive X axis. This differs from the 3D overload CartesianToPolar(Vector3), which measures the angle from the positive Z axis in the XZ plane.

    See Also
    CartesianToPolar(Vector3)
    PolarToCartesian(Vector2)

    CartesianToPolar(Vector3)

    Converts a 3D Cartesian position to 2D polar coordinates by projecting onto the XZ plane and ignoring the Y component.

    Declaration
    public static Vector2 CartesianToPolar(Vector3 cartesian)
    Parameters
    Type Name Description
    Vector3 cartesian

    The 3D Cartesian position. The y component is ignored; only the XZ plane coordinates are used.

    Returns
    Type Description
    Vector2

    A UnityEngine.Vector2 encoding the polar coordinates:

    • x - radial distance r from the origin in the XZ plane (always non-negative).
    • y - azimuthal angle theta measured from the positive Z axis, in radians, in the range (-PI, PI].
    Remarks

    This overload is useful for top-down or strategy-style calculations where vertical height is irrelevant. For a full 2D polar conversion from a UnityEngine.Vector2 measured from the positive X axis, use CartesianToPolar(Vector2).

    See Also
    CartesianToPolar(Vector2)
    PolarToCartesian3D(Vector2)

    CartesianToSpherical(Vector3)

    Converts a 3D Cartesian position to spherical coordinates (rho, theta, phi).

    Declaration
    public static Vector3 CartesianToSpherical(Vector3 cartesian)
    Parameters
    Type Name Description
    Vector3 cartesian

    The Cartesian position (x, y, z) to convert. The origin (zero vector) returns UnityEngine.Vector3.zero to avoid a division-by-zero when computing angles.

    Returns
    Type Description
    Vector3

    A UnityEngine.Vector3 encoding the spherical coordinates:

    • x - radial distance rho from the origin (always non-negative).
    • y - azimuthal angle theta in the XZ plane measured from the positive Z axis, in radians, in the range (-PI, PI].
    • z - polar angle phi measured from the positive Y axis, in radians, in the range [0, PI].
    Remarks

    The convention used here follows the physics/ISO convention where phi is the polar (colatitude) angle from the Y axis, not the elevation angle from the XZ plane. This is the inverse of SphericalToCartesian(Vector3).

    If cartesian is the zero vector (magnitude below float.Epsilon), the method returns UnityEngine.Vector3.zero rather than computing undefined angular values.

    See Also
    SphericalToCartesian(Vector3)

    ClosestPointOnLine(Vector3, Vector3, Vector3)

    Finds the closest point on a line segment to a given point.

    Declaration
    public static Vector3 ClosestPointOnLine(Vector3 point, Vector3 lineStart, Vector3 lineEnd)
    Parameters
    Type Name Description
    Vector3 point

    The world-space point for which to find the nearest position on the segment.

    Vector3 lineStart

    The start endpoint of the line segment.

    Vector3 lineEnd

    The end endpoint of the line segment. If lineEnd equals lineStart (degenerate segment with zero length), the method returns lineStart directly.

    Returns
    Type Description
    Vector3

    The point on the segment [lineStart, lineEnd] that is closest to point. The result is always on or between the two endpoints; it is never extrapolated beyond the segment boundaries.

    Remarks

    The parameter t along the segment is computed as the dot product of the offset vector and the segment direction, divided by the squared segment length, then clamped to [0, 1] to restrict the result to the segment rather than the infinite line.

    ConvergeToValue(float, float, float, float)

    Moves current toward target at a constant rate of speed units per second, clamping at the target so the value never overshoots.

    Declaration
    public static float ConvergeToValue(float target, float current, float deltaTime, float speed)
    Parameters
    Type Name Description
    float target

    The value to converge toward. May be greater than, less than, or equal to current.

    float current

    The current value before the step is applied.

    float deltaTime

    The elapsed time since the last call, in seconds. Typically Time.deltaTime. Use a fixed delta when deterministic behavior is required.

    float speed

    The convergence rate in units per second. Must be non-negative; a value of 0 returns current unchanged.

    Returns
    Type Description
    float

    The new value after advancing by deltaTime * speed toward the target. Returns target exactly once the step would overshoot.

    Remarks

    Unlike SmoothDamp(float, float, ref float, float, float, float), this method moves at a constant linear speed rather than applying a spring-damper model. It is useful for UI meters, health bars, or any animation that should arrive at its target in a predictable, frame-rate-independent time.

    See Also
    SmoothDamp(float, float, ref float, float, float, float)

    CorrectRotationUp(ref Quaternion)

    Corrects a quaternion rotation so that its derived up vector aligns with the world up vector (UnityEngine.Vector3.up), while preserving the forward direction.

    Declaration
    public static void CorrectRotationUp(ref Quaternion rotation)
    Parameters
    Type Name Description
    Quaternion rotation

    The rotation to correct. Modified in place. If the forward vector of rotation is nearly parallel to UnityEngine.Vector3.up (within a dot product of 0.999), a fallback forward direction derived from UnityEngine.Vector3.right and UnityEngine.Vector3.up is used to avoid a degenerate cross product.

    Remarks

    This method is particularly useful for stabilizing character or camera rotations that have accumulated roll due to quaternion interpolation or physics integration. It reconstructs the rotation matrix from scratch using the Gram-Schmidt orthogonalization approach: forward is kept, right is computed as the cross product of world up and forward, and the corrected up is computed as the cross product of forward and right.

    The edge case - when forward is nearly collinear with world up, such as when a character looks straight up or down - is handled by substituting a safe fallback forward so that the resulting right vector remains valid.

    CylindricalToCartesian(Vector3)

    Converts cylindrical coordinates (r, theta, height) to a 3D Cartesian position.

    Declaration
    public static Vector3 CylindricalToCartesian(Vector3 cylindrical)
    Parameters
    Type Name Description
    Vector3 cylindrical

    The cylindrical coordinates encoded as a UnityEngine.Vector3:

    • x - radial distance r from the Y axis.
    • y - azimuthal angle theta in the XZ plane, in radians.
    • z - height along the Y axis.
    Returns
    Type Description
    Vector3

    The Cartesian position (x, y, z) corresponding to the given cylindrical coordinates. The y component of the result is the height value from the input z component.

    See Also
    CartesianToCylindrical(Vector3)

    Denormalize(float, float, float)

    Converts a normalized value in [0, 1] back to the range [min, max].

    Declaration
    public static float Denormalize(float normalized, float min, float max)
    Parameters
    Type Name Description
    float normalized

    The normalized value to map into the output range. Values outside [0, 1] are clamped before the conversion, so the result is always within [min, max].

    float min

    The lower bound of the output range. A normalized value of 0 maps exactly to this value.

    float max

    The upper bound of the output range. A normalized value of 1 maps exactly to this value.

    Returns
    Type Description
    float

    A value in [min, max] corresponding to the given normalized position.

    See Also
    Normalize(float, float, float)

    ExpDecay(float, float, float, float)

    Moves current toward target using framerate-independent exponential decay. Unlike a plain lerp with a constant factor, the result is identical whether the same wall-clock time is simulated in one large step or many small ones.

    Declaration
    public static float ExpDecay(float current, float target, float lambda, float deltaTime)
    Parameters
    Type Name Description
    float current

    The current value.

    float target

    The value to approach.

    float lambda

    The decay rate per second. Higher values converge faster. The remaining distance halves every ln(2) / lambda ≈ 0.693 / lambda seconds; a lambda of about 7 gives a half-life of roughly 0.1 seconds.

    float deltaTime

    The elapsed time since the previous call, in seconds.

    Returns
    Type Description
    float

    The decayed value: target + (current - target) * e^(-lambda * deltaTime).

    Remarks

    Prefer this over a constant-factor lerp in per-frame smoothing code: the constant-factor lerp converges at different speeds depending on the framerate, while exponential decay does not. For spring-like motion with velocity continuity, use SmoothDamp(float, float, ref float, float, float, float) instead.

    See Also
    SmoothDamp(float, float, ref float, float, float, float)

    ExpDecay(Quaternion, Quaternion, float, float)

    Rotates current toward target using framerate-independent exponential decay. Quaternion counterpart of ExpDecay(float, float, float, float), implemented as a spherical interpolation with a decay-derived factor.

    Declaration
    public static Quaternion ExpDecay(Quaternion current, Quaternion target, float lambda, float deltaTime)
    Parameters
    Type Name Description
    Quaternion current

    The current rotation.

    Quaternion target

    The rotation to approach.

    float lambda

    The decay rate per second. Higher values converge faster. The remaining angular distance halves every ln(2) / lambda seconds.

    float deltaTime

    The elapsed time since the previous call, in seconds.

    Returns
    Type Description
    Quaternion

    The rotation advanced toward the target by the factor 1 - e^(-lambda * deltaTime).

    See Also
    ExpDecay(float, float, float, float)

    ExpDecay(Vector3, Vector3, float, float)

    Moves current toward target using framerate-independent exponential decay. Vector counterpart of ExpDecay(float, float, float, float); all three components decay with the same factor, so the motion follows a straight line toward the target.

    Declaration
    public static Vector3 ExpDecay(Vector3 current, Vector3 target, float lambda, float deltaTime)
    Parameters
    Type Name Description
    Vector3 current

    The current value.

    Vector3 target

    The value to approach.

    float lambda

    The decay rate per second. Higher values converge faster. The remaining distance halves every ln(2) / lambda seconds.

    float deltaTime

    The elapsed time since the previous call, in seconds.

    Returns
    Type Description
    Vector3

    The decayed value: target + (current - target) * e^(-lambda * deltaTime).

    See Also
    ExpDecay(float, float, float, float)

    ExpN(float, float)

    Calculates x raised to the power of n using exponential and natural-logarithm functions, supporting non-integer exponents.

    Declaration
    public static float ExpN(float x, float n)
    Parameters
    Type Name Description
    float x

    The base value. Must be strictly positive (> 0). When x is zero or negative the method returns 0 immediately rather than producing a NaN from Mathf.Log.

    float n

    The exponent. May be any real number including fractional and negative values.

    Returns
    Type Description
    float

    The result of x^n computed as exp(n * ln(x)), or 0 if x is less than or equal to zero.

    Remarks

    This method is equivalent to Mathf.Pow(x, n) for positive bases but is provided for cases where the caller explicitly works in the exp/log domain (for example, chaining multiple power operations without intermediate clamping). For integer exponents over a positive base, Mathf.Pow is equivalent and may be marginally faster.

    FlattenXZ(Vector3)

    Projects v onto the XZ plane (sets Y to zero), then returns the normalized result.

    Declaration
    public static Vector3 FlattenXZ(Vector3 v)
    Parameters
    Type Name Description
    Vector3 v

    The input vector. The Y component is discarded before normalization. If the resulting XZ vector has a squared magnitude below float.Epsilon (i.e., the vector points nearly straight up or down), the method returns UnityEngine.Vector3.zero rather than producing a NaN from normalizing a near-zero vector.

    Returns
    Type Description
    Vector3

    A unit vector in the XZ plane pointing in the same horizontal direction as v, or UnityEngine.Vector3.zero if the XZ projection is effectively zero.

    Remarks

    Commonly used in character controller and camera code to extract a horizontal movement direction from a 3D velocity without the vertical component influencing the direction or causing normalization artifacts. Use FlattenXZRaw(Vector3) if the raw un-normalized XZ vector is needed.

    See Also
    FlattenXZRaw(Vector3)

    FlattenXZRaw(Vector3)

    Projects v onto the XZ plane by setting Y to zero, without normalizing the result.

    Declaration
    public static Vector3 FlattenXZRaw(Vector3 v)
    Parameters
    Type Name Description
    Vector3 v

    The input vector. The X and Z components are preserved unchanged; only Y is zeroed.

    Returns
    Type Description
    Vector3

    A copy of v with the Y component set to zero. The magnitude and XZ components are unchanged.

    Remarks

    Use this overload when the original XZ magnitude must be retained (for example, when extracting horizontal velocity from a physics body). For a normalized horizontal direction, use FlattenXZ(Vector3) instead.

    See Also
    FlattenXZ(Vector3)

    Intersection3Planes(Plane, Plane, Plane)

    Calculates the unique intersection point of three planes.

    Declaration
    public static Vector3? Intersection3Planes(Plane p0, Plane p1, Plane p2)
    Parameters
    Type Name Description
    Plane p0

    The first plane.

    Plane p1

    The second plane.

    Plane p2

    The third plane.

    Returns
    Type Description
    Vector3?

    The world-space point where all three planes meet, or null if the planes do not intersect at a unique point. This occurs when at least two planes are parallel (the scalar triple product of their normals is zero within floating-point tolerance as tested by Mathf.Approximately).

    Remarks

    The intersection is computed using Cramer's rule applied to the linear system formed by the three plane equations:

    P = (-d0 * (n1 × n2) - d1 * (n2 × n0) - d2 * (n0 × n1)) / (n0 · (n1 × n2))

    where d is the signed distance from the plane to the origin as stored in Plane.distance, and n is the plane normal.

    See Also
    GetNearPlaneCorners(Camera)

    Logistic(float, float, float)

    Evaluates the standard logistic function, a smooth S-shaped curve that maps any real input into the open interval (0, 1).

    Declaration
    public static float Logistic(float x, float steepness = 1, float midpoint = 0)
    Parameters
    Type Name Description
    float x

    The input value.

    float steepness

    Controls how sharply the curve transitions around midpoint. Larger values produce a steeper step; a value of 0 collapses the output to 0.5.

    float midpoint

    The input value at which the output is exactly 0.5 (the inflection point).

    Returns
    Type Description
    float

    1 / (1 + exp(-steepness * (x - midpoint))), a value in (0, 1). The bounds are approached asymptotically and never reached for finite input.

    Remarks

    The logistic curve is exponential and approaches its bounds asymptotically, so it does not pass through (0, 0) or (1, 1) exactly. Callers needing a curve pinned to those endpoints (for example a response curve over a normalized [0, 1] input) should renormalize the output against Logistic(0, ...) and Logistic(1, ...).

    See Also
    Sigmoid(float, float, float)

    Normalize(float, float, float)

    Normalizes value from the range [min, max] to [0, 1].

    Declaration
    public static float Normalize(float value, float min, float max)
    Parameters
    Type Name Description
    float value

    The value to normalize. Values outside [min, max] are clamped to the range before normalization, so the result is always in [0, 1].

    float min

    The minimum bound of the input range, mapping to 0 in the output.

    float max

    The maximum bound of the input range, mapping to 1 in the output. Must be greater than min; if max is less than or equal to min, the method returns 1 as a safe fallback.

    Returns
    Type Description
    float

    A value in [0, 1] representing the normalized position of value within the specified range, or 1 when the range is degenerate (max <= min).

    See Also
    Denormalize(float, float, float)

    PolarToCartesian(Vector2)

    Converts 2D polar coordinates to a 2D Cartesian position, with the angle measured from the positive X axis.

    Declaration
    public static Vector2 PolarToCartesian(Vector2 polar)
    Parameters
    Type Name Description
    Vector2 polar

    The polar coordinates encoded as a UnityEngine.Vector2:

    • x - radial distance (radius) from the origin.
    • y - angle theta measured counter-clockwise from the positive X axis, in radians.
    Returns
    Type Description
    Vector2

    The 2D Cartesian position (x, y) corresponding to the given polar coordinates.

    Remarks

    This is the inverse of CartesianToPolar(Vector2). The angle convention (measured from positive X) matches the 2D overload of CartesianToPolar(Vector2), not the 3D one.

    See Also
    CartesianToPolar(Vector2)
    PolarToCartesian3D(Vector2)

    PolarToCartesian3D(Vector2)

    Converts 2D polar coordinates to a 3D Cartesian position in the XZ plane, with the Y component set to zero.

    Declaration
    public static Vector3 PolarToCartesian3D(Vector2 polar)
    Parameters
    Type Name Description
    Vector2 polar

    The polar coordinates encoded as a UnityEngine.Vector2:

    • x - radial distance (radius) from the origin.
    • y - angle theta measured from the positive Z axis, in radians.
    Returns
    Type Description
    Vector3

    A 3D Cartesian position (x, 0, z) in the XZ plane. The Y component is always 0; add a Y offset after the call if a non-zero height is needed.

    Remarks

    This is the inverse of CartesianToPolar(Vector3). The angle convention (measured from positive Z) matches the 3D overload, not the 2D one.

    See Also
    CartesianToPolar(Vector3)
    PolarToCartesian(Vector2)

    ProjectOnPlane(Vector3, Plane)

    Projects a point in 3D space onto a plane, returning the nearest point on the plane's surface.

    Declaration
    public static Vector3 ProjectOnPlane(Vector3 point, Plane plane)
    Parameters
    Type Name Description
    Vector3 point

    The world-space point to project. Any point is valid, including points already on the plane (which are returned unchanged within floating-point precision).

    Plane plane

    The plane to project onto. The plane's normal must be normalized; Plane objects created via the Unity API are always normalized.

    Returns
    Type Description
    Vector3

    The point on plane closest to point, computed by subtracting the signed distance along the plane normal.

    Remarks

    This is equivalent to Vector3.ProjectOnPlane(point - origin, plane.normal)

    • origin but uses the Plane struct's built-in distance API for clarity.

    Sigmoid(float, float, float)

    Evaluates a bounded algebraic sigmoid, a smooth S-shaped curve that maps any real input into [0, 1] without using an exponential.

    Declaration
    public static float Sigmoid(float x, float steepness = 1, float midpoint = 0)
    Parameters
    Type Name Description
    float x

    The input value.

    float steepness

    Controls how sharply the curve transitions around midpoint. Larger values produce a steeper step; a value of 0 collapses the output to 0.5.

    float midpoint

    The input value at which the output is exactly 0.5.

    Returns
    Type Description
    float

    0.5 + 0.5 * s / (1 + |s|) with s = steepness * (x - midpoint), a value in (0, 1) that approaches the bounds asymptotically.

    Remarks

    This algebraic form avoids Mathf.Exp and is cheaper than Logistic(float, float, float) while producing a similar shape. Like the logistic curve it is asymptotic, so it does not reach 0 or 1 for finite input.

    See Also
    Logistic(float, float, float)

    SmoothDamp(float, float, ref float, float, float, float)

    Smoothly damps current toward target using a critically damped spring model, equivalent to Unity's Mathf.SmoothDamp.

    Declaration
    public static float SmoothDamp(float current, float target, ref float currentVelocity, float smoothTime, float maxSpeed, float deltaTime)
    Parameters
    Type Name Description
    float current

    The current value at the start of this step.

    float target

    The value to approach. The function clamps how far the value can move per step based on maxSpeed and smoothTime to prevent runaway behavior when the target changes abruptly.

    float currentVelocity

    The current velocity of the smoothed value, maintained across calls to produce continuous motion. Initialize to 0 before the first call and pass the same variable on every subsequent call; the method updates it in place.

    float smoothTime

    The approximate time (in seconds) for the value to reach the target under ideal conditions. Smaller values produce a faster, snappier response. Must be positive; values below 0.0001 are clamped to that minimum internally.

    float maxSpeed

    The maximum rate of change per second. Use float.PositiveInfinity to impose no speed limit. Lower values prevent the value from snapping too quickly when the target changes by a large amount in a single frame.

    float deltaTime

    The elapsed time since the previous call, in seconds. Typically Time.deltaTime or Time.fixedDeltaTime depending on the update context.

    Returns
    Type Description
    float

    The smoothed value after advancing one step toward the target. The value will not overshoot the target; if the computed result would pass the target, it is clamped to the target and the velocity is reset accordingly.

    Remarks

    This is a custom implementation of the same critically damped spring algorithm used by Unity's Mathf.SmoothDamp. It is provided here so that game systems that do not directly reference Mathf can use the same algorithm through the Scylla utility layer.

    The polynomial approximation for the exponential term (exp ≈ 1 / (1 + x + 0.48x² + 0.235x³)) is the same approximation used by Unity and produces results accurate enough for all game use cases while avoiding a call to Mathf.Exp.

    See Also
    ConvergeToValue(float, float, float, float)

    SmoothDamp(Vector3, Vector3, ref Vector3, float, float, float)

    Smoothly damps current toward target using a critically damped spring model, equivalent to Unity's Vector3.SmoothDamp. This is the vector counterpart of the scalar SmoothDamp(float, float, ref float, float, float, float) overload.

    Declaration
    public static Vector3 SmoothDamp(Vector3 current, Vector3 target, ref Vector3 currentVelocity, float smoothTime, float maxSpeed, float deltaTime)
    Parameters
    Type Name Description
    Vector3 current

    The current position or value at the start of this step.

    Vector3 target

    The value to approach. The per-step change is magnitude-clamped based on maxSpeed and smoothTime to prevent runaway behavior when the target jumps by a large amount.

    Vector3 currentVelocity

    The current velocity of the smoothed value, maintained across calls to produce continuous motion. Initialize to Vector3.zero before the first call and pass the same variable on every subsequent call; the method updates it in place.

    float smoothTime

    The approximate time (in seconds) for the value to reach the target under ideal conditions. Smaller values produce a faster, snappier response. Must be positive; values below 0.0001 are clamped to that minimum internally.

    float maxSpeed

    The maximum rate of change per second. Use float.PositiveInfinity to impose no speed limit.

    float deltaTime

    The elapsed time since the previous call, in seconds. Typically Time.deltaTime or Time.fixedDeltaTime depending on the update context.

    Returns
    Type Description
    Vector3

    The smoothed value after advancing one step toward the target. The value does not overshoot the target; if the computed step would pass it, the result is clamped to the target and the velocity is zeroed accordingly.

    Remarks

    Uses the same polynomial approximation for the exponential term (exp ≈ 1 / (1 + x + 0.48x² + 0.235x³)) as the scalar overload and as Unity's own implementation, applied componentwise with a vector magnitude clamp on the per-step change.

    See Also
    SmoothDamp(float, float, ref float, float, float, float)
    ExpDecay(Vector3, Vector3, float, float)

    SmoothDampAngle(float, float, ref float, float, float, float)

    Smoothly damps an angle in degrees toward a target angle using the critically damped spring model of SmoothDamp(float, float, ref float, float, float, float), taking the shortest path around the circle (correctly crossing the 0/360 boundary).

    Declaration
    public static float SmoothDampAngle(float current, float target, ref float currentVelocity, float smoothTime, float maxSpeed, float deltaTime)
    Parameters
    Type Name Description
    float current

    The current angle in degrees.

    float target

    The target angle in degrees.

    float currentVelocity

    The current angular velocity in degrees per second, maintained across calls. Initialize to 0 before the first call and pass the same variable on every subsequent call; the method updates it in place.

    float smoothTime

    The approximate time (in seconds) for the angle to reach the target. Must be positive; values below 0.0001 are clamped to that minimum internally.

    float maxSpeed

    The maximum angular rate of change in degrees per second. Use float.PositiveInfinity to impose no speed limit.

    float deltaTime

    The elapsed time since the previous call, in seconds.

    Returns
    Type Description
    float

    The smoothed angle in degrees after advancing one step toward the target. The returned angle is continuous with current and is not wrapped into any particular range.

    See Also
    SmoothDamp(float, float, ref float, float, float, float)
    DeltaAngleDeg(float, float)

    SnapToGrid(Vector2, float)

    Snaps a 2D position to the nearest point on a uniform 2D grid.

    Declaration
    public static Vector2 SnapToGrid(Vector2 position, float gridSize)
    Parameters
    Type Name Description
    Vector2 position

    The position to snap. Each component is independently rounded to the nearest multiple of gridSize.

    float gridSize

    The cell size of the grid. Must be greater than zero; a value of zero or less returns position unchanged to avoid a division-by-zero.

    Returns
    Type Description
    Vector2

    A UnityEngine.Vector2 with each component rounded to the nearest multiple of gridSize.

    See Also
    SnapToGrid(Vector3, float)

    SnapToGrid(Vector3, float)

    Snaps a 3D position to the nearest point on a uniform 3D grid.

    Declaration
    public static Vector3 SnapToGrid(Vector3 position, float gridSize)
    Parameters
    Type Name Description
    Vector3 position

    The world-space position to snap. Each component is independently rounded to the nearest multiple of gridSize.

    float gridSize

    The cell size of the grid. Must be greater than zero; a value of zero or less returns position unchanged to avoid a division-by-zero.

    Returns
    Type Description
    Vector3

    A UnityEngine.Vector3 with each component rounded to the nearest multiple of gridSize. For example, with a grid size of 0.5f, the value 1.3f snaps to 1.5f.

    See Also
    SnapToGrid(Vector2, float)

    SphericalToCartesian(Vector3)

    Converts spherical coordinates (rho, theta, phi) to a 3D Cartesian position.

    Declaration
    public static Vector3 SphericalToCartesian(Vector3 spherical)
    Parameters
    Type Name Description
    Vector3 spherical

    The spherical coordinates encoded as a UnityEngine.Vector3:

    • x - radial distance rho from the origin.
    • y - azimuthal angle theta in the XZ plane measured from the positive Z axis, in radians.
    • z - polar angle phi from the positive Y axis, in radians. Should be in [0, PI] for standard usage.
    Returns
    Type Description
    Vector3

    The Cartesian position (x, y, z) corresponding to the given spherical coordinates.

    See Also
    CartesianToSpherical(Vector3)

    Swap<T>(ref T, ref T)

    Swaps the values of two variables in place.

    Declaration
    public static void Swap<T>(ref T a, ref T b)
    Parameters
    Type Name Description
    T a

    The first variable. Receives the original value of b after the call.

    T b

    The second variable. Receives the original value of a after the call.

    Type Parameters
    Name Description
    T

    The type of the values to swap. Any type is accepted; value types are swapped by copy and reference types have their references exchanged.

    ToCartesian(float, float)

    Converts spherical yaw and pitch angles to a unit Cartesian direction vector and returns the result.

    Declaration
    public static Vector3 ToCartesian(float yaw, float pitch)
    Parameters
    Type Name Description
    float yaw

    The horizontal rotation angle (azimuth) around the Y axis, in radians. A value of 0 points along the positive Z axis; positive values rotate toward the positive X axis.

    float pitch

    The vertical elevation angle, in radians. A value of 0 keeps the direction on the XZ plane; positive values tilt upward toward positive Y. Values should be in [-PI/2, PI/2] to produce meaningful directions.

    Returns
    Type Description
    Vector3

    The unit direction vector in Cartesian (x, y, z) coordinates corresponding to the given yaw and pitch.

    Remarks

    This overload is a convenience wrapper that delegates to ToCartesian(float, float, out Vector3). Use the out overload when writing into an existing variable to avoid an extra copy.

    See Also
    ToSpherical(Vector3, out float, out float)
    ToCartesian(float, float, out Vector3)

    ToCartesian(float, float, out Vector3)

    Converts spherical yaw and pitch angles to a unit Cartesian direction vector, writing the result to the direction out parameter.

    Declaration
    public static void ToCartesian(float yaw, float pitch, out Vector3 direction)
    Parameters
    Type Name Description
    float yaw

    The horizontal rotation angle (azimuth) around the Y axis, in radians. A value of 0 points along the positive Z axis; positive values rotate toward the positive X axis.

    float pitch

    The vertical elevation angle, in radians. A value of 0 keeps the direction on the XZ plane; positive values tilt upward toward positive Y. Values should be in [-PI/2, PI/2] to produce meaningful directions.

    Vector3 direction

    Receives the resulting unit direction vector in Cartesian (x, y, z) coordinates.

    See Also
    ToSpherical(Vector3, out float, out float)
    ToCartesian(float, float)

    ToPIRange(float)

    Wraps an angle in radians to the canonical range [-PI, PI] and returns the result.

    Declaration
    public static float ToPIRange(float angle)
    Parameters
    Type Name Description
    float angle

    The angle in radians to wrap. May be any finite value including large multi-revolution angles such as 7 * Mathf.PI.

    Returns
    Type Description
    float

    The equivalent angle expressed in the range [-PI, PI].

    Remarks

    This overload is a convenience wrapper that delegates to ToPIRange(ref float). Use the ref overload when modifying an existing variable to avoid a temporary copy.

    See Also
    ToPIRange(ref float)

    ToPIRange(ref float)

    Wraps an angle in radians to the canonical range [-PI, PI] in place.

    Declaration
    public static void ToPIRange(ref float angle)
    Parameters
    Type Name Description
    float angle

    The angle in radians to wrap. Receives the wrapped result directly; values already within [-PI, PI] are still processed by the modulo but are unaffected in practice.

    Remarks

    The method first applies a modulo by 2PI to collapse large multi-revolution values, then adjusts values outside (-PI, PI] by one full revolution. This is useful for maintaining angles in camera and character rotation systems where crossing the ±PI boundary would otherwise cause discontinuities.

    See Also
    ToPIRange(float)

    ToSpherical(Vector3, out float, out float)

    Converts a 3D Cartesian direction vector to spherical yaw and pitch angles.

    Declaration
    public static void ToSpherical(Vector3 direction, out float yaw, out float pitch)
    Parameters
    Type Name Description
    Vector3 direction

    The Cartesian direction vector to convert. Does not need to be normalized; only the direction (ratio of components) is used. A zero vector produces yaw and pitch values of 0.

    float yaw

    Receives the horizontal rotation angle (azimuth) around the Y axis, in radians. Measured from the positive Z axis toward the positive X axis, in the range (-PI, PI].

    float pitch

    Receives the vertical elevation angle, in radians. Positive values tilt upward (toward positive Y), in the range [-PI/2, PI/2].

    Remarks

    This overload produces the yaw and pitch angles used by typical first-person and orbit camera systems. To reconstruct the direction vector from yaw and pitch, call ToCartesian(float, float, out Vector3).

    See Also
    ToCartesian(float, float, out Vector3)
    ToCartesian(float, float)

    See Also

    NumberUtil
    CameraUtil
    In this article
    Back to top Scylla Framework - Core Module API Documentation