Skip to content
0.2.0-dev Download ZIP
92 lines ·3.5 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="PhysicsTestMotionResult2D" inherits="RefCounted" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 Describes the motion and collision result from [method PhysicsServer2D.body_test_motion].
5 </brief_description>
6 <description>
7 Describes the motion and collision result from [method PhysicsServer2D.body_test_motion].
8 [b]Note:[/b] For optimal performance results, it is recommended to create this object in advance, store it, and reuse it for every subsequent query.
9 </description>
10 <tutorials>
11 </tutorials>
12 <methods>
13 <method name="get_collider" qualifiers="const">
14 <return type="Object" />
15 <description>
16 Returns the colliding body's attached [Object], if a collision occurred.
17 </description>
18 </method>
19 <method name="get_collider_id" qualifiers="const">
20 <return type="int" />
21 <description>
22 Returns the unique instance ID of the colliding body's attached [Object], if a collision occurred. See [method Object.get_instance_id].
23 </description>
24 </method>
25 <method name="get_collider_rid" qualifiers="const">
26 <return type="RID" />
27 <description>
28 Returns the colliding body's [RID] used by the [PhysicsServer2D], if a collision occurred.
29 </description>
30 </method>
31 <method name="get_collider_shape" qualifiers="const">
32 <return type="int" />
33 <description>
34 Returns the colliding body's shape index, if a collision occurred. See [CollisionObject2D].
35 </description>
36 </method>
37 <method name="get_collider_velocity" qualifiers="const">
38 <return type="Vector2" />
39 <description>
40 Returns the colliding body's velocity, if a collision occurred.
41 </description>
42 </method>
43 <method name="get_collision_depth" qualifiers="const">
44 <return type="float" />
45 <description>
46 Returns the length of overlap along the collision normal, if a collision occurred.
47 </description>
48 </method>
49 <method name="get_collision_local_shape" qualifiers="const">
50 <return type="int" />
51 <description>
52 Returns the moving object's colliding shape, if a collision occurred.
53 </description>
54 </method>
55 <method name="get_collision_normal" qualifiers="const">
56 <return type="Vector2" />
57 <description>
58 Returns the colliding body's shape's normal at the point of collision, if a collision occurred.
59 </description>
60 </method>
61 <method name="get_collision_point" qualifiers="const">
62 <return type="Vector2" />
63 <description>
64 Returns the point of collision in global coordinates, if a collision occurred.
65 </description>
66 </method>
67 <method name="get_collision_safe_fraction" qualifiers="const">
68 <return type="float" />
69 <description>
70 Returns the maximum fraction of the motion that can occur without a collision, between [code]0[/code] and [code]1[/code].
71 </description>
72 </method>
73 <method name="get_collision_unsafe_fraction" qualifiers="const">
74 <return type="float" />
75 <description>
76 Returns the minimum fraction of the motion needed to collide, if a collision occurred, between [code]0[/code] and [code]1[/code].
77 </description>
78 </method>
79 <method name="get_remainder" qualifiers="const">
80 <return type="Vector2" />
81 <description>
82 Returns the moving object's remaining movement vector.
83 </description>
84 </method>
85 <method name="get_travel" qualifiers="const">
86 <return type="Vector2" />
87 <description>
88 Returns the moving object's travel before collision.
89 </description>
90 </method>
91 </methods>
92</class>