Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Getting particle connections
#3
Hi there,

Ropes use elements as a high-level description of connectivity. You can think of an element as the "edge" joining two particles.

Each element is a struct that contains the solver indices of the 2 particles joined by it. You can get a list of elements in the rope by accessing the "elements" array in the rope:
Code:
var element = rope.elements;
Unlike constraints, elements are always guaranteed to appear in this array in the same order as they appear in the rope. So if you find that the second particle of element i is not the same as the first particle in element i+1, you know there's a discontinuity (cut) at that point.

This is what renderers use to render torn ropes.

Quote:Further, how do we tell whether particles are "control points" (i.e. points from the blueprint that can have attachments) or regular points?

A particle group is generated for each control point, containing the index of the single particle at that point. You can find all groups of a blueprint by doing:
Code:
ropeBlueprint.groups

However there's no direct way to tell if a given particle "is a control point", you'd need to iterate over all particle groups to see if the given particle index is part of any of them.
Reply


Messages In This Thread
Getting particle connections - by SpiralCircus - 03-04-2020, 05:25 PM