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

Expose compute_convex_mesh_points function to GDScript #78871

Merged

Conversation

jitspoe
Copy link
Contributor

@jitspoe jitspoe commented Jun 30, 2023

A useful function that was only available in C++ before. Addresses request: godotengine/godot-proposals#6695

Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

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

This looks good to me, makes sense to expose functions we have internally that do something useful. The conversion from Array to Vector is what it is.

@@ -919,6 +919,17 @@ Geometry3D *Geometry3D::get_singleton() {
return singleton;
}

Vector<Vector3> Geometry3D::compute_convex_mesh_points(const TypedArray<Plane> &planes) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Little nitpick, naming convention wise, if we have a public function compute_convex_mesh_points that can't be called from GDScript, we call the wrapper function that does any conversions _compute_convex_mesh_points.

Copy link
Contributor

@BastiaanOlij BastiaanOlij Aug 9, 2023

Choose a reason for hiding this comment

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

(and this would be a protected method so as to not confuse what to call from C++ even if the method in GDScript does not have the _)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was going to rename this, but nothing else in core_bind.cpp follows that naming convention, so that would make this the outlier in this file.

@akien-mga akien-mga changed the title Expose compute_convex_mesh_points function to GDScript. Expose compute_convex_mesh_points function to GDScript Aug 9, 2023
core/core_bind.cpp Outdated Show resolved Hide resolved
@jitspoe jitspoe force-pushed the master.pr_compute_convex_mesh_points branch from 8d31a23 to 541b021 Compare August 15, 2023 02:38
@akien-mga akien-mga modified the milestones: 4.x, 4.2 Aug 15, 2023
@akien-mga akien-mga merged commit 20127ab into godotengine:master Aug 16, 2023
@akien-mga
Copy link
Member

Thanks!

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.

Allow convex collision shape creation from array of planes
4 participants