Page 1 of 1

Make pizza shape

Posted: Mon Jan 06, 2020 5:39 am
by parapoohda
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)

Re: Make pizza shape

Posted: Mon Jan 06, 2020 7:31 pm
by Norbo
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.

Re: Make pizza shape

Posted: Tue Jan 07, 2020 1:16 am
by parapoohda
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?

Re: Make pizza shape

Posted: Tue Jan 07, 2020 1:41 am
by Norbo
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.