Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector3.slide() needs expansion. #8286

Closed
esklarski opened this issue Oct 20, 2023 · 0 comments · Fixed by godotengine/godot#83691
Closed

Vector3.slide() needs expansion. #8286

esklarski opened this issue Oct 20, 2023 · 0 comments · Fixed by godotengine/godot#83691
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement

Comments

@esklarski
Copy link

esklarski commented Oct 20, 2023

Your Godot version:
4.1

Issue description:
I'm new to Godot and was thrown for a loop re Vector3.project() not doing what I expected. As per this issue it turns out I wanted the rejection vector, provided by Vector3.slide() but "slide" is a unique name for this function.

Not wanting to propose breaking changes, I'd rather update the class manual to clarify these two methods.

I'm thinking something like:

Vector3.slide(n:Vector3): Returns a new vector slid (or projected) along a plane defined by the given normal. Also known as the rejection vector. Returns component perpendicular to [ n ]. See also: [Vector3.project]

Vector3.project(b:Vector3): Returns the result of projecting the vector onto the given vector [ b ]. Returns component parellel to [ b ]. See also: [Vector3.slide]

I am working on making a fork and changes but thought I'd start by discussing the text.

URL to the documentation page (if already existing):
Manual: Vector3 Class Manual
git: Vector3 Class xml

Changes to class xml:

<method name="slide" qualifiers="const">
	<return type="Vector3" />
	<param index="0" name="n" type="Vector3" />
	<description>
		Returns a new vector slid (or projected) along a plane defined by the given normal. Also known as the `rejection` vector. Returns component perpendicular to [param n].[br]See also: [method Vector3.project]
	</description>
</method>
<method name="project" qualifiers="const">
	<return type="Vector3" />
	<param index="0" name="b" type="Vector3" />
	<description>
		Returns the result of projecting the vector onto the given vector [param b]. Returns component parellel to [param b].[br]See also: [method Vector3.slide]
	</description>
</method>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants