Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Particle Grabber Help
#2
(04-09-2019, 05:48 PM)neecko Wrote: Hey there.

I have been playing around with the particle grabber and haven't had any luck trying to do the following:

1. Grab a group of particles instead of just 1. Ideally it would grab the closest one clicked and then a few surrounding particles. I tried a few different things, but had no luck.

2. On release the particles snap up sharply. I tried playing with the inverse mass, but haven't had a lot of luck there either. What I would like to happen is for the particles to gently fall in place when the particle is released.

Thank you

Hi there,

I assume you're using the ObiParticlePicker class.

1. Should be pretty straightforward. Once you click and the pick the closest particle to the camera ray, simply add a loop to iterate trough all particles and store the indices of those that are within a certain radius of the picked one. You will then need to modify ParticlePickEventArgs to pass in a list of particles instead of a single one. (For instance, use List<int> instead of int for the indices, same for worldPositions)

2. Mass does not determine how fast particles move, it just doesn't work that way (not in real life, either). You need to apply an external force, or alternatively use damping to make particles lose kinetic energy. Depending on the exact result you're after this can be achieved in multiple ways, however they all involve modifying particle velocities (either directly or trough forces).
Reply


Messages In This Thread
Particle Grabber Help - by neecko - 04-09-2019, 05:48 PM
RE: Particle Grabber Help - by josemendez - 05-09-2019, 11:26 AM
RE: Particle Grabber Help - by neecko - 05-09-2019, 05:41 PM
RE: Particle Grabber Help - by josemendez - 06-09-2019, 07:03 AM
RE: Particle Grabber Help - by neecko - 06-09-2019, 06:25 PM
RE: Particle Grabber Help - by josemendez - 09-09-2019, 07:54 AM