18-10-2021, 07:39 AM
(This post was last modified: 18-10-2021, 07:40 AM by josemendez.)
(16-10-2021, 11:23 AM)Snail921 Wrote: the stitched particles are not lined up smoothly and they seem they are fighting (colliding) each other.
That's because they probably are!
Unless you explicitly disable collisions between these particles, they will collide with each other. Coupled with the stitch constraints, this will lead to constraint fighting: particles are simultaneously trying to be exactly on top of each other (stitch), and away from each other (collision).
This is the same issue described in the manual that happens between colliders and particles when using dynamic attachments (pin constraints):
http://obi.virtualmethodstudio.com/manua...aints.html
Just set the collision filters so that these particles in particular don't collide with each other. For info on collision filtering, see "collision filtering" in the collisions page:
http://obi.virtualmethodstudio.com/manua...sions.html
At runtime, filters are just another per-particle property (like positions, velocities, etc), you can set them the usual way:
http://obi.virtualmethodstudio.com/manua...icles.html
Obi contains a helper function (ObiUtils.MakeFilter) to build filters for you, so that you don't have to deal with bitwise operations too much. Filters are made of a mask and a category. The mask is the first parameter of the function. Just keep in mind the mask is a bit mask (just like Unity's layer masks), so you build it by simply or'ing together bits. For instance, to build a filter set in category 0, that only collides with categories 1, 3, and 6:
Code:
int mask = (1 << 1) | (1 << 3) | (1 << 6);
int category = 0;
int filter = ObiUtils.MakeFilter(mask, category);