Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope pin+collision problem.
#3
(02-08-2021, 07:46 AM)josemendez Wrote: This situation (along with its solution) is described in the pin constraints section of the manual. See "pin constraints and collisions":
http://obi.virtualmethodstudio.com/manua...aints.html

You need to use collision filtering to disable collisions between the pinned particles only. All other particles in the rope can still collide with each other just fine. See:
http://obi.virtualmethodstudio.com/manua...sions.html

You can change collision filters on a per-control point basis in the path editor. If you're creating ropes programmatically, you can pass the filter value to path.AddControlPoint(). This is a 32-bit integer where the 16 most significant bits define the collision mask, and the 16 less significant bits define the category.

You can build the filter yourself using bitwise operations, and there's also helper functions if you don't want to mess with bits yourself. ObiUtils.MakeFilter will create the filter for you given a mask and a category. For instance:


Code:
int filter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything,0);

This builds a filter for category 0 that collides with everything.

Thanks for the reply!

I've been using the filter variable already to configure various materials for different types of collisions (for example, structural materials like support beams allow objects to move through them).

I have tried to find a way to specifically access the first and last particle (as those are the ones that get pinned) to be able to change their collisions but I can't figure out how to do this.

This is a rough idea of the order my rope script goes through (it's very similar to the RopeNet script):
  • Create the rope blueprint
  • Set int filter
  • blueprint.AddControlPoint(filter goes here)
  • Then pin the points, and use ObiPinConstraintsBatch with AddConstraint(rope.solverIndices[0]...)
The closest thing I've come too is thinking is I need to use something like "rope.solverIndices[index value]" as, from what I can tell, this corresponds to each particle on the rope (and potentially they store the collision profile), but I can't actually access their filter data.

My thinking is a generate the rope with the filter profile I need, and then I do something like
  • rope.path.point[value of particle to change].filter = ObiUtils.MakeFilter(ObiUtils.CollideWithNothing, 0);
This way only that specific particle loses it's collision, but the rest remain intact.
Reply


Messages In This Thread
Rope pin+collision problem. - by WinterXYZ - 01-08-2021, 02:42 PM
RE: Rope pin+collision problem. - by josemendez - 02-08-2021, 07:46 AM
RE: Rope pin+collision problem. - by WinterXYZ - 06-08-2021, 05:38 PM
RE: Rope pin+collision problem. - by Destro26 - 22-06-2022, 09:55 PM
RE: Rope pin+collision problem. - by josemendez - 23-06-2022, 07:10 AM
RE: Rope pin+collision problem. - by Destro26 - 23-06-2022, 09:13 PM
RE: Rope pin+collision problem. - by josemendez - 24-06-2022, 07:09 AM