/
Shape2D.hx
72 lines (55 loc) · 3.98 KB
/
Shape2D.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
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
Base class for all 2D shapes. All 2D shape types inherit from this.
**/
@:libType
@:csNative
@:native("Godot.Shape2D")
@:autoBuild(godot.Godot.buildUserClass())
extern abstract class Shape2D extends godot.Resource {
/**
The shape's custom solver bias.
**/
@:native("CustomSolverBias")
public var customSolverBias:Single;
@:native("SetCustomSolverBias")
public function setCustomSolverBias(bias:Single):Void;
@:native("GetCustomSolverBias")
public function getCustomSolverBias():Single;
/**
Returns `true` if this shape is colliding with another.
This method needs the transformation matrix for this shape (`local_xform`), the shape to check collisions with (`with_shape`), and the transformation matrix of that shape (`shape_xform`).
**/
@:native("Collide")
public function collide(localXform:godot.Transform2D, withShape:godot.Shape2D, shapeXform:godot.Transform2D):Bool;
/**
Returns whether this shape would collide with another, if a given movement was applied.
This method needs the transformation matrix for this shape (`local_xform`), the movement to test on this shape (`local_motion`), the shape to check collisions with (`with_shape`), the transformation matrix of that shape (`shape_xform`), and the movement to test onto the other object (`shape_motion`).
**/
@:native("CollideWithMotion")
public function collideWithMotion(localXform:godot.Transform2D, localMotion:godot.Vector2, withShape:godot.Shape2D, shapeXform:godot.Transform2D, shapeMotion:godot.Vector2):Bool;
/**
Returns a list of contact point pairs where this shape touches another.
If there are no collisions, the returned list is empty. Otherwise, the returned list contains contact points arranged in pairs, with entries alternating between points on the boundary of this shape and points on the boundary of `with_shape`.
A collision pair A, B can be used to calculate the collision normal with `(B - A).normalized()`, and the collision depth with `(B - A).length()`. This information is typically used to separate shapes, particularly in collision solvers.
This method needs the transformation matrix for this shape (`local_xform`), the shape to check collisions with (`with_shape`), and the transformation matrix of that shape (`shape_xform`).
**/
@:native("CollideAndGetContacts")
public function collideAndGetContacts(localXform:godot.Transform2D, withShape:godot.Shape2D, shapeXform:godot.Transform2D):godot.collections.Array;
/**
Returns a list of contact point pairs where this shape would touch another, if a given movement was applied.
If there would be no collisions, the returned list is empty. Otherwise, the returned list contains contact points arranged in pairs, with entries alternating between points on the boundary of this shape and points on the boundary of `with_shape`.
A collision pair A, B can be used to calculate the collision normal with `(B - A).normalized()`, and the collision depth with `(B - A).length()`. This information is typically used to separate shapes, particularly in collision solvers.
This method needs the transformation matrix for this shape (`local_xform`), the movement to test on this shape (`local_motion`), the shape to check collisions with (`with_shape`), the transformation matrix of that shape (`shape_xform`), and the movement to test onto the other object (`shape_motion`).
**/
@:native("CollideWithMotionAndGetContacts")
public function collideWithMotionAndGetContacts(localXform:godot.Transform2D, localMotion:godot.Vector2, withShape:godot.Shape2D, shapeXform:godot.Transform2D, shapeMotion:godot.Vector2):godot.collections.Array;
/**
Draws a solid shape onto a `godot.CanvasItem` with the `godot.VisualServer` API filled with the specified `color`. The exact drawing method is specific for each shape and cannot be configured.
**/
@:native("Draw")
public function draw(canvasItem:godot.RID, color:godot.Color):Void;
}