Obi Official Forum
Particles position - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html)
+--- Thread: Particles position (/thread-1577.html)



Particles position - djsaman - 19-12-2019

Hello!

Can help me how to get simulated particle position in script?


RE: Particles position - josemendez - 19-12-2019

(19-12-2019, 01:04 PM)djsaman Wrote: Hello!

Can help me how to get simulated particle position in script?

Yep. There's a manual page dedicated entirely to that:
http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html

Basically you do:

Code:
// solver index of the first particle in the actor.
int solverIndex = actor.solverIndices[particleIndex];

// use it to get the particle's current position.
var position = solver.positions[solverIndex];