/
EditorSpatialGizmo.hx
235 lines (192 loc) · 9.98 KB
/
EditorSpatialGizmo.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
Custom gizmo that is used for providing custom visualization and editing (handles) for 3D Spatial objects. See `godot.EditorSpatialGizmoPlugin` for more information.
**/
@:libType
@:csNative
@:native("Godot.EditorSpatialGizmo")
@:autoBuild(godot.Godot.buildUserClass())
extern class EditorSpatialGizmo extends godot.SpatialGizmo {
@:native("new")
public function new():Void;
/**
Commit a handle being edited (handles must have been previously added by `godot.EditorSpatialGizmo.addHandles`).
If the `cancel` parameter is `true`, an option to restore the edited value to the original is provided.
**/
@:native("CommitHandle")
public function commitHandle(index:Int, restore:Dynamic, cancel:Bool):Void;
/**
Gets the name of an edited handle (handles must have been previously added by `godot.EditorSpatialGizmo.addHandles`).
Handles can be named for reference to the user when editing.
**/
@:native("GetHandleName")
public function getHandleName(index:Int):std.String;
/**
Gets actual value of a handle. This value can be anything and used for eventually undoing the motion when calling `godot.EditorSpatialGizmo.commitHandle`.
**/
@:native("GetHandleValue")
public function getHandleValue(index:Int):Dynamic;
/**
Returns `true` if the handle at index `index` is highlighted by being hovered with the mouse.
**/
@:native("IsHandleHighlighted")
public function isHandleHighlighted(index:Int):Bool;
/**
This function is called when the `godot.Spatial` this gizmo refers to changes (the `godot.Spatial.updateGizmo` is called).
**/
@:native("Redraw")
public function redraw():Void;
/**
This function is used when the user drags a gizmo handle (previously added with `godot.EditorSpatialGizmo.addHandles`) in screen coordinates.
The `godot.Camera` is also provided so screen coordinates can be converted to raycasts.
**/
@:native("SetHandle")
public function setHandle(index:Int, camera:godot.Camera, point:godot.Vector2):Void;
#if doc_gen
/**
Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this function during `godot.EditorSpatialGizmo.redraw`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("AddLines")
public function addLines(lines:std.Array<godot.Vector3>, material:godot.Material, ?billboard:Bool, ?modulate:Null<godot.Color>):Void;
#else
/**
Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this function during `godot.EditorSpatialGizmo.redraw`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("AddLines")
public overload function addLines(lines:HaxeArray<godot.Vector3>, material:godot.Material):Void;
/**
Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this function during `godot.EditorSpatialGizmo.redraw`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("AddLines")
public overload function addLines(lines:HaxeArray<godot.Vector3>, material:godot.Material, billboard:Bool):Void;
/**
Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this function during `godot.EditorSpatialGizmo.redraw`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("AddLines")
public overload function addLines(lines:HaxeArray<godot.Vector3>, material:godot.Material, billboard:Bool, modulate:Nullable1<godot.Color>):Void;
#end
#if doc_gen
/**
Adds a mesh to the gizmo with the specified `billboard` state, `skeleton` and `material`. If `billboard` is `true`, the mesh will rotate to always face the camera. Call this function during `godot.EditorSpatialGizmo.redraw`.
**/
@:native("AddMesh")
public function addMesh(mesh:godot.Mesh, ?billboard:Bool, ?skeleton:godot.SkinReference, ?material:godot.Material):Void;
#else
/**
Adds a mesh to the gizmo with the specified `billboard` state, `skeleton` and `material`. If `billboard` is `true`, the mesh will rotate to always face the camera. Call this function during `godot.EditorSpatialGizmo.redraw`.
**/
@:native("AddMesh")
public overload function addMesh(mesh:godot.Mesh):Void;
/**
Adds a mesh to the gizmo with the specified `billboard` state, `skeleton` and `material`. If `billboard` is `true`, the mesh will rotate to always face the camera. Call this function during `godot.EditorSpatialGizmo.redraw`.
**/
@:native("AddMesh")
public overload function addMesh(mesh:godot.Mesh, billboard:Bool):Void;
/**
Adds a mesh to the gizmo with the specified `billboard` state, `skeleton` and `material`. If `billboard` is `true`, the mesh will rotate to always face the camera. Call this function during `godot.EditorSpatialGizmo.redraw`.
**/
@:native("AddMesh")
public overload function addMesh(mesh:godot.Mesh, billboard:Bool, skeleton:godot.SkinReference):Void;
/**
Adds a mesh to the gizmo with the specified `billboard` state, `skeleton` and `material`. If `billboard` is `true`, the mesh will rotate to always face the camera. Call this function during `godot.EditorSpatialGizmo.redraw`.
**/
@:native("AddMesh")
public overload function addMesh(mesh:godot.Mesh, billboard:Bool, skeleton:godot.SkinReference, material:godot.Material):Void;
#end
/**
Adds the specified `segments` to the gizmo's collision shape for picking. Call this function during `godot.EditorSpatialGizmo.redraw`.
**/
@:native("AddCollisionSegments")
public function addCollisionSegments(segments:HaxeArray<godot.Vector3>):Void;
/**
Adds collision triangles to the gizmo for picking. A `godot.TriangleMesh` can be generated from a regular `godot.Mesh` too. Call this function during `godot.EditorSpatialGizmo.redraw`.
**/
@:native("AddCollisionTriangles")
public function addCollisionTriangles(triangles:godot.TriangleMesh):Void;
#if doc_gen
/**
Adds an unscaled billboard for visualization. Call this function during `godot.EditorSpatialGizmo.redraw`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("AddUnscaledBillboard")
public function addUnscaledBillboard(material:godot.Material, ?defaultScale:Single, ?modulate:Null<godot.Color>):Void;
#else
/**
Adds an unscaled billboard for visualization. Call this function during `godot.EditorSpatialGizmo.redraw`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("AddUnscaledBillboard")
public overload function addUnscaledBillboard(material:godot.Material):Void;
/**
Adds an unscaled billboard for visualization. Call this function during `godot.EditorSpatialGizmo.redraw`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("AddUnscaledBillboard")
public overload function addUnscaledBillboard(material:godot.Material, defaultScale:Single):Void;
/**
Adds an unscaled billboard for visualization. Call this function during `godot.EditorSpatialGizmo.redraw`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("AddUnscaledBillboard")
public overload function addUnscaledBillboard(material:godot.Material, defaultScale:Single, modulate:Nullable1<godot.Color>):Void;
#end
#if doc_gen
/**
Adds a list of handles (points) which can be used to deform the object being edited.
There are virtual functions which will be called upon editing of these handles. Call this function during `godot.EditorSpatialGizmo.redraw`.
**/
@:native("AddHandles")
public function addHandles(handles:std.Array<godot.Vector3>, material:godot.Material, ?billboard:Bool, ?secondary:Bool):Void;
#else
/**
Adds a list of handles (points) which can be used to deform the object being edited.
There are virtual functions which will be called upon editing of these handles. Call this function during `godot.EditorSpatialGizmo.redraw`.
**/
@:native("AddHandles")
public overload function addHandles(handles:HaxeArray<godot.Vector3>, material:godot.Material):Void;
/**
Adds a list of handles (points) which can be used to deform the object being edited.
There are virtual functions which will be called upon editing of these handles. Call this function during `godot.EditorSpatialGizmo.redraw`.
**/
@:native("AddHandles")
public overload function addHandles(handles:HaxeArray<godot.Vector3>, material:godot.Material, billboard:Bool):Void;
/**
Adds a list of handles (points) which can be used to deform the object being edited.
There are virtual functions which will be called upon editing of these handles. Call this function during `godot.EditorSpatialGizmo.redraw`.
**/
@:native("AddHandles")
public overload function addHandles(handles:HaxeArray<godot.Vector3>, material:godot.Material, billboard:Bool, secondary:Bool):Void;
#end
/**
Sets the reference `godot.Spatial` node for the gizmo. `node` must inherit from `godot.Spatial`.
**/
@:native("SetSpatialNode")
public function setSpatialNode(node:godot.Node):Void;
/**
Returns the Spatial node associated with this gizmo.
**/
@:native("GetSpatialNode")
public function getSpatialNode():godot.Spatial;
/**
Returns the `godot.EditorSpatialGizmoPlugin` that owns this gizmo. It's useful to retrieve materials using `godot.EditorSpatialGizmoPlugin.getMaterial`.
**/
@:native("GetPlugin")
public function getPlugin():godot.EditorSpatialGizmoPlugin;
/**
Removes everything in the gizmo including meshes, collisions and handles.
**/
@:native("Clear")
public function clear():Void;
/**
Sets the gizmo's hidden state. If `true`, the gizmo will be hidden. If `false`, it will be shown.
**/
@:native("SetHidden")
public function setHidden(hidden:Bool):Void;
}