/
CSGPolygon.hx
214 lines (162 loc) · 7.42 KB
/
CSGPolygon.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
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
An array of 2D points is extruded to quickly and easily create a variety of 3D meshes. See also `godot.CSGMesh` for using 3D meshes as CSG nodes.
Note: CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a `godot.MeshInstance` with a `godot.PrimitiveMesh`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay.
**/
@:libType
@:csNative
@:native("Godot.CSGPolygon")
@:autoBuild(godot.Godot.buildUserClass())
extern class CSGPolygon extends godot.CSGPrimitive {
/**
Material to use for the resulting mesh. The UV maps the top half of the material to the extruded shape (U along the the length of the extrusions and V around the outline of the `godot.CSGPolygon.polygon`), the bottom-left quarter to the front end face, and the bottom-right quarter to the back end face.
**/
@:native("Material")
public var material:godot.Material;
/**
If `true`, applies smooth shading to the extrusions.
**/
@:native("SmoothFaces")
public var smoothFaces:Bool;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.path`, if `true` the ends of the path are joined, by adding an extrusion between the last and first points of the path.
**/
@:native("PathJoined")
public var pathJoined:Bool;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.path`, this is the distance along the path, in meters, the texture coordinates will tile. When set to 0, texture coordinates will match geometry exactly with no tiling.
**/
@:native("PathUDistance")
public var pathUDistance:Single;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.path`, by default, the top half of the `godot.CSGPolygon.material` is stretched along the entire length of the extruded shape. If `false` the top half of the material is repeated every step of the extrusion.
**/
@:native("PathContinuousU")
public var pathContinuousU:Bool;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.path`, if `true` the `godot.Transform` of the `godot.CSGPolygon` is used as the starting point for the extrusions, not the `godot.Transform` of the `godot.CSGPolygon.pathNode`.
**/
@:native("PathLocal")
public var pathLocal:Bool;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.path`, the `godot.CSGPolygon_PathRotationEnum` method used to rotate the `godot.CSGPolygon.polygon` as it is extruded.
**/
@:native("PathRotation")
public var pathRotation:godot.CSGPolygon_PathRotationEnum;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.path`, extrusions that are less than this angle, will be merged together to reduce polygon count.
**/
@:native("PathSimplifyAngle")
public var pathSimplifyAngle:Single;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.path`, the path interval or ratio of path points to extrusions.
**/
@:native("PathInterval")
public var pathInterval:Single;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.path`, this will determine if the interval should be by distance (`godot.CSGPolygon_PathIntervalTypeEnum.distance`) or subdivision fractions (`godot.CSGPolygon_PathIntervalTypeEnum.subdivide`).
**/
@:native("PathIntervalType")
public var pathIntervalType:godot.CSGPolygon_PathIntervalTypeEnum;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.path`, the location of the `godot.Path` object used to extrude the `godot.CSGPolygon.polygon`.
**/
@:native("PathNode")
public var pathNode:godot.NodePath;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.spin`, the number of extrusions made.
**/
@:native("SpinSides")
public var spinSides:Int;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.spin`, the total number of degrees the `godot.CSGPolygon.polygon` is rotated when extruding.
**/
@:native("SpinDegrees")
public var spinDegrees:Single;
/**
When `godot.CSGPolygon.mode` is `godot.CSGPolygon_ModeEnum.depth`, the depth of the extrusion.
**/
@:native("Depth")
public var depth:Single;
/**
The `godot.CSGPolygon.mode` used to extrude the `godot.CSGPolygon.polygon`.
**/
@:native("Mode")
public var mode:godot.CSGPolygon_ModeEnum;
/**
The point array that defines the 2D polygon that is extruded. This can be a convex or concave polygon with 3 or more points. The polygon must not have any intersecting edges. Otherwise, triangulation will fail and no mesh will be generated.
Note: If only 1 or 2 points are defined in `godot.CSGPolygon.polygon`, no mesh will be generated.
**/
@:native("Polygon")
public var polygon:cs.NativeArray<godot.Vector2>;
@:native("new")
public function new():Void;
@:native("SetPolygon")
public function setPolygon(polygon:HaxeArray<godot.Vector2>):Void;
public extern inline function getPolygon():std.Array<godot.Vector2> {
return cs.Lib.array(cs.Syntax.code("{0}.GetPolygon()", this));
}
@:native("SetMode")
public function setMode(mode:godot.CSGPolygon_ModeEnum):Void;
@:native("GetMode")
public function getMode():godot.CSGPolygon_ModeEnum;
@:native("SetDepth")
public function setDepth(depth:Single):Void;
@:native("GetDepth")
public function getDepth():Single;
@:native("SetSpinDegrees")
public function setSpinDegrees(degrees:Single):Void;
@:native("GetSpinDegrees")
public function getSpinDegrees():Single;
@:native("SetSpinSides")
public function setSpinSides(spinSides:Int):Void;
@:native("GetSpinSides")
public function getSpinSides():Int;
@:native("SetPathNode")
public function setPathNode(path:godot.NodePath):Void;
@:native("GetPathNode")
public function getPathNode():godot.NodePath;
@:native("SetPathIntervalType")
public function setPathIntervalType(intervalType:godot.CSGPolygon_PathIntervalTypeEnum):Void;
@:native("GetPathIntervalType")
public function getPathIntervalType():godot.CSGPolygon_PathIntervalTypeEnum;
@:native("SetPathInterval")
public function setPathInterval(pathInterval:Single):Void;
@:native("GetPathInterval")
public function getPathInterval():Single;
@:native("SetPathSimplifyAngle")
public function setPathSimplifyAngle(degrees:Single):Void;
@:native("GetPathSimplifyAngle")
public function getPathSimplifyAngle():Single;
@:native("SetPathRotation")
public function setPathRotation(pathRotation:godot.CSGPolygon_PathRotationEnum):Void;
@:native("GetPathRotation")
public function getPathRotation():godot.CSGPolygon_PathRotationEnum;
@:native("SetPathLocal")
public function setPathLocal(enable:Bool):Void;
@:native("IsPathLocal")
public function isPathLocal():Bool;
@:native("SetPathContinuousU")
public function setPathContinuousU(enable:Bool):Void;
@:native("IsPathContinuousU")
public function isPathContinuousU():Bool;
@:native("SetPathUDistance")
public function setPathUDistance(distance:Single):Void;
@:native("GetPathUDistance")
public function getPathUDistance():Single;
@:native("SetPathJoined")
public function setPathJoined(enable:Bool):Void;
@:native("IsPathJoined")
public function isPathJoined():Bool;
@:native("SetMaterial")
public function setMaterial(material:godot.Material):Void;
@:native("GetMaterial")
public function getMaterial():godot.Material;
@:native("SetSmoothFaces")
public function setSmoothFaces(smoothFaces:Bool):Void;
@:native("GetSmoothFaces")
public function getSmoothFaces():Bool;
}