Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AESContext
- AStar2D
- AStar3D
- AStarGrid2D
- AudioEffectInstance (1)
- AudioSample
- AudioSamplePlayback
- AudioStreamPlayback (5)
- CameraFeed
- CharFXTransform
- ConfigFile
- Crypto
- DTLSServer
- DirAccess
- ENetConnection
- EditorContextMenuPlugin
- EditorDebuggerPlugin
- EditorDebuggerSession
- EditorExportPlatform (6)
- EditorExportPlugin
- EditorExportPreset
- EditorFeatureProfile
- EditorFileSystemImportFormatSupportQuery
- EditorInspectorPlugin
- EditorResourceConversionPlugin
- EditorResourcePreviewGenerator
- EditorResourceTooltipPlugin
- EditorSceneFormatImporter (4)
- EditorScenePostImport
- EditorScenePostImportPlugin
- EditorScript
- EditorTranslationParserPlugin
- EncodedObjectAsID
- EngineProfiler
- Expression
- FileAccess
- GLTFObjectModelProperty
- HMACContext
- HTTPClient
- HashingContext
- ImageFormatLoader (1)
- JavaClass
- JavaObject
- JavaScriptObject
- KinematicCollision2D
- KinematicCollision3D
- Lightmapper (1)
- MeshConvexDecompositionSettings
- MeshDataTool
- MultiplayerAPI (2)
- Mutex
- NavigationPathQueryParameters2D
- NavigationPathQueryParameters3D
- NavigationPathQueryResult2D
- NavigationPathQueryResult3D
- Node3DGizmo (1)
- OggPacketSequencePlayback
- OpenXRAPIExtension
- PCKPacker
- PackedDataContainerRef
- PacketPeer (8)
- PhysicsPointQueryParameters2D
- PhysicsPointQueryParameters3D
- PhysicsRayQueryParameters2D
- PhysicsRayQueryParameters3D
- PhysicsShapeQueryParameters2D
- PhysicsShapeQueryParameters3D
- PhysicsTestMotionParameters2D
- PhysicsTestMotionParameters3D
- PhysicsTestMotionResult2D
- PhysicsTestMotionResult3D
- RDAttachmentFormat
- RDFramebufferPass
- RDPipelineColorBlendState
- RDPipelineColorBlendStateAttachment
- RDPipelineDepthStencilState
- RDPipelineMultisampleState
- RDPipelineRasterizationState
- RDPipelineSpecializationConstant
- RDSamplerState
- RDShaderSource
- RDTextureFormat
- RDTextureView
- RDUniform
- RDVertexAttribute
- RandomNumberGenerator
- RegEx
- RegExMatch
- RenderSceneBuffers (2)
- RenderSceneBuffersConfiguration
- Resource (103)
- ResourceFormatLoader
- ResourceFormatSaver
- ResourceImporter (16)
- SceneState
- SceneTreeTimer
- Semaphore
- SkinReference
- StreamPeer (5)
- SurfaceTool
- TCPServer
- TLSOptions
- TextLine
- TextParagraph
- TextServer (1)
- Thread
- TranslationDomain
- TriangleMesh
- Tween
- Tweener (5)
- UDPServer
- UPNP
- UPNPDevice
- WeakRef
- WebRTCPeerConnection (1)
- XMLParser
- XRInterface (4)
- XRPose
- XRTracker (2)
- ZIPPacker
- ZIPReader
- Animation
- AnimationLibrary
- AnimationNode (6)
- AnimationNodeStateMachinePlayback
- AnimationNodeStateMachineTransition
- AudioBusLayout
- AudioEffect (17)
- AudioStream (10)
- BitMap
- BoneMap
- ButtonGroup
- CameraAttributes (2)
- ColorPalette
- Compositor
- CompositorEffect
- CryptoKey
- Curve
- Curve2D
- Curve3D
- EditorNode3DGizmoPlugin
- EditorSettings
- Environment
- Font (3)
- GDExtension
- GLTFAccessor
- GLTFAnimation
- GLTFBufferView
- GLTFCamera
- GLTFDocument (1)
- GLTFDocumentExtension (1)
- GLTFLight
- GLTFMesh
- GLTFNode
- GLTFPhysicsBody
- GLTFPhysicsShape
- GLTFSkeleton
- GLTFSkin
- GLTFSpecGloss
- GLTFState (1)
- GLTFTexture
- GLTFTextureSampler
- Gradient
- Image
- ImporterMesh
- InputEvent (6)
- JSON
- LabelSettings
- LightmapGIData
- Material (9)
- Mesh (4)
- MeshLibrary
- MissingResource
- MultiMesh
- NavigationMesh
- NavigationMeshSourceGeometryData2D
- NavigationMeshSourceGeometryData3D
- NavigationPolygon
- Noise (1)
- Occluder3D (5)
- OccluderPolygon2D
- OggPacketSequence
- OpenXRAction
- OpenXRActionMap
- OpenXRActionSet
- OpenXRBindingModifier (2)
- OpenXRHapticBase (1)
- OpenXRIPBinding
- OpenXRInteractionProfile
- PackedDataContainer
- PackedScene
- PhysicsMaterial
- PolygonPathFinder
- RDShaderFile
- RDShaderSPIRV
- RichTextEffect
- SceneReplicationConfig
- Script (3)
- Shader (1)
- ShaderInclude
- Shape2D (8)
- Shape3D (9)
- Shortcut
- SkeletonModification2D (7)
- SkeletonModificationStack2D
- SkeletonProfile (1)
- Skin
- Sky
- SpriteFrames
- StyleBox (4)
- SyntaxHighlighter (2)
- Texture (3)
- Theme
- TileMapPattern
- TileSet
- TileSetSource (2)
- Translation (1)
- VideoStream (1)
- VideoStreamPlayback
- VisualShaderNode (62)
- VoxelGIData
- World2D
- World3D
- X509Certificate
Table of contents
-
var bake_resolution: int = 100 -
var max_domain: float = 1.0 -
var max_value: float = 1.0 -
var min_domain: float = 0.0 -
var min_value: float = 0.0 -
var point_count: int = 0 -
func add_point(right_mode: int = 0 enumCurve.TangentMode) -> int -
func bake() -> void -
func clean_dupes() -> void -
func clear_points() -> void -
const func get_domain_range() -> float -
const func get_point_left_mode(index: int) -> intCurve.TangentMode -
const func get_point_left_tangent(index: int) -> float -
const func get_point_position(index: int) -> Vector2 -
const func get_point_right_mode(index: int) -> intCurve.TangentMode -
const func get_point_right_tangent(index: int) -> float -
const func get_value_range() -> float -
func remove_point(index: int) -> void -
const func sample(offset: float) -> float -
const func sample_baked(offset: float) -> float -
func set_point_left_mode(mode: int enumCurve.TangentMode) -> void -
func set_point_left_tangent(tangent: float) -> void -
func set_point_offset(offset: float) -> int -
func set_point_right_mode(mode: int enumCurve.TangentMode) -> void -
func set_point_right_tangent(tangent: float) -> void -
func set_point_value(y: float) -> void -
const TANGENT_FREE = 0 enum TangentMode -
const TANGENT_LINEAR = 1 enum TangentMode -
const TANGENT_MODE_COUNT = 2 enum TangentMode -
enum TangentMode -
signal domain_changed() -
signal range_changed()
Curve #
is_refcounted, is_instantiable, resource, core, not_builtin_classes
A mathematical curve.
This resource describes a mathematical curve by defining a set of points and tangents at each point. By default, it ranges between 0 and 1 on the X and Y axes, but these ranges can be changed.
Please note that many resources and nodes assume they are given unit curves. A unit curve is a curve whose domain (the X axis) is between 0 and 1. Some examples of unit curve usage are CPUParticles2D.angle_curve and Line2D.width_curve.
Members #
var bake_resolution: int = 100#
The number of points to include in the baked (i.e. cached) curve data.
var max_domain: float = 1.0#
The maximum domain (x-coordinate) that points can have.
var max_value: float = 1.0#
The maximum value (y-coordinate) that points can have. Tangents can cause higher values between points.
var min_domain: float = 0.0#
The minimum domain (x-coordinate) that points can have.
var min_value: float = 0.0#
The minimum value (y-coordinate) that points can have. Tangents can cause lower values between points.
var point_count: int = 0#
The number of points describing the curve.
Methods #
func add_point(right_mode: int = 0 enumCurve.TangentMode) -> int#
Adds a point to the curve. For each side, if the *_mode is TANGENT_LINEAR, the *_tangent angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the *_tangent angle if *_mode is set to TANGENT_FREE.
func bake() -> void#
Recomputes the baked cache of points for the curve.
func clean_dupes() -> void#
Removes duplicate points, i.e. points that are less than 0.00001 units (engine epsilon value) away from their neighbor on the curve.
func clear_points() -> void#
Removes all points from the curve.
const func get_domain_range() -> float#
Returns the difference between min_domain and max_domain.
const func get_point_left_mode(index: int) -> intCurve.TangentMode#
Returns the left TangentMode for the point at index.
const func get_point_left_tangent(index: int) -> float#
Returns the left tangent angle (in degrees) for the point at index.
const func get_point_position(index: int) -> Vector2#
Returns the curve coordinates for the point at index.
const func get_point_right_mode(index: int) -> intCurve.TangentMode#
Returns the right TangentMode for the point at index.
const func get_point_right_tangent(index: int) -> float#
Returns the right tangent angle (in degrees) for the point at index.
func remove_point(index: int) -> void#
Removes the point at index from the curve.
const func sample(offset: float) -> float#
Returns the Y value for the point that would exist at the X position offset along the curve.
const func sample_baked(offset: float) -> float#
Returns the Y value for the point that would exist at the X position offset along the curve using the baked cache. Bakes the curve's points if not already baked.
func set_point_left_mode(mode: int enumCurve.TangentMode) -> void#
Sets the left TangentMode for the point at index to mode.
func set_point_left_tangent(tangent: float) -> void#
Sets the left tangent angle for the point at index to tangent.
func set_point_offset(offset: float) -> int#
Sets the offset from 0.5.
func set_point_right_mode(mode: int enumCurve.TangentMode) -> void#
Sets the right TangentMode for the point at index to mode.
func set_point_right_tangent(tangent: float) -> void#
Sets the right tangent angle for the point at index to tangent.
func set_point_value(y: float) -> void#
Assigns the vertical position y to the point at index.
Annotations #
Constants #
const TANGENT_FREE = 0 enum TangentMode#
The tangent on this side of the point is user-defined.
const TANGENT_LINEAR = 1 enum TangentMode#
The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point.
const TANGENT_MODE_COUNT = 2 enum TangentMode#
The total number of available tangent modes.
Constructors #
Enums #
TangentMode#
enum TangentMode {
TANGENT_FREE = 0,
TANGENT_LINEAR = 1,
TANGENT_MODE_COUNT = 2,
} Operators #
Signals #
signal domain_changed()#
Emitted when max_domain or min_domain is changed.
signal range_changed()#
Emitted when max_value or min_value is changed.