05-04-2020, 03:22 PM
(This post was last modified: 05-04-2020, 03:25 PM by josemendez.)
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:
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.
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:
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.
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;
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.