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

Add QuadMesh back as a subclass of PlaneMesh. #65918

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

clayjohn
Copy link
Member

Fixes: #65186

In #64801 we removed the QuadMesh in favour of PlaneMesh. However, this has led to confusion for many users as the button is suddenly gone. Even for users who were aware of the change, the extra steps to get a screen-aligned quad are seen as annoying. Changing the default orientation of PlaneMesh is not a good option as some users prefer it stay the way it is.

Overall, our goal behind #64801 was to remove code overhead and to bring features from PlaneMesh over to QuadMesh (namely subdivision and center). I believe this is achieved by exposing QuadMesh as a subclass of PlaneMesh. QuadMesh will still have all the features of PlaneMesh without us having to maintain two separate classes.

cc @QbieShay @RPicster @BastiaanOlij

@clayjohn clayjohn added this to the 4.0 milestone Sep 16, 2022
@clayjohn clayjohn requested a review from a team as a code owner September 16, 2022 17:57
@YuriSizov YuriSizov requested a review from a team September 16, 2022 18:02
Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uses the is-a relationship. 👍

@akien-mga
Copy link
Member

akien-mga commented Sep 17, 2022

You should also remove the compat mapping:

scene/register_scene_types.cpp
962:    ClassDB::add_compatibility_class("QuadMesh", "PlaneMesh");

BTW I noticed two typos worth fixing in "behavior" on this line (en_US spelling + actual typo):

doc/classes/PlaneMesh.xml
37:                     [PlaneMesh] will face the positive Z-axis. This matches the behvaiour of the QuadMesh in Godot 3.x.

doc/classes/QuadMesh.xml Outdated Show resolved Hide resolved
@BastiaanOlij
Copy link
Contributor

Owh, this is a nice way of dealing with this. Totally see how people are used to using QuadMesh for billboards and screen aligned stuff, while PlaneMesh is usually associated with creating a floor (heightmap). So the difference in default orientation in an otherwise identical implementation is a quality of life improvement. Subclassing solves that nicely.

This simplifies the creation of billboarded meshes without any code overhead.
@clayjohn
Copy link
Member Author

@akien-mga updated!

As a side, typing "behavior" physically hurts me. But it certainly beats "behvaiour"

@akien-mga akien-mga merged commit 73c35e8 into godotengine:master Sep 19, 2022
@akien-mga
Copy link
Member

Thanks!

@clayjohn clayjohn deleted the quadmesh branch November 15, 2022 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In Godot4 alpha 15 billboard particles are now missing Quad mesh option in the draw pass and shaders act weird
4 participants