Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Getting Previous / Next Particle Index
#1
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.
Reply
#2
(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/manua...ropes.html

kind regards,
Reply
#3
(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/manua...ropes.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
Reply