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

Update torus primitive #4256

Merged
merged 3 commits into from
May 19, 2022
Merged

Update torus primitive #4256

merged 3 commits into from
May 19, 2022

Conversation

slimbuck
Copy link
Member

This PR:

  • adds support for torus to getShapePrimitive
  • calculates torus area
  • sets the second set of UVs on torus prim (like the others)

! Make torus great again !

@slimbuck slimbuck added enhancement area: graphics Graphics related issue labels May 17, 2022
@slimbuck slimbuck requested a review from a team May 17, 2022 17:15
@slimbuck slimbuck self-assigned this May 17, 2022
Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

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

Nice! I look forward seeing it in the Editor in the future.

@willeastcott
Copy link
Contributor

I'm cool with this. Some notes:

  1. One of the reasons torus was never exposed to the Editor is that there's no torus collision shape available. And it seemed nice to keep the visual and physics list of shapes the same.
  2. If we want to add more procedural shapes in the future, where should they live? Do we want the core library bloated with torus knots and teapots....or should shapes be in some external sets of library scripts?

@slimbuck slimbuck merged commit 03649c6 into playcanvas:main May 19, 2022
@slimbuck slimbuck deleted the torus branch May 19, 2022 11:23
@LeXXik
Copy link
Contributor

LeXXik commented May 19, 2022

Just to note, that torus could collide with other dynamic mesh, if it were created as convex hull mesh. Currently all mesh colliders use btBvhTriangleMeshShape, which is optimized in Bullet for static meshes. Convex hulls are more expensive, but they can collide with each other even being dynamic. There was an ancient issue about it: #123 (still open miraculously)

I would vote for keeping them as external, like the post effects. This would allow adding teapots and whatnot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants