Make pizza shape

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
parapoohda
Posts: 84
Joined: Fri May 31, 2019 6:30 am

Make pizza shape

Post by parapoohda » Mon Jan 06, 2020 5:39 am

I want to make pizza shape (circular section) for skill collision.
Should I use

1 convex hull
1.1 convex hull to make pizza shape with thickness.
1.2 cylinder with triangular prism(create from convex hull).
3 cylinder with triangle.

Or there are better way to do this

It seem I can't see triangle for some reason. Is this normal?
I use triangle constructor

Code: Select all

 Triangle(in Vector3 a, in Vector3 b, in Vector3 c)

Norbo
Site Admin
Posts: 4835
Joined: Tue Jul 04, 2006 4:45 am

Re: Make pizza shape

Post by Norbo » Mon Jan 06, 2020 7:31 pm

A single convex hull would be pretty easy.

If you don't need contact-level precision, you could also do something like check the position of other objects relative to the query. If the distance squared is too far or if the dot(normalize(objectPosition - queryPosition), queryDirection) < cos(maximumAngle), then the object is outside the slice.
It seem I can't see triangle for some reason. Is this normal?
Triangles are one sided. They don't generate collisions on their backface. The demos renderer renders them as one sided too, so their backface is invisible.

parapoohda
Posts: 84
Joined: Fri May 31, 2019 6:30 am

Re: Make pizza shape

Post by parapoohda » Tue Jan 07, 2020 1:16 am

Thank you. :D :D :D

Could you tell me what is contact-level precision?
Is it mean if some part in but center of mass is outside then it is no collision?

Norbo
Site Admin
Posts: 4835
Joined: Tue Jul 04, 2006 4:45 am

Re: Make pizza shape

Post by Norbo » Tue Jan 07, 2020 1:41 am

Is it mean if some part in but center of mass is outside then it is no collision?
Basically, yup- if you don't actually care about the shape and just want to know if a representative point is in your query, there's no need to use a full collision test.

Post Reply