Skip to content

Commit 1792d4e

Browse files
committed
Merge pull request #105048 from Mickeon/documentation-no-differences-RayCast
Fix differences between RayCast2D and RayCast3D documentation
2 parents 9d9e90b + 621500c commit 1792d4e

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

doc/classes/RayCast2D.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<class name="RayCast2D" inherits="Node2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
33
<brief_description>
4-
A ray in 2D space, used to find the first [CollisionObject2D] it intersects.
4+
A ray in 2D space, used to find the first collision object it intersects.
55
</brief_description>
66
<description>
7-
A raycast represents a ray from its origin to its [member target_position] that finds the closest [CollisionObject2D] along its path, if it intersects any.
7+
A raycast represents a ray from its origin to its [member target_position] that finds the closest object along its path, if it intersects any.
88
[RayCast2D] can ignore some objects by adding them to an exception list, by making its detection reporting ignore [Area2D]s ([member collide_with_areas]) or [PhysicsBody2D]s ([member collide_with_bodies]), or by configuring physics layers.
99
[RayCast2D] calculates intersection every physics frame, and it holds the result until the next physics frame. For an immediate raycast, or if you want to configure a [RayCast2D] multiple times within the same physics frame, use [method force_raycast_update].
1010
To sweep over a region of 2D space, you can approximate the region with multiple [RayCast2D]s or use [ShapeCast2D].
@@ -17,7 +17,7 @@
1717
<return type="void" />
1818
<param index="0" name="node" type="CollisionObject2D" />
1919
<description>
20-
Adds a collision exception so the ray does not report collisions with the specified [CollisionObject2D] node.
20+
Adds a collision exception so the ray does not report collisions with the specified [param node].
2121
</description>
2222
</method>
2323
<method name="add_exception_rid">
@@ -44,6 +44,7 @@
4444
<return type="Object" />
4545
<description>
4646
Returns the first object that the ray intersects, or [code]null[/code] if no object is intersecting the ray (i.e. [method is_colliding] returns [code]false[/code]).
47+
[b]Note:[/b] This object is not guaranteed to be a [CollisionObject2D]. For example, if the ray intersects a [TileMapLayer], the method will return a [TileMapLayer] instance.
4748
</description>
4849
</method>
4950
<method name="get_collider_rid" qualifiers="const">
@@ -104,14 +105,14 @@
104105
<return type="void" />
105106
<param index="0" name="node" type="CollisionObject2D" />
106107
<description>
107-
Removes a collision exception so the ray does report collisions with the specified [CollisionObject2D] node.
108+
Removes a collision exception so the ray can report collisions with the specified specified [param node].
108109
</description>
109110
</method>
110111
<method name="remove_exception_rid">
111112
<return type="void" />
112113
<param index="0" name="rid" type="RID" />
113114
<description>
114-
Removes a collision exception so the ray does report collisions with the specified [RID].
115+
Removes a collision exception so the ray can report collisions with the specified [RID].
115116
</description>
116117
</method>
117118
<method name="set_collision_mask_value">
@@ -137,13 +138,13 @@
137138
If [code]true[/code], collisions will be reported.
138139
</member>
139140
<member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" default="true">
140-
If [code]true[/code], the parent node will be excluded from collision detection.
141+
If [code]true[/code], this raycast will not report collisions with its parent node. This property only has an effect if the parent node is a [CollisionObject2D]. See also [method Node.get_parent] and [method add_exception].
141142
</member>
142143
<member name="hit_from_inside" type="bool" setter="set_hit_from_inside" getter="is_hit_from_inside_enabled" default="false">
143144
If [code]true[/code], the ray will detect a hit when starting inside shapes. In this case the collision normal will be [code]Vector2(0, 0)[/code]. Does not affect concave polygon shapes.
144145
</member>
145146
<member name="target_position" type="Vector2" setter="set_target_position" getter="get_target_position" default="Vector2(0, 50)">
146-
The ray's destination point, relative to the RayCast's [code]position[/code].
147+
The ray's destination point, relative to this raycast's [member Node2D.position].
147148
</member>
148149
</members>
149150
</class>

doc/classes/RayCast3D.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<class name="RayCast3D" inherits="Node3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
33
<brief_description>
4-
A ray in 3D space, used to find the first object it intersects.
4+
A ray in 3D space, used to find the first collision object it intersects.
55
</brief_description>
66
<description>
77
A raycast represents a ray from its origin to its [member target_position] that finds the closest object along its path, if it intersects any.
@@ -18,7 +18,7 @@
1818
<return type="void" />
1919
<param index="0" name="node" type="CollisionObject3D" />
2020
<description>
21-
Adds a collision exception so the ray does not report collisions with the specified [CollisionObject3D] node.
21+
Adds a collision exception so the ray does not report collisions with the specified [param node].
2222
</description>
2323
</method>
2424
<method name="add_exception_rid">
@@ -112,14 +112,14 @@
112112
<return type="void" />
113113
<param index="0" name="node" type="CollisionObject3D" />
114114
<description>
115-
Removes a collision exception so the ray does report collisions with the specified [CollisionObject3D] node.
115+
Removes a collision exception so the ray can report collisions with the specified [param node].
116116
</description>
117117
</method>
118118
<method name="remove_exception_rid">
119119
<return type="void" />
120120
<param index="0" name="rid" type="RID" />
121121
<description>
122-
Removes a collision exception so the ray does report collisions with the specified [RID].
122+
Removes a collision exception so the ray can report collisions with the specified [RID].
123123
</description>
124124
</method>
125125
<method name="set_collision_mask_value">
@@ -152,7 +152,7 @@
152152
If [code]true[/code], collisions will be reported.
153153
</member>
154154
<member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" default="true">
155-
If [code]true[/code], collisions will be ignored for this RayCast3D's immediate parent.
155+
If [code]true[/code], this raycast will not report collisions with its parent node. This property only has an effect if the parent node is a [CollisionObject3D]. See also [method Node.get_parent] and [method add_exception].
156156
</member>
157157
<member name="hit_back_faces" type="bool" setter="set_hit_back_faces" getter="is_hit_back_faces_enabled" default="true">
158158
If [code]true[/code], the ray will hit back faces with concave polygon shapes with back face enabled or heightmap shapes.
@@ -161,7 +161,7 @@
161161
If [code]true[/code], the ray will detect a hit when starting inside shapes. In this case the collision normal will be [code]Vector3(0, 0, 0)[/code]. Does not affect shapes with no volume like concave polygon or heightmap.
162162
</member>
163163
<member name="target_position" type="Vector3" setter="set_target_position" getter="get_target_position" default="Vector3(0, -1, 0)">
164-
The ray's destination point, relative to the RayCast's [code]position[/code].
164+
The ray's destination point, relative to this raycast's [member Node3D.position].
165165
</member>
166166
</members>
167167
</class>

0 commit comments

Comments
 (0)