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 getVertices to ConvexShape #826

Closed
wants to merge 1 commit into from

Conversation

xiejiangzhi
Copy link
Contributor

No description provided.

@xiejiangzhi xiejiangzhi changed the title Add getPoints & getIndices to ConvexShape Add getIndices to ConvexShape Dec 27, 2024
@xiejiangzhi xiejiangzhi changed the title Add getIndices to ConvexShape Add getVertices to ConvexShape Dec 28, 2024
@bjornbytes
Copy link
Owner

I feel like the API here is too opinionated/specific.

  • It uses a hardcoded data format. So if someone wants something slightly different (smooth normals, packed normals, extra attributes), then they have to give up and rewrite it in Lua.
  • The data it returns is already exposed by :getPoint and :getFace, so it's already possible to write this in Lua.
  • There aren't really places in the existing API where we return a vertex blob unless you count ModelData:getBlob.

For now I'd recommend moving this code to Lua or keeping it on a fork.

I do still think the current API for the convex hull data is a little clunky. Adding :getPoints may help, for people that want all the points in a table anyway. Or it could return multiple returns like LÖVE's PolygonShape:getPoints does, but I'm not sure what the max number of points in the hull is, so it might be too many return values.

@bjornbytes bjornbytes closed this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants