Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Pull particles in a given direction
#2
Hi there,

Code:
But the question is, is it possible to pull particles in a given direction?

Yes. You can do basically anything you want with particles, since you have read/write access to all their properties: position, velocity, radius, mass, etc. See:
http://obi.virtualmethodstudio.com/tutor...icles.html

Code:
First I’ll describe what we tried. We tried putting a ring-like collider on a rope and moving it along the rope with force. But the ring would get stuck where the rope bends and at places where a particle is attached with ObiParticleAttachment.

That won't work well, since you're relying on collision detection just to keep the "bulge" on top of the rope. You're starting with an object that has 6 degrees of freedom (3 translational, 3 rotational), but you really only want 1 degree of freedom: translation along the rope.

It's easier, faster and more robust to work in a way that you only have 1 degree of freedom, compared to having all 6 and then trying to remove 5 of them trough contacts/collisions/constraints of some kind.

Code:
We then saw your post where you referenced the hose example (http://obi.virtualmethodstudio.com/forum/thread-2539.html). It could work for us but we can not quite figure out how to hook it up with player input.
Simply put, the bulge should follow the mouse position, but if the player tries to pull the bulge “outside” the rope, doing so should pull the rope (see picture for a graphic explanation).

Bulging in the hose example works by changing particle radius using a sine wave. You can simply change the center of the sine using input. This way the bulge can only move along the rope, there's no need to remove degrees of freedom since it only has 1 to begin with.

When the wave is sitting on top of the first or last particle, altering that particle's velocity will allow you to move it around.

Will whip up an example of this if you need.

cheers,
Reply


Messages In This Thread
Pull particles in a given direction - by xkalibrx - 19-05-2021, 05:09 PM
RE: Pull particles in a given direction - by josemendez - 20-05-2021, 08:03 AM