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

Implement per-instance custom bounding box #12645

Merged
merged 1 commit into from
Nov 20, 2017

Conversation

Zylann
Copy link
Contributor

@Zylann Zylann commented Nov 4, 2017

Allows to set custom bounding box for GeometryInstances. An example use case is when shader displacement is used, like with particles or heightmaps.
Note: this PR only implements the feature on VisualServer API.

Fixes #9544

This is the first time I modify VisualServer, tell me if I did anything wrong.

Note: I see that Particles already have customizable AABB for the same reason, however it is stored in RasterizerStorageGLES3... should I remove it now?

@ghost ghost added this to the 3.0 milestone Nov 5, 2017
@ghost ghost requested a review from reduz November 5, 2017 01:12
@@ -1015,6 +1015,9 @@ class VisualServerRaster : public VisualServer {
BIND3(instance_set_surface_material, RID, int, RID)
BIND2(instance_set_visible, RID, bool)

BIND2(instance_set_custom_aabb, RID, Rect3)
Copy link
Member

Choose a reason for hiding this comment

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

I would just use a single function, and assume AABB() (empty bounding box) is disabled.

Copy link
Member

Choose a reason for hiding this comment

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

Also needs a rebase since the re-rename from Rect3 to AABB.

# Conflicts:
#	servers/visual/visual_server_scene.h
@Zylann
Copy link
Contributor Author

Zylann commented Nov 20, 2017

Made it a single function and rebased

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.

3 participants