Obi Official Forum
Help Pull particles in a given direction - 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: Help Pull particles in a given direction (/thread-2939.html)

Pages: 1 2


RE: Pull particles in a given direction - xkalibrx - 25-05-2021

(25-05-2021, 12:32 PM)josemendez Wrote: That's basically what particles do by default. The bulge will move according to what it is colliding against, eg: if it has a wall on its right side, it will move to the left. The right side of the rope will be flat against the wall, and the left side will bulge out.

As I pointed out, particle radius is the collision radius. If you've changed the radius, this is the behavior you'll get by default (unless you've got collisions deactivated).

Sorry if I confused you.
We are making a player-controlled bulge that moves along the rope.
We decided to follow your hose example. But we couldn't figure out how to modify radii in such a way that the bulge sticks out from just one side.
Maybe we misunderstood your advice from your previous post and took a wrong turn somewhere.

As per your request this is how we set particle positons
_solver.positions[generatorIndex] += (Vector4)normal * 0.5f;
_solver.positions[generatorIndex + 1] += (Vector4)normal * 0.45f;
_solver.positions[generatorIndex - 1] += (Vector4)normal * 0.45f;



RE: Pull particles in a given direction - josemendez - 25-05-2021

(25-05-2021, 02:04 PM)xkalibrx Wrote: But we couldn't figure out how to modify radii in such a way that the bulge sticks out from just one side.

Particles are spheres. You can't modify the radius of a sphere so that it bulges just from one side. Modifying radius changes the size of the sphere equally in all directions. You need to move the sphere, as in the pic you posted.

(25-05-2021, 02:04 PM)xkalibrx Wrote: As per your request this is how we set particle positons
_solver.positions[generatorIndex] += (Vector4)normal * 0.5f;
_solver.positions[generatorIndex + 1] += (Vector4)normal * 0.45f;
_solver.positions[generatorIndex - 1] += (Vector4)normal * 0.45f;

Where does "normal" come from? Is it the rope's frame normal at that point? since positions are fed back into the simulation (as they're the starting point for the next frame's simulation update), this in turn changes the normal of the rope at that point, resulting in a feedback loop and hence jittering.

What you want is to get the particle to move as a result of external data/behavior. In the hose example, this external data is another object against which the rope collides. You could also define an external, stable normal direction that does not change as the rope is simulated.

The key word here is *external*: since the position of the external object does not change as a result of setting the particle position, you won't get a feedback loop.