27-02-2019, 09:14 PM
(This post was last modified: 27-02-2019, 09:15 PM by josemendez.)
(27-02-2019, 06:55 PM)mmortall Wrote: Is there a way to pause/continue simulation for particluar ObiActor?
Currently, I use RemoteFromSolver to stop simulation and AddToSolver to restart simulation.
AddToSolver() just restart simulation from start by using mesh in the actor topology.
Is there a way to Pause simulation for a particular actor and then Continue so it will continue to simulate this actor?
After I pause actor I can move it or rotate. So after continue it will continue simulation by having new orientation.
I was trying to recreate topology from simulated result after last RemoteFromSolver call.
It is working but mesh is already deformed during past simulation and is not looks like it should.
Thanks.
Short answer, no.
The simulation runs as a whole for each solver, there's no way to simulate some actors independently from others unless they use different solvers (and then you can just disable/enable each solver individually to pause/resume the simulation.) However by doing that, if you moved the actor around while paused, the particles would spring from their old positions to the new ones as if you had teleported the object suddenly while the solver "wasn't looking" (which is precisely what you'd done from a simulation standpoint).
However, since you have full access to all particle properties at runtime you can manipulate them in any way you need/want to achieve the effect you're after.
The way to do what you want is to set all the actor particles inverse masses and velocities to zero ("pause" their sim), manually set their positions/orientations (move them around while paused), then reset their inverse masses back to what they were before pausing.
http://obi.virtualmethodstudio.com/tutor...icles.html
cheers,