Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  particle like obiactor
#1
Hi again!

I was wondering if it's possible to treat each particle of a ObiCloth like a ObiActor, so move them in a desired position for example. In particular, I would like doing a suturing task like the medical procedure in which the two parts of a wound have to enlace using a rope. Thanks in advice.
Reply
#2
(01-04-2022, 04:09 PM)maygdirf Wrote: Hi again!

I was wondering if it's possible to treat each particle of a ObiCloth like a ObiActor, so move them in a desired position for example. In particular, I would like doing a suturing task like the medical procedure in which the two parts of a wound have to enlace using a rope. Thanks in advice.

Hi there,


You can both get and set any individual per-particle property (such as position, velocity, mass, etc) using the particles API:
http://obi.virtualmethodstudio.com/manua...icles.html

kind regards,
Reply
#3
(03-04-2022, 12:48 PM)josemendez Wrote: Hi there,


You can both get and set any individual per-particle property (such as position, velocity, mass, etc) using the particles API:
http://obi.virtualmethodstudio.com/manua...icles.html

kind regards,

Clear! But to set a desired position, I have to make a transformation from the solver to the global space, right?
Reply
#4
(04-04-2022, 02:44 PM)maygdirf Wrote: Clear! But to set a desired position, I have to make a transformation from the solver to the global space, right?

Right. All properties in Obi are expressed in the solver's local space, so you have to do the required conversions.

Unity's Transform/InverseTransform family of functions do the job nicely. For instance, to take a position from solver's local space to world space, you'd use: https://docs.unity3d.com/ScriptReference...Point.html
Reply
#5
(04-04-2022, 02:54 PM)josemendez Wrote: Right. All properties in Obi are expressed in the solver's local space, so you have to do the required conversions.

Unity's Transform/InverseTransform family of functions do the job nicely. For instance, to take a position from solver's local space to world space, you'd use: https://docs.unity3d.com/ScriptReference...Point.html
I have to use the renderablePosition or the "classic" one?
Reply
#6
(04-04-2022, 04:47 PM)maygdirf Wrote: I have to use the renderablePosition or the "classic" one?

It depends on what you want to do. As the name implies, "renderablePositions" are used exclusively for rendering. Modifying them has no impact on the simulation, as they are reset to the (possibly interpolated, depending on your settings) regular positions right after simulation has finished each frame.

Regular "positions" are the ones used for the simulation.

To sum up:
If you want to physically move particles around, use positions.
If you're only interested in "post-processing" positions every frame, use renderablePositions.
Reply