Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
TangentMode
Curve.swift:21enum TangentMode
Cases
case free
The tangent on this side of the point is user-defined.
case linear
The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point.
case modeCount
The total number of available tangent modes.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (24) members.
Type members
Instance members
var bakeResolution: Int32
The number of points to include in the baked (i.e. cached) curve data.
var maxValue: Double
The maximum value the curve can reach.
var minValue: Double
The minimum value the curve can reach.
var pointCount: Int32
The number of points describing the curve.
var rangeChanged: SimpleSignal
func addPoint(position: Vector2, leftTangent: Double, rightTangent: Double, leftMode: Curve.TangentMode, rightMode: Curve.TangentMode
) -> Int32 Adds a point to the curve. For each side, if the
*_mode
is .tangentLinear, 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 .tangentFree.func bake(
) Recomputes the baked cache of points for the curve.
func cleanDupes(
) Removes duplicate points, i.e. points that are less than 0.00001 units (engine epsilon value) away from their neighbor on the curve.
func clearPoints(
) Removes all points from the curve.
func getPointLeftMode(index: Int32
) -> Curve.TangentMode Returns the left
TangentMode
for the point atindex
.func getPointLeftTangent(index: Int32
) -> Double Returns the left tangent angle (in degrees) for the point at
index
.func getPointPosition(index: Int32
) -> Vector2 Returns the curve coordinates for the point at
index
.func getPointRightMode(index: Int32
) -> Curve.TangentMode Returns the right
TangentMode
for the point atindex
.func getPointRightTangent(index: Int32
) -> Double Returns the right tangent angle (in degrees) for the point at
index
.func removePoint(index: Int32
) Removes the point at
index
from the curve.func sample(offset: Double
) -> Double Returns the Y value for the point that would exist at the X position
offset
along the curve.func sampleBaked(offset: Double
) -> Double 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 setPointLeftMode(index: Int32, mode: Curve.TangentMode
) Sets the left
TangentMode
for the point atindex
tomode
.func setPointLeftTangent(index: Int32, tangent: Double
) Sets the left tangent angle for the point at
index
totangent
.func setPointOffset(index: Int32, offset: Double
) -> Int32 Sets the offset from
0.5
.func setPointRightMode(index: Int32, mode: Curve.TangentMode
) Sets the right
TangentMode
for the point atindex
tomode
.func setPointRightTangent(index: Int32, tangent: Double
) Sets the right tangent angle for the point at
index
totangent
.func setPointValue(index: Int32, y: Double
) Assigns the vertical position
y
to the point atindex
.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.