/
Curve.hx
210 lines (174 loc) · 7.34 KB
/
Curve.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
A curve that can be saved and re-used for other objects. By default, it ranges between `0` and `1` on the Y axis and positions points relative to the `0.5` Y position.
**/
@:libType
@:csNative
@:native("Godot.Curve")
@:autoBuild(godot.Godot.buildUserClass())
extern class Curve extends godot.Resource {
/**
`range_changed` signal.
**/
public var onRangeChanged(get, never):Signal<Void->Void>;
@:dox(hide) @:noCompletion inline function get_onRangeChanged():Signal<Void->Void> {
return new Signal(this, "range_changed", Signal.SignalHandlerVoidVoid.connectSignal, Signal.SignalHandlerVoidVoid.disconnectSignal, Signal.SignalHandlerVoidVoid.isSignalConnected);
}
@:native("_Data")
public var _Data:godot.collections.Array;
/**
The number of points to include in the baked (i.e. cached) curve data.
**/
@:native("BakeResolution")
public var bakeResolution:Int;
/**
The maximum value the curve can reach.
**/
@:native("MaxValue")
public var maxValue:Single;
/**
The minimum value the curve can reach.
**/
@:native("MinValue")
public var minValue:Single;
@:native("new")
public function new():Void;
/**
Returns the number of points describing the curve.
**/
@:native("GetPointCount")
public function getPointCount():Int;
#if doc_gen
/**
Adds a point to the curve. For each side, if the `*_mode` is `godot.Curve_TangentMode.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 `godot.Curve_TangentMode.free`.
**/
@:native("AddPoint")
public function addPoint(position:godot.Vector2, ?leftTangent:Single, ?rightTangent:Single, ?leftMode:godot.Curve_TangentMode, ?rightMode:godot.Curve_TangentMode):Int;
#else
/**
Adds a point to the curve. For each side, if the `*_mode` is `godot.Curve_TangentMode.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 `godot.Curve_TangentMode.free`.
**/
@:native("AddPoint")
public overload function addPoint(position:godot.Vector2):Int;
/**
Adds a point to the curve. For each side, if the `*_mode` is `godot.Curve_TangentMode.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 `godot.Curve_TangentMode.free`.
**/
@:native("AddPoint")
public overload function addPoint(position:godot.Vector2, leftTangent:Single):Int;
/**
Adds a point to the curve. For each side, if the `*_mode` is `godot.Curve_TangentMode.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 `godot.Curve_TangentMode.free`.
**/
@:native("AddPoint")
public overload function addPoint(position:godot.Vector2, leftTangent:Single, rightTangent:Single):Int;
/**
Adds a point to the curve. For each side, if the `*_mode` is `godot.Curve_TangentMode.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 `godot.Curve_TangentMode.free`.
**/
@:native("AddPoint")
public overload function addPoint(position:godot.Vector2, leftTangent:Single, rightTangent:Single, leftMode:godot.Curve_TangentMode):Int;
/**
Adds a point to the curve. For each side, if the `*_mode` is `godot.Curve_TangentMode.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 `godot.Curve_TangentMode.free`.
**/
@:native("AddPoint")
public overload function addPoint(position:godot.Vector2, leftTangent:Single, rightTangent:Single, leftMode:godot.Curve_TangentMode, rightMode:godot.Curve_TangentMode):Int;
#end
/**
Removes the point at `index` from the curve.
**/
@:native("RemovePoint")
public function removePoint(index:Int):Void;
/**
Removes all points from the curve.
**/
@:native("ClearPoints")
public function clearPoints():Void;
/**
Returns the curve coordinates for the point at `index`.
**/
@:native("GetPointPosition")
public function getPointPosition(index:Int):godot.Vector2;
/**
Assigns the vertical position `y` to the point at `index`.
**/
@:native("SetPointValue")
public function setPointValue(index:Int, y:Single):Void;
/**
Sets the offset from `0.5`.
**/
@:native("SetPointOffset")
public function setPointOffset(index:Int, offset:Single):Int;
/**
Returns the Y value for the point that would exist at the X position `offset` along the curve.
**/
@:native("Interpolate")
public function interpolate(offset:Single):Single;
/**
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.
**/
@:native("InterpolateBaked")
public function interpolateBaked(offset:Single):Single;
/**
Returns the left tangent angle (in degrees) for the point at `index`.
**/
@:native("GetPointLeftTangent")
public function getPointLeftTangent(index:Int):Single;
/**
Returns the right tangent angle (in degrees) for the point at `index`.
**/
@:native("GetPointRightTangent")
public function getPointRightTangent(index:Int):Single;
/**
Returns the left `godot.Curve_TangentMode` for the point at `index`.
**/
@:native("GetPointLeftMode")
public function getPointLeftMode(index:Int):godot.Curve_TangentMode;
/**
Returns the right `godot.Curve_TangentMode` for the point at `index`.
**/
@:native("GetPointRightMode")
public function getPointRightMode(index:Int):godot.Curve_TangentMode;
/**
Sets the left tangent angle for the point at `index` to `tangent`.
**/
@:native("SetPointLeftTangent")
public function setPointLeftTangent(index:Int, tangent:Single):Void;
/**
Sets the right tangent angle for the point at `index` to `tangent`.
**/
@:native("SetPointRightTangent")
public function setPointRightTangent(index:Int, tangent:Single):Void;
/**
Sets the left `godot.Curve_TangentMode` for the point at `index` to `mode`.
**/
@:native("SetPointLeftMode")
public function setPointLeftMode(index:Int, mode:godot.Curve_TangentMode):Void;
/**
Sets the right `godot.Curve_TangentMode` for the point at `index` to `mode`.
**/
@:native("SetPointRightMode")
public function setPointRightMode(index:Int, mode:godot.Curve_TangentMode):Void;
@:native("GetMinValue")
public function getMinValue():Single;
@:native("SetMinValue")
public function setMinValue(min:Single):Void;
@:native("GetMaxValue")
public function getMaxValue():Single;
@:native("SetMaxValue")
public function setMaxValue(max:Single):Void;
/**
Removes points that are closer than `CMP_EPSILON` (0.00001) units to their neighbor on the curve.
**/
@:native("CleanDupes")
public function cleanDupes():Void;
/**
Recomputes the baked cache of points for the curve.
**/
@:native("Bake")
public function bake():Void;
@:native("GetBakeResolution")
public function getBakeResolution():Int;
@:native("SetBakeResolution")
public function setBakeResolution(resolution:Int):Void;
}