Merge pull request #91376 from clayjohn/DOCS-reflect-vec3

Update the description and parameter name for Vector3 reflect to correct how the plane is constructed
This commit is contained in:
Rémi Verschelde 2024-05-01 09:55:27 +02:00
commit 4e30bc71f5
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 4 additions and 4 deletions

View file

@ -1896,7 +1896,7 @@ static void _register_variant_builtin_methods() {
bind_method(Vector3, project, sarray("b"), varray());
bind_method(Vector3, slide, sarray("n"), varray());
bind_method(Vector3, bounce, sarray("n"), varray());
bind_method(Vector3, reflect, sarray("direction"), varray());
bind_method(Vector3, reflect, sarray("n"), varray());
bind_method(Vector3, sign, sarray(), varray());
bind_method(Vector3, octahedron_encode, sarray(), varray());
bind_static_method(Vector3, octahedron_decode, sarray("uv"), varray());

View file

@ -307,10 +307,10 @@
</method>
<method name="reflect" qualifiers="const">
<return type="Vector3" />
<param index="0" name="direction" type="Vector3" />
<param index="0" name="n" type="Vector3" />
<description>
Returns the result of reflecting the vector from a plane defined by the given direction vector [param direction].
[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].
Returns the result of reflecting the vector through a plane defined by the given normal vector [param n].
[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].
</description>
</method>
<method name="rotated" qualifiers="const">