Skip to content

Commit 4e30bc7

Browse files
committed
Merge pull request godotengine#91376 from clayjohn/DOCS-reflect-vec3
Update the description and parameter name for Vector3 reflect to correct how the plane is constructed
2 parents 3ebef6c + 4d580b1 commit 4e30bc7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/variant/variant_call.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,7 @@ static void _register_variant_builtin_methods() {
18961896
bind_method(Vector3, project, sarray("b"), varray());
18971897
bind_method(Vector3, slide, sarray("n"), varray());
18981898
bind_method(Vector3, bounce, sarray("n"), varray());
1899-
bind_method(Vector3, reflect, sarray("direction"), varray());
1899+
bind_method(Vector3, reflect, sarray("n"), varray());
19001900
bind_method(Vector3, sign, sarray(), varray());
19011901
bind_method(Vector3, octahedron_encode, sarray(), varray());
19021902
bind_static_method(Vector3, octahedron_decode, sarray("uv"), varray());

doc/classes/Vector3.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,10 @@
307307
</method>
308308
<method name="reflect" qualifiers="const">
309309
<return type="Vector3" />
310-
<param index="0" name="direction" type="Vector3" />
310+
<param index="0" name="n" type="Vector3" />
311311
<description>
312-
Returns the result of reflecting the vector from a plane defined by the given direction vector [param direction].
313-
[b]Note:[/b] [method reflect] differs from what other engines and frameworks call [code skip-lint]reflect()[/code]. In other engines, [code skip-lint]reflect()[/code] takes a normal direction which is a direction perpendicular to the plane. In Godot, you specify a direction parallel to the plane. See also [method bounce] which does what most engines call [code skip-lint]reflect()[/code].
312+
Returns the result of reflecting the vector through a plane defined by the given normal vector [param n].
313+
[b]Note:[/b] [method reflect] differs from what other engines and frameworks call [code skip-lint]reflect()[/code]. In other engines, [code skip-lint]reflect()[/code] returns the result of the vector reflected by the given plane. The reflection thus passes through the given normal. While in Godot the reflection passes through the plane and can be thought of as bouncing off the normal. See also [method bounce] which does what most engines call [code skip-lint]reflect()[/code].
314314
</description>
315315
</method>
316316
<method name="rotated" qualifiers="const">

0 commit comments

Comments
 (0)