Obi Official Forum
Help Getting Previous / Next Particle Index - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Getting Previous / Next Particle Index (/thread-3316.html)



Getting Previous / Next Particle Index - Henning - 11-02-2022

Hi Obi team,

I have a rope on a 2D surface and I am trying to find the rotation (the yaw angle) of specific particles.

The index of the target particles is already know. My current method is to find the previous and next particle to estimate this angle.

However, it seems like the adjacent particle indeces from the blueprint are not the real adjacent particles.

I saw in some other posts that the ObiPathSmoother and GetSectionAt can be used to acquire an correct index list. But the compiler is telling me the ObiPathFrame does not have definition for paritcle1.

Is there any suggestions on getting the adjacent particle indeces?

Many thanks.


RE: Getting Previous / Next Particle Index - josemendez - 11-02-2022

(11-02-2022, 12:34 PM)Henning Wrote: Hi Obi team,

I have a rope on a 2D surface and I am trying to find the rotation (the yaw angle) of specific particles.

The index of the target particles is already know. My current method is to find the previous and next particle to estimate this angle.

However, it seems like the adjacent particle indeces from the blueprint are not the real adjacent particles.

I saw in some other posts that the ObiPathSmoother and GetSectionAt can be used to acquire an correct index list. But the compiler is telling me the ObiPathFrame does not have definition for paritcle1.

Is there any suggestions on getting the adjacent particle indeces?

Many thanks.

Hi there!

ObiPathFrame is a orthonormal frame, which contains position, normal, tangent, of a point along the rope path. It's only used for rendering and has nothing to do with particle indexing. You want to access the rope.elements array instead, which contains ObiStructuralElements. Each element defines particle1 and particle2, which is what you're looking for.

See the manual for more information on how to deal with particle indexing in resizable/tearable ropes, as well as some examples:
http://obi.virtualmethodstudio.com/manual/6.3/scriptingropes.html

kind regards,


RE: Getting Previous / Next Particle Index - Henning - 17-02-2022

(11-02-2022, 12:43 PM)josemendez Wrote: Hi there!

ObiPathFrame is a orthonormal frame, which contains position, normal, tangent, of a point along the rope path. It's only used for rendering and has nothing to do with particle indexing. You want to access the rope.elements array instead, which contains ObiStructuralElements. Each element defines particle1 and particle2, which is what you're looking for.

See the manual for more information on how to deal with particle indexing in resizable/tearable ropes, as well as some examples:
http://obi.virtualmethodstudio.com/manual/6.3/scriptingropes.html

kind regards,

Hi! Thanks for the detailed reply! I eventually just used the index from the blueprint (I set the pooled particles to be 0) and it seems to be working fine!

Regards