Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Performance issues
#11
(25-01-2018, 03:11 PM)khalvr Wrote: Do tether constraints only work with fixed particles, or do they also work with pin constraints? The way i deal with anchor points right now is to pin a dummy rigidbody to a specific particle and freeze it using a fixed joint. This has some side effects but is easy to configure. Is there an easy way of un-fixing a particle through script? Will i have to iterate through all the particles in the solver and check their distance to the point?

Tethers ignore pinned particles, but there's a workaround: you could fix the pinned particles, add tethers, then unfix the particles. That should work.

However I still don't get why you go trough so much trouble just to anchor a particle. Simply creating a handle out of it will "promote" that particle to a GameObject, that you can move around, parent to other objects, etc. Pinning it to a rigidbody w/fixed joint seems a bit convoluted, specially since your rigidbodies do not rely on the rope to keep the appropriate distance between them (you're using joints for this, right?)

Since you have a chain of rigidbodies linked with joints and the rope is merely passive eye candy between each pair of bodies, simply creating handles and parenting them to the rigidbodies should suffice. The rigidbodies do not need to be aware of the rope's existence, so to speak, as they are already kept in place by spring joints.

To unfix a particle trough scripting, set its inverse mass to something larger than zero. The logic behind this is that a particle with zero inverse mass has infinite mass = cannot move at all. See the last bit of:

http://obi.virtualmethodstudio.com/tutor...icles.html

The specific function you want to use is Oni.SetParticleInverseMasses(solver, masses, particle count, offset);
Reply


Messages In This Thread
Performance issues - by khalvr - 24-01-2018, 04:00 PM
RE: Performance issues - by josemendez - 24-01-2018, 04:09 PM
RE: Performance issues - by josemendez - 24-01-2018, 04:24 PM
RE: Performance issues - by khalvr - 24-01-2018, 06:21 PM
RE: Performance issues - by josemendez - 25-01-2018, 10:10 AM
RE: Performance issues - by khalvr - 25-01-2018, 12:42 PM
RE: Performance issues - by josemendez - 25-01-2018, 01:24 PM
RE: Performance issues - by khalvr - 25-01-2018, 02:16 PM
RE: Performance issues - by josemendez - 25-01-2018, 02:35 PM
RE: Performance issues - by khalvr - 25-01-2018, 03:11 PM
RE: Performance issues - by josemendez - 25-01-2018, 03:32 PM
RE: Performance issues - by khalvr - 25-01-2018, 05:39 PM
RE: Performance issues - by khalvr - 26-01-2018, 01:09 PM