Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Resetting Rope causing Error
#4
(07-08-2024, 08:06 AM)josemendez Wrote: Hi!

ResetParticles() is much faster, as it doesn't take the entire rope out of the solver and then re-add it: it just resets particle data to whatever's in the blueprint. RemoveFromSolver()/AddToSolver() would destroy all particle/constraint data for that actor and recreate it anew, and trigger a full rebatching of all constraints in the solver.

However, ResetParticles won't reset constraints or elements (it only resets particles as the name implies) so if you're changing the length or the rope -which means constraints and elements are added at runtime- it won't work.

Also be mindful of *when* you call RemoveFromSolver() / AddToSolver(). In Obi 6 these are safe to be called anytime except FixedUpdate(), in Obi 7 calling them during Update() would resultĀ in them being called while the simulation is running, and you'd be pulling the rug from under the simulation's feet by modifying state from the main thread.

We'll upload updated API docs for Obi 7 later today, were these differences are highlighted.

kind regards,

Thanks, it seems to be working fine for now. Like I reset particles and then I change length back to initial in very next line. I get the rope back at initial position with same length. You are saying it won't work, it means there could be some issue with it?
Reply


Messages In This Thread
Resetting Rope causing Error - by vrtraining - 06-08-2024, 06:33 PM
RE: Resetting Rope causing Error - by vrtraining - 07-08-2024, 07:13 AM
RE: Resetting Rope causing Error - by josemendez - 07-08-2024, 08:06 AM
RE: Resetting Rope causing Error - by vrtraining - 07-08-2024, 08:47 AM
RE: Resetting Rope causing Error - by josemendez - 07-08-2024, 09:38 AM
RE: Resetting Rope causing Error - by vrtraining - 07-08-2024, 09:40 AM
RE: Resetting Rope causing Error - by josemendez - 07-08-2024, 10:20 AM
RE: Resetting Rope causing Error - by vrtraining - 07-08-2024, 10:45 AM
RE: Resetting Rope causing Error - by josemendez - 07-08-2024, 11:53 AM
RE: Resetting Rope causing Error - by josemendez - 07-08-2024, 12:15 PM
RE: Resetting Rope causing Error - by vrtraining - 07-08-2024, 12:50 PM