10-10-2021, 11:06 AM
(This post was last modified: 10-10-2021, 11:10 AM by josemendez.)
(10-10-2021, 07:24 AM)linkinb Wrote: I see that in examples I can access a filter property, and that is being changed by int filter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything, 0), But i can't find any documentation or tooltips on how to use this to set up collision filtering via script.
Like most things in Obi, filters are a per-particle property. The scripting section of the manual explains how to get/set per particle properties, and the filter is listed among them:
http://obi.virtualmethodstudio.com/manua...icles.html
For example, to set the filter for all particles in a rope you'd do:
Code:
var myFilter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything, 0);
for (int i = 0; i < rope.solverIndices.Length; ++i)
rope.solver.filters[rope.solverIndices[i]].filter = myFilter;