/
SoftBody.hx
250 lines (189 loc) · 8.09 KB
/
SoftBody.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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
A deformable physics body. Used to create elastic or deformable objects such as cloth, rubber, or other flexible materials.
Note: There are many known bugs in `godot.SoftBody`. Therefore, it's not recommended to use them for things that can affect gameplay (such as a player character made entirely out of soft bodies).
**/
@:libType
@:csNative
@:native("Godot.SoftBody")
@:autoBuild(godot.Godot.buildUserClass())
extern class SoftBody extends godot.MeshInstance {
/**
If `true`, the `godot.SoftBody` will respond to `godot.RayCast`s.
**/
@:native("RayPickable")
public var rayPickable:Bool;
@:native("PoseMatchingCoefficient")
public var poseMatchingCoefficient:Single;
@:native("DragCoefficient")
public var dragCoefficient:Single;
@:native("DampingCoefficient")
public var dampingCoefficient:Single;
@:native("PressureCoefficient")
public var pressureCoefficient:Single;
@:native("VolumeStiffness")
public var volumeStiffness:Single;
@:native("AreaAngularStiffness")
public var areaAngularStiffness:Single;
@:native("LinearStiffness")
public var linearStiffness:Single;
/**
The SoftBody's mass.
**/
@:native("TotalMass")
public var totalMass:Single;
/**
Increasing this value will improve the resulting simulation, but can affect performance. Use with care.
**/
@:native("SimulationPrecision")
public var simulationPrecision:Int;
/**
`godot.NodePath` to a `godot.CollisionObject` this SoftBody should avoid clipping.
**/
@:native("ParentCollisionIgnore")
public var parentCollisionIgnore:godot.NodePath;
/**
The physics layers this SoftBody scans for collisions. See [https://docs.godotengine.org/en/3.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks](Collision layers and masks) in the documentation for more information.
**/
@:native("CollisionMask")
public var collisionMask:UInt;
/**
The physics layers this SoftBody is in.
Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property.
A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [https://docs.godotengine.org/en/3.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks](Collision layers and masks) in the documentation for more information.
**/
@:native("CollisionLayer")
public var collisionLayer:UInt;
/**
If `true`, the `godot.SoftBody` is simulated in physics. Can be set to `false` to pause the physics simulation.
**/
@:native("PhysicsEnabled")
public var physicsEnabled:Bool;
@:native("new")
public function new():Void;
@:native("SetPhysicsEnabled")
public function setPhysicsEnabled(enabled:Bool):Void;
@:native("IsPhysicsEnabled")
public function isPhysicsEnabled():Bool;
@:native("SetCollisionMask")
public function setCollisionMask(collisionMask:UInt):Void;
@:native("GetCollisionMask")
public function getCollisionMask():UInt;
@:native("SetCollisionLayer")
public function setCollisionLayer(collisionLayer:UInt):Void;
@:native("GetCollisionLayer")
public function getCollisionLayer():UInt;
/**
Sets individual bits on the collision mask. Use this if you only need to change one layer's value.
**/
@:native("SetCollisionMaskBit")
public function setCollisionMaskBit(bit:Int, value:Bool):Void;
/**
Returns an individual bit on the collision mask.
**/
@:native("GetCollisionMaskBit")
public function getCollisionMaskBit(bit:Int):Bool;
/**
Sets individual bits on the layer mask. Use this if you only need to change one layer's value.
**/
@:native("SetCollisionLayerBit")
public function setCollisionLayerBit(bit:Int, value:Bool):Void;
/**
Returns an individual bit on the collision mask.
**/
@:native("GetCollisionLayerBit")
public function getCollisionLayerBit(bit:Int):Bool;
@:native("SetParentCollisionIgnore")
public function setParentCollisionIgnore(parentCollisionIgnore:godot.NodePath):Void;
@:native("GetParentCollisionIgnore")
public function getParentCollisionIgnore():godot.NodePath;
/**
Returns an array of nodes that were added as collision exceptions for this body.
**/
@:native("GetCollisionExceptions")
public function getCollisionExceptions():godot.collections.Array;
/**
Adds a body to the list of bodies that this body can't collide with.
**/
@:native("AddCollisionExceptionWith")
public function addCollisionExceptionWith(body:godot.Node):Void;
/**
Removes a body from the list of bodies that this body can't collide with.
**/
@:native("RemoveCollisionExceptionWith")
public function removeCollisionExceptionWith(body:godot.Node):Void;
@:native("SetSimulationPrecision")
public function setSimulationPrecision(simulationPrecision:Int):Void;
@:native("GetSimulationPrecision")
public function getSimulationPrecision():Int;
@:native("SetTotalMass")
public function setTotalMass(mass:Single):Void;
@:native("GetTotalMass")
public function getTotalMass():Single;
@:native("SetLinearStiffness")
public function setLinearStiffness(linearStiffness:Single):Void;
@:native("GetLinearStiffness")
public function getLinearStiffness():Single;
@:native("SetAreaAngularStiffness")
public function setAreaAngularStiffness(areaAngularStiffness:Single):Void;
@:native("GetAreaAngularStiffness")
public function getAreaAngularStiffness():Single;
@:native("SetVolumeStiffness")
public function setVolumeStiffness(volumeStiffness:Single):Void;
@:native("GetVolumeStiffness")
public function getVolumeStiffness():Single;
@:native("SetPressureCoefficient")
public function setPressureCoefficient(pressureCoefficient:Single):Void;
@:native("GetPressureCoefficient")
public function getPressureCoefficient():Single;
@:native("SetPoseMatchingCoefficient")
public function setPoseMatchingCoefficient(poseMatchingCoefficient:Single):Void;
@:native("GetPoseMatchingCoefficient")
public function getPoseMatchingCoefficient():Single;
@:native("SetDampingCoefficient")
public function setDampingCoefficient(dampingCoefficient:Single):Void;
@:native("GetDampingCoefficient")
public function getDampingCoefficient():Single;
@:native("SetDragCoefficient")
public function setDragCoefficient(dragCoefficient:Single):Void;
@:native("GetDragCoefficient")
public function getDragCoefficient():Single;
/**
Returns local translation of a vertex in the surface array.
**/
@:native("GetPointTransform")
public function getPointTransform(pointIndex:Int):godot.Vector3;
#if doc_gen
/**
Sets the pinned state of a surface vertex. When set to `true`, the optional `attachment_path` can define a `godot.Spatial` the pinned vertex will be attached to.
@param attachmentPath If the parameter is null, then the default value is (NodePath)""
**/
@:native("SetPointPinned")
public function setPointPinned(pointIndex:Int, pinned:Bool, ?attachmentPath:godot.NodePath):Void;
#else
/**
Sets the pinned state of a surface vertex. When set to `true`, the optional `attachment_path` can define a `godot.Spatial` the pinned vertex will be attached to.
@param attachmentPath If the parameter is null, then the default value is (NodePath)""
**/
@:native("SetPointPinned")
public overload function setPointPinned(pointIndex:Int, pinned:Bool):Void;
/**
Sets the pinned state of a surface vertex. When set to `true`, the optional `attachment_path` can define a `godot.Spatial` the pinned vertex will be attached to.
@param attachmentPath If the parameter is null, then the default value is (NodePath)""
**/
@:native("SetPointPinned")
public overload function setPointPinned(pointIndex:Int, pinned:Bool, attachmentPath:godot.NodePath):Void;
#end
/**
Returns `true` if vertex is set to pinned.
**/
@:native("IsPointPinned")
public function isPointPinned(pointIndex:Int):Bool;
@:native("SetRayPickable")
public function setRayPickable(rayPickable:Bool):Void;
@:native("IsRayPickable")
public function isRayPickable():Bool;
}