/
KinematicBody.hx
497 lines (353 loc) · 33 KB
/
KinematicBody.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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses:
Simulated motion: When these bodies are moved manually, either from code or from an `godot.AnimationPlayer` (with `godot.AnimationPlayer.playbackProcessMode` set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
Kinematic characters: KinematicBody also has an API for moving objects (the `godot.KinematicBody.moveAndCollide` and `godot.KinematicBody.moveAndSlide` methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics.
**/
@:libType
@:csNative
@:native("Godot.KinematicBody")
@:autoBuild(godot.Godot.buildUserClass())
extern class KinematicBody extends godot.PhysicsBody {
/**
If `true`, the body's movement will be synchronized to the physics frame. This is useful when animating movement via `godot.AnimationPlayer`, for example on moving platforms. Do not use together with `godot.KinematicBody.moveAndSlide` or `godot.KinematicBody.moveAndCollide` functions.
**/
@:native("Motion__syncToPhysics")
public var motion__syncToPhysics:Bool;
/**
Extra margin used for collision recovery in motion functions (see `godot.KinematicBody.moveAndCollide`, `godot.KinematicBody.moveAndSlide`, `godot.KinematicBody.moveAndSlideWithSnap`).
If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion.
A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors.
A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of kinematic bodies.
**/
@:native("Collision__safeMargin")
public var collision__safeMargin:Single;
/**
Lock the body's Z axis movement. Deprecated alias for `godot.KinematicBody.axisLockMotionZ`.
**/
@:native("MoveLockZ")
public var moveLockZ:Bool;
/**
Lock the body's Y axis movement. Deprecated alias for `godot.KinematicBody.axisLockMotionY`.
**/
@:native("MoveLockY")
public var moveLockY:Bool;
/**
Lock the body's X axis movement. Deprecated alias for `godot.KinematicBody.axisLockMotionX`.
**/
@:native("MoveLockX")
public var moveLockX:Bool;
/**
Lock the body's Z axis movement.
**/
@:native("AxisLockMotionZ")
public var axisLockMotionZ:Bool;
/**
Lock the body's Y axis movement.
**/
@:native("AxisLockMotionY")
public var axisLockMotionY:Bool;
/**
Lock the body's X axis movement.
**/
@:native("AxisLockMotionX")
public var axisLockMotionX:Bool;
@:native("new")
public function new():Void;
#if doc_gen
/**
Moves the body along the vector `rel_vec`. The body will stop if it collides. Returns a `godot.KinematicCollision`, which contains information about the collision when stopped, or when touching another body along the motion.
If `test_only` is `true`, the body does not move but the would-be collision information is given.
**/
@:native("MoveAndCollide")
public function moveAndCollide(relVec:godot.Vector3, ?infiniteInertia:Bool, ?excludeRaycastShapes:Bool, ?testOnly:Bool):godot.KinematicCollision;
#else
/**
Moves the body along the vector `rel_vec`. The body will stop if it collides. Returns a `godot.KinematicCollision`, which contains information about the collision when stopped, or when touching another body along the motion.
If `test_only` is `true`, the body does not move but the would-be collision information is given.
**/
@:native("MoveAndCollide")
public overload function moveAndCollide(relVec:godot.Vector3):godot.KinematicCollision;
/**
Moves the body along the vector `rel_vec`. The body will stop if it collides. Returns a `godot.KinematicCollision`, which contains information about the collision when stopped, or when touching another body along the motion.
If `test_only` is `true`, the body does not move but the would-be collision information is given.
**/
@:native("MoveAndCollide")
public overload function moveAndCollide(relVec:godot.Vector3, infiniteInertia:Bool):godot.KinematicCollision;
/**
Moves the body along the vector `rel_vec`. The body will stop if it collides. Returns a `godot.KinematicCollision`, which contains information about the collision when stopped, or when touching another body along the motion.
If `test_only` is `true`, the body does not move but the would-be collision information is given.
**/
@:native("MoveAndCollide")
public overload function moveAndCollide(relVec:godot.Vector3, infiniteInertia:Bool, excludeRaycastShapes:Bool):godot.KinematicCollision;
/**
Moves the body along the vector `rel_vec`. The body will stop if it collides. Returns a `godot.KinematicCollision`, which contains information about the collision when stopped, or when touching another body along the motion.
If `test_only` is `true`, the body does not move but the would-be collision information is given.
**/
@:native("MoveAndCollide")
public overload function moveAndCollide(relVec:godot.Vector3, infiniteInertia:Bool, excludeRaycastShapes:Bool, testOnly:Bool):godot.KinematicCollision;
#end
#if doc_gen
/**
Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a `godot.KinematicBody` or `godot.RigidBody`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in `godot.Node._PhysicsProcess` (or in a method called by `godot.Node._PhysicsProcess`), as it uses the physics step's `delta` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
`linear_velocity` is the velocity vector (typically meters per second). Unlike in `godot.KinematicBody.moveAndCollide`, you should not multiply it by `delta` — the physics engine handles applying the velocity.
`up_direction` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of `Vector3(0, 0, 0)`, everything is considered a wall.
If `stop_on_slope` is `true`, body will not slide on slopes when you include gravity in `linear_velocity` and the body is standing still.
If the body collides, it will change direction a maximum of `max_slides` times before it stops.
`floor_max_angle` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees.
If `infinite_inertia` is `true`, body will be able to push `godot.RigidBody` nodes, but it won't also detect any collisions with them. If `false`, it will interact with `godot.RigidBody` nodes like with `godot.StaticBody`.
Returns the `linear_velocity` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use `godot.KinematicBody.getSlideCollision`.
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlide")
public function moveAndSlide(linearVelocity:godot.Vector3, ?upDirection:Null<godot.Vector3>, ?stopOnSlope:Bool, ?maxSlides:Int, ?floorMaxAngle:Single, ?infiniteInertia:Bool):godot.Vector3;
#else
/**
Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a `godot.KinematicBody` or `godot.RigidBody`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in `godot.Node._PhysicsProcess` (or in a method called by `godot.Node._PhysicsProcess`), as it uses the physics step's `delta` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
`linear_velocity` is the velocity vector (typically meters per second). Unlike in `godot.KinematicBody.moveAndCollide`, you should not multiply it by `delta` — the physics engine handles applying the velocity.
`up_direction` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of `Vector3(0, 0, 0)`, everything is considered a wall.
If `stop_on_slope` is `true`, body will not slide on slopes when you include gravity in `linear_velocity` and the body is standing still.
If the body collides, it will change direction a maximum of `max_slides` times before it stops.
`floor_max_angle` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees.
If `infinite_inertia` is `true`, body will be able to push `godot.RigidBody` nodes, but it won't also detect any collisions with them. If `false`, it will interact with `godot.RigidBody` nodes like with `godot.StaticBody`.
Returns the `linear_velocity` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use `godot.KinematicBody.getSlideCollision`.
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlide")
public overload function moveAndSlide(linearVelocity:godot.Vector3):godot.Vector3;
/**
Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a `godot.KinematicBody` or `godot.RigidBody`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in `godot.Node._PhysicsProcess` (or in a method called by `godot.Node._PhysicsProcess`), as it uses the physics step's `delta` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
`linear_velocity` is the velocity vector (typically meters per second). Unlike in `godot.KinematicBody.moveAndCollide`, you should not multiply it by `delta` — the physics engine handles applying the velocity.
`up_direction` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of `Vector3(0, 0, 0)`, everything is considered a wall.
If `stop_on_slope` is `true`, body will not slide on slopes when you include gravity in `linear_velocity` and the body is standing still.
If the body collides, it will change direction a maximum of `max_slides` times before it stops.
`floor_max_angle` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees.
If `infinite_inertia` is `true`, body will be able to push `godot.RigidBody` nodes, but it won't also detect any collisions with them. If `false`, it will interact with `godot.RigidBody` nodes like with `godot.StaticBody`.
Returns the `linear_velocity` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use `godot.KinematicBody.getSlideCollision`.
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlide")
public overload function moveAndSlide(linearVelocity:godot.Vector3, upDirection:Nullable1<godot.Vector3>):godot.Vector3;
/**
Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a `godot.KinematicBody` or `godot.RigidBody`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in `godot.Node._PhysicsProcess` (or in a method called by `godot.Node._PhysicsProcess`), as it uses the physics step's `delta` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
`linear_velocity` is the velocity vector (typically meters per second). Unlike in `godot.KinematicBody.moveAndCollide`, you should not multiply it by `delta` — the physics engine handles applying the velocity.
`up_direction` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of `Vector3(0, 0, 0)`, everything is considered a wall.
If `stop_on_slope` is `true`, body will not slide on slopes when you include gravity in `linear_velocity` and the body is standing still.
If the body collides, it will change direction a maximum of `max_slides` times before it stops.
`floor_max_angle` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees.
If `infinite_inertia` is `true`, body will be able to push `godot.RigidBody` nodes, but it won't also detect any collisions with them. If `false`, it will interact with `godot.RigidBody` nodes like with `godot.StaticBody`.
Returns the `linear_velocity` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use `godot.KinematicBody.getSlideCollision`.
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlide")
public overload function moveAndSlide(linearVelocity:godot.Vector3, upDirection:Nullable1<godot.Vector3>, stopOnSlope:Bool):godot.Vector3;
/**
Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a `godot.KinematicBody` or `godot.RigidBody`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in `godot.Node._PhysicsProcess` (or in a method called by `godot.Node._PhysicsProcess`), as it uses the physics step's `delta` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
`linear_velocity` is the velocity vector (typically meters per second). Unlike in `godot.KinematicBody.moveAndCollide`, you should not multiply it by `delta` — the physics engine handles applying the velocity.
`up_direction` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of `Vector3(0, 0, 0)`, everything is considered a wall.
If `stop_on_slope` is `true`, body will not slide on slopes when you include gravity in `linear_velocity` and the body is standing still.
If the body collides, it will change direction a maximum of `max_slides` times before it stops.
`floor_max_angle` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees.
If `infinite_inertia` is `true`, body will be able to push `godot.RigidBody` nodes, but it won't also detect any collisions with them. If `false`, it will interact with `godot.RigidBody` nodes like with `godot.StaticBody`.
Returns the `linear_velocity` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use `godot.KinematicBody.getSlideCollision`.
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlide")
public overload function moveAndSlide(linearVelocity:godot.Vector3, upDirection:Nullable1<godot.Vector3>, stopOnSlope:Bool, maxSlides:Int):godot.Vector3;
/**
Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a `godot.KinematicBody` or `godot.RigidBody`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in `godot.Node._PhysicsProcess` (or in a method called by `godot.Node._PhysicsProcess`), as it uses the physics step's `delta` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
`linear_velocity` is the velocity vector (typically meters per second). Unlike in `godot.KinematicBody.moveAndCollide`, you should not multiply it by `delta` — the physics engine handles applying the velocity.
`up_direction` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of `Vector3(0, 0, 0)`, everything is considered a wall.
If `stop_on_slope` is `true`, body will not slide on slopes when you include gravity in `linear_velocity` and the body is standing still.
If the body collides, it will change direction a maximum of `max_slides` times before it stops.
`floor_max_angle` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees.
If `infinite_inertia` is `true`, body will be able to push `godot.RigidBody` nodes, but it won't also detect any collisions with them. If `false`, it will interact with `godot.RigidBody` nodes like with `godot.StaticBody`.
Returns the `linear_velocity` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use `godot.KinematicBody.getSlideCollision`.
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlide")
public overload function moveAndSlide(linearVelocity:godot.Vector3, upDirection:Nullable1<godot.Vector3>, stopOnSlope:Bool, maxSlides:Int, floorMaxAngle:Single):godot.Vector3;
/**
Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a `godot.KinematicBody` or `godot.RigidBody`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in `godot.Node._PhysicsProcess` (or in a method called by `godot.Node._PhysicsProcess`), as it uses the physics step's `delta` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
`linear_velocity` is the velocity vector (typically meters per second). Unlike in `godot.KinematicBody.moveAndCollide`, you should not multiply it by `delta` — the physics engine handles applying the velocity.
`up_direction` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of `Vector3(0, 0, 0)`, everything is considered a wall.
If `stop_on_slope` is `true`, body will not slide on slopes when you include gravity in `linear_velocity` and the body is standing still.
If the body collides, it will change direction a maximum of `max_slides` times before it stops.
`floor_max_angle` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees.
If `infinite_inertia` is `true`, body will be able to push `godot.RigidBody` nodes, but it won't also detect any collisions with them. If `false`, it will interact with `godot.RigidBody` nodes like with `godot.StaticBody`.
Returns the `linear_velocity` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use `godot.KinematicBody.getSlideCollision`.
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlide")
public overload function moveAndSlide(linearVelocity:godot.Vector3, upDirection:Nullable1<godot.Vector3>, stopOnSlope:Bool, maxSlides:Int, floorMaxAngle:Single, infiniteInertia:Bool):godot.Vector3;
#end
#if doc_gen
/**
Moves the body while keeping it attached to slopes. Similar to `godot.KinematicBody.moveAndSlide`.
As long as the `snap` vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting `snap` to `(0, 0, 0)` or by using `godot.KinematicBody.moveAndSlide` instead.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlideWithSnap")
public function moveAndSlideWithSnap(linearVelocity:godot.Vector3, snap:godot.Vector3, ?upDirection:Null<godot.Vector3>, ?stopOnSlope:Bool, ?maxSlides:Int, ?floorMaxAngle:Single, ?infiniteInertia:Bool):godot.Vector3;
#else
/**
Moves the body while keeping it attached to slopes. Similar to `godot.KinematicBody.moveAndSlide`.
As long as the `snap` vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting `snap` to `(0, 0, 0)` or by using `godot.KinematicBody.moveAndSlide` instead.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlideWithSnap")
public overload function moveAndSlideWithSnap(linearVelocity:godot.Vector3, snap:godot.Vector3):godot.Vector3;
/**
Moves the body while keeping it attached to slopes. Similar to `godot.KinematicBody.moveAndSlide`.
As long as the `snap` vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting `snap` to `(0, 0, 0)` or by using `godot.KinematicBody.moveAndSlide` instead.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlideWithSnap")
public overload function moveAndSlideWithSnap(linearVelocity:godot.Vector3, snap:godot.Vector3, upDirection:Nullable1<godot.Vector3>):godot.Vector3;
/**
Moves the body while keeping it attached to slopes. Similar to `godot.KinematicBody.moveAndSlide`.
As long as the `snap` vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting `snap` to `(0, 0, 0)` or by using `godot.KinematicBody.moveAndSlide` instead.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlideWithSnap")
public overload function moveAndSlideWithSnap(linearVelocity:godot.Vector3, snap:godot.Vector3, upDirection:Nullable1<godot.Vector3>, stopOnSlope:Bool):godot.Vector3;
/**
Moves the body while keeping it attached to slopes. Similar to `godot.KinematicBody.moveAndSlide`.
As long as the `snap` vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting `snap` to `(0, 0, 0)` or by using `godot.KinematicBody.moveAndSlide` instead.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlideWithSnap")
public overload function moveAndSlideWithSnap(linearVelocity:godot.Vector3, snap:godot.Vector3, upDirection:Nullable1<godot.Vector3>, stopOnSlope:Bool, maxSlides:Int):godot.Vector3;
/**
Moves the body while keeping it attached to slopes. Similar to `godot.KinematicBody.moveAndSlide`.
As long as the `snap` vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting `snap` to `(0, 0, 0)` or by using `godot.KinematicBody.moveAndSlide` instead.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlideWithSnap")
public overload function moveAndSlideWithSnap(linearVelocity:godot.Vector3, snap:godot.Vector3, upDirection:Nullable1<godot.Vector3>, stopOnSlope:Bool, maxSlides:Int, floorMaxAngle:Single):godot.Vector3;
/**
Moves the body while keeping it attached to slopes. Similar to `godot.KinematicBody.moveAndSlide`.
As long as the `snap` vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting `snap` to `(0, 0, 0)` or by using `godot.KinematicBody.moveAndSlide` instead.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 0, 0)
**/
@:native("MoveAndSlideWithSnap")
public overload function moveAndSlideWithSnap(linearVelocity:godot.Vector3, snap:godot.Vector3, upDirection:Nullable1<godot.Vector3>, stopOnSlope:Bool, maxSlides:Int, floorMaxAngle:Single, infiniteInertia:Bool):godot.Vector3;
#end
#if doc_gen
/**
Checks for collisions without moving the body. Virtually sets the node's position, scale and rotation to that of the given `godot.Transform`, then tries to move the body along the vector `rel_vec`. Returns `true` if a collision would stop the body from moving along the whole path.
Use `godot.KinematicBody.moveAndCollide` instead for detecting collision with touching bodies.
**/
@:native("TestMove")
public function testMove(from:godot.Transform, relVec:godot.Vector3, ?infiniteInertia:Bool):Bool;
#else
/**
Checks for collisions without moving the body. Virtually sets the node's position, scale and rotation to that of the given `godot.Transform`, then tries to move the body along the vector `rel_vec`. Returns `true` if a collision would stop the body from moving along the whole path.
Use `godot.KinematicBody.moveAndCollide` instead for detecting collision with touching bodies.
**/
@:native("TestMove")
public overload function testMove(from:godot.Transform, relVec:godot.Vector3):Bool;
/**
Checks for collisions without moving the body. Virtually sets the node's position, scale and rotation to that of the given `godot.Transform`, then tries to move the body along the vector `rel_vec`. Returns `true` if a collision would stop the body from moving along the whole path.
Use `godot.KinematicBody.moveAndCollide` instead for detecting collision with touching bodies.
**/
@:native("TestMove")
public overload function testMove(from:godot.Transform, relVec:godot.Vector3, infiniteInertia:Bool):Bool;
#end
/**
Returns `true` if the body collided with the floor on the last call of `godot.KinematicBody.moveAndSlide` or `godot.KinematicBody.moveAndSlideWithSnap`. Otherwise, returns `false`.
**/
@:native("IsOnFloor")
public function isOnFloor():Bool;
/**
Returns `true` if the body collided with the ceiling on the last call of `godot.KinematicBody.moveAndSlide` or `godot.KinematicBody.moveAndSlideWithSnap`. Otherwise, returns `false`.
**/
@:native("IsOnCeiling")
public function isOnCeiling():Bool;
/**
Returns `true` if the body collided with a wall on the last call of `godot.KinematicBody.moveAndSlide` or `godot.KinematicBody.moveAndSlideWithSnap`. Otherwise, returns `false`.
**/
@:native("IsOnWall")
public function isOnWall():Bool;
/**
Returns the surface normal of the floor at the last collision point. Only valid after calling `godot.KinematicBody.moveAndSlide` or `godot.KinematicBody.moveAndSlideWithSnap` and when `godot.KinematicBody.isOnFloor` returns `true`.
**/
@:native("GetFloorNormal")
public function getFloorNormal():godot.Vector3;
#if doc_gen
/**
Returns the floor's collision angle at the last collision point according to `up_direction`, which is `Vector3.UP` by default. This value is always positive and only valid after calling `godot.KinematicBody.moveAndSlide` and when `godot.KinematicBody.isOnFloor` returns `true`.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 1, 0)
**/
@:native("GetFloorAngle")
public function getFloorAngle(?upDirection:Null<godot.Vector3>):Single;
#else
/**
Returns the floor's collision angle at the last collision point according to `up_direction`, which is `Vector3.UP` by default. This value is always positive and only valid after calling `godot.KinematicBody.moveAndSlide` and when `godot.KinematicBody.isOnFloor` returns `true`.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 1, 0)
**/
@:native("GetFloorAngle")
public overload function getFloorAngle():Single;
/**
Returns the floor's collision angle at the last collision point according to `up_direction`, which is `Vector3.UP` by default. This value is always positive and only valid after calling `godot.KinematicBody.moveAndSlide` and when `godot.KinematicBody.isOnFloor` returns `true`.
@param upDirection If the parameter is null, then the default value is new Vector3(0, 1, 0)
**/
@:native("GetFloorAngle")
public overload function getFloorAngle(upDirection:Nullable1<godot.Vector3>):Single;
#end
/**
Returns the linear velocity of the floor at the last collision point. Only valid after calling `godot.KinematicBody.moveAndSlide` or `godot.KinematicBody.moveAndSlideWithSnap` and when `godot.KinematicBody.isOnFloor` returns `true`.
**/
@:native("GetFloorVelocity")
public function getFloorVelocity():godot.Vector3;
/**
Locks or unlocks the specified `axis` depending on the value of `lock`. See also `godot.KinematicBody.moveLockX`, `godot.KinematicBody.moveLockY` and `godot.KinematicBody.moveLockZ`.
**/
@:native("SetAxisLock")
public function setAxisLock(axis:godot.PhysicsServer_BodyAxis, lock:Bool):Void;
/**
Returns `true` if the specified `axis` is locked. See also `godot.KinematicBody.moveLockX`, `godot.KinematicBody.moveLockY` and `godot.KinematicBody.moveLockZ`.
**/
@:native("GetAxisLock")
public function getAxisLock(axis:godot.PhysicsServer_BodyAxis):Bool;
@:native("SetSafeMargin")
public function setSafeMargin(pixels:Single):Void;
@:native("GetSafeMargin")
public function getSafeMargin():Single;
/**
Returns the number of times the body collided and changed direction during the last call to `godot.KinematicBody.moveAndSlide` or `godot.KinematicBody.moveAndSlideWithSnap`.
**/
@:native("GetSlideCount")
public function getSlideCount():Int;
/**
Returns a `godot.KinematicCollision`, which contains information about a collision that occurred during the last call to `godot.KinematicBody.moveAndSlide` or `godot.KinematicBody.moveAndSlideWithSnap`. Since the body can collide several times in a single call to `godot.KinematicBody.moveAndSlide`, you must specify the index of the collision in the range 0 to (`godot.KinematicBody.getSlideCount` - 1).
**/
@:native("GetSlideCollision")
public function getSlideCollision(slideIdx:Int):godot.KinematicCollision;
/**
Returns a `godot.KinematicCollision`, which contains information about the latest collision that occurred during the last call to `godot.KinematicBody.moveAndSlide`.
**/
@:native("GetLastSlideCollision")
public function getLastSlideCollision():godot.KinematicCollision;
@:native("SetSyncToPhysics")
public function setSyncToPhysics(enable:Bool):Void;
@:native("IsSyncToPhysicsEnabled")
public function isSyncToPhysicsEnabled():Bool;
}