Obi Official Forum
Fast Forward Rope Simulation - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Fast Forward Rope Simulation (/thread-4068.html)



Fast Forward Rope Simulation - vrtraining - 08-12-2023

We have a crane hook system with ropes. At the start crane is at rest position and all ropes and hooks fall in straight line due to gravity so we have defined our ropes blue print similar to that, so as soon as Unity scene is started ropes don't show any animation as their blue prints are aligned with same rest pose of the crane. Like shown in image A below

[Image: A.png]


Now in some cases crane needs to start as some lifted height and angle. But as soon as the scene start rope fall down due to gravy and swing for few seconds. As shown in image B below, is there any way that we skip those first initial steps that includes swinging of ropes and they start instantly in straight line.

[Image: B.png]

We want the desired result like image C below (which comes after few seconds as rope settles itself due to gravity). We can't use a different blue print since we dont know how many different crane starting positions can be, so we can't create a new blue print for each setup. Is there any way to fast forward or skip some steps. We want to somehow skip the initial swing of ropes and look like below

[Image: C.png]


RE: Fast Forward Rope Simulation - slimedev - 09-12-2023

You can modify ObiFixedUpdater* with a custom fixedDeltaTime, to try 2x or 5x the value.
Then fast-forward until all particle velocities are below some epsilon?

You could also save Positions and Velocities in text files, as opposed to new Rope Blueprints.

*In my case, I need Fluid Emitter particles to exist immediately after the Emitter is spawned, so call a FixedUpdate there.


RE: Fast Forward Rope Simulation - vrtraining - 09-12-2023

(09-12-2023, 02:30 AM)slimedev Wrote: You can modify ObiFixedUpdater* with a custom fixedDeltaTime, to try 2x or 5x the value.
Then fast-forward until all particle velocities are below some epsilon?

You could also save Positions and Velocities in text files, as opposed to new Rope Blueprints.

*In my case, I need Fluid Emitter particles to exist immediately after the Emitter is spawned, so call a FixedUpdate there.

ObiFixedUpdater is called independently from FixedUpdate in unity?


RE: Fast Forward Rope Simulation - josemendez - 09-12-2023

(09-12-2023, 01:41 PM)vrtraining Wrote: ObiFixedUpdater is called independently from FixedUpdate in unity?

Hi!

Not sure what you mean by “independently”. ObiFixedUpdater is a component that ticks the simulation during FixedUpdate(). So in that sense no, it’s not independent from Unity’s FixedUpdate.

Keep in mind that FixedUpdate is simply called by Unity at a fixed interval, which just also happens to be right before Unity updates its own physics engine. If you want to “fast-forward” both rigidbody and rope simulations, you need to advance both Unity’s own physics as well as all solvers in ObiFixedUpdater.

Kind regards,


RE: Fast Forward Rope Simulation - slimedev - 12-12-2023

(09-12-2023, 01:41 PM)vrtraining Wrote: ObiFixedUpdater is called independently from FixedUpdate in unity?

The screenshot is of my modified ObiFixedUpdater.cs, not the default
It would let you pass in exaggerated timestep values from your own script for the Fast Forward affect


Here is the bool I added, to disable the default FixedUpdate()